Skip to content

Commit 2429cb9

Browse files
authored
Merge pull request #5 from acrool/3-added-directional-control
3 added directional control
2 parents 7055d3d + cd1ef6d commit 2429cb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3983
-1060
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
2+
3+
The best way to propose a feature is to open an issue first and discuss your ideas there before implementing them.
4+
5+
Always follow the [contribution guidelines](https://github.com/imagine10255/acrool-react-table/blob/master/CONTRIBUTING.md) when submitting a pull request.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy Storybook to Pages
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
working-directory: ./example
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Wait for npm publish
21+
run: sleep 30 # 延遲30秒,可根據實際情況調整
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '18'
27+
28+
- name: Replace local links with actual versions
29+
run: |
30+
sed -i 's#"@acrool/react-skeleton": "link:.."#"@acrool/react-toaster": "latest"#' package.json
31+
sed -i 's#"react": "link:../node_modules/react"#"react": "^18.2.0"#' package.json
32+
sed -i 's#"react-dom": "link:../node_modules/react-dom"#"react-dom": "^18.2.0"#' package.json
33+
34+
- name: Install dependencies
35+
run: yarn install
36+
37+
- name: Build Storybook
38+
run: yarn build-storybook
39+
40+
- name: Install Wrangler
41+
run: yarn global add wrangler
42+
43+
- name: Deploy to Cloudflare Pages
44+
run: wrangler pages deploy ./storybook-static --project-name=acrool-react-modal --branch main
45+
env:
46+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [3.1.10-alpha.0](https://github.com/acrool/acrool-react-toaster/compare/v3.1.9...v3.1.10-alpha.0) (2024-10-16)
6+
57
### [3.1.9](https://github.com/acrool/acrool-react-toaster/compare/v3.1.9-alpha.2...v3.1.9) (2024-09-14)
68

79
### [3.1.9-alpha.2](https://github.com/acrool/acrool-react-toaster/compare/v3.1.9-alpha.1...v3.1.9-alpha.2) (2024-08-07)

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
## Features
2626

2727
- Supports 5 status colors: default, success, info, warning, danger
28+
- Support show limit
29+
- Support show position: top, bottom, left, center, right
2830
- Call via global method
2931
- Configurable disappearance delay seconds
3032
- Plug and unplug using `@acrool/react-portal` and `framer-motion`
@@ -59,7 +61,14 @@ const App = () => {
5961
return (
6062
<div>
6163
<BaseUsed/>
62-
<ToasterPortal defaultTimeout={3000}/>
64+
<ToasterPortal
65+
defaultTimeout={3000}
66+
limit={6}
67+
position={{
68+
vertical: 'top',
69+
horizontal: 'center',
70+
}}
71+
/>
6372
</div>
6473
);
6574
};

example/.storybook/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import type { StorybookConfig } from "@storybook/react-vite";
22

33
const config: StorybookConfig = {
4-
stories: ['../src/components/**/*.mdx', '../src/components/**/*.stories.@(ts|tsx)', '../_components/*.stories.@(ts|tsx)'],
5-
staticDirs: ['../../public'],
4+
stories: ['../src/components/**/*.mdx', '../src/components/**/*.stories.@(ts|tsx)'],
5+
staticDirs: ['../public'],
66
addons: [
77
"@storybook/addon-onboarding",
88
"@storybook/addon-links",
99
"@storybook/addon-essentials",
1010
"@chromatic-com/storybook",
1111
"@storybook/addon-interactions",
12+
"storybook-dark-mode",
1213
],
1314
framework: {
1415
name: "@storybook/react-vite",
1516
options: {},
1617
},
18+
typescript: {
19+
reactDocgen: false,
20+
},
1721
};
1822
export default config;

example/.storybook/preview.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import type { Preview } from "@storybook/react";
2+
import './reset.css';
23
import '@acrool/react-toaster/dist/index.css';
4+
import { themes } from '@storybook/theming';
5+
36
import '@acrool/react-grid/dist/index.css';
4-
import '@acrool/react-table/dist/index.css';
5-
import '@acrool/react-table/dist/themes/game.css';
67
import {GridThemeProvider} from "@acrool/react-grid";
78
import React from "react";
8-
import {ToasterPortal} from '@acrool/react-toaster';
99

1010

1111
const preview: Preview = {
1212
parameters: {
13+
darkMode: {
14+
dark: { ...themes.dark, appPreviewBg: '#000' },
15+
light: { ...themes.dark, appPreviewBg: '#fff' }
16+
},
1317
controls: {
1418
matchers: {
1519
color: /(background|color)$/i,
@@ -21,9 +25,6 @@ const preview: Preview = {
2125
(Story) => (
2226
<GridThemeProvider>
2327
<Story />
24-
25-
<ToasterPortal defaultTimeout={3000}/>
26-
2728
</GridThemeProvider>
2829
),
2930
],

example/.storybook/reset.css

Lines changed: 121 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,123 @@
1+
*, *::before, *::after {box-sizing: border-box;-webkit-box-sizing: border-box;line-height: normal; }
2+
3+
4+
5+
/*html {*/
6+
/* scrollbar-face-color: #646464;*/
7+
/* scrollbar-base-color: #646464;*/
8+
/* scrollbar-3dlight-color: #646464;*/
9+
/* scrollbar-highlight-color: #646464;*/
10+
/* scrollbar-track-color: #000;*/
11+
/* scrollbar-arrow-color: #000;*/
12+
/* scrollbar-shadow-color: #646464;*/
13+
/* scrollbar-dark-shadow-color: #646464;*/
14+
/*}*/
15+
16+
/*::-webkit-scrollbar { width: 8px; height: 3px;}*/
17+
/*::-webkit-scrollbar-button { background-color: #666;display: none }*/
18+
/*::-webkit-scrollbar-track { background-color: #2b3035;}*/
19+
/*::-webkit-scrollbar-track-piece { background-color: #2b3035;}*/
20+
/*::-webkit-scrollbar-thumb { height: 50px; background-color: #1f1f1f; border-radius: 3px;}*/
21+
/*::-webkit-scrollbar-corner { background-color: #646464;}*/
22+
/*::-webkit-resizer { background-color: #666;}*/
23+
24+
25+
/* a */
26+
a{
27+
text-shadow: none!important;
28+
color: inherit;
29+
transition: color .1s linear 0s,background-color .1s linear 0s,opacity .2s linear 0s!important;
30+
font-weight: 500;
31+
outline: 0!important;
32+
text-decoration: none;
33+
}
34+
a:active {color: inherit;text-decoration: none;}
35+
a:not([href]) {text-decoration: none;}
36+
a:not([href]):hover {text-decoration: none;}
37+
a:focus, a:hover, a:active {
38+
outline: 0!important;
39+
text-decoration: none;
40+
}
41+
42+
/* box */
43+
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {display: block;}
44+
[tabindex="-1"]:focus:not(:focus-visible) {outline: 0 !important;}
45+
46+
47+
p {margin-top: 0;margin-bottom: 0;}
48+
abbr[title], abbr[data-original-title] {text-decoration: underline;-webkit-text-decoration: underline dotted;text-decoration: underline dotted;cursor: help;border-bottom: 0;-webkit-text-decoration-skip-ink: none;text-decoration-skip-ink: none;}
49+
address {margin-bottom: 1rem;font-style: normal;line-height: inherit;}
50+
51+
/* list */
52+
ul{list-style-type: none;margin: 0;padding: 0;}
53+
ol, ul, dl {margin-top: 0;margin-bottom: 0;}
54+
ol ol, ul ul, ol ul, ul ol {margin-bottom: 0;}
55+
dt {font-weight: 700;}
56+
dd {margin-bottom: .5rem;margin-left: 0;}
57+
58+
/* code */
59+
blockquote {margin: 0 0 1rem;}
60+
b, strong {font-weight: bolder;}
61+
small {font-size: 80%;}
62+
small, .small {font-size: 80%;font-weight: 400;}
63+
sub, sup {position: relative;font-size: 75%;line-height: 0;vertical-align: baseline;}
64+
sub {bottom: -.25em;}
65+
sup {top: -.5em;}
66+
mark, .mark {padding: 0.2em;background-color: #fcf8e3;}
67+
code {font-size: 87.5%;color: #e83e8c;}
68+
kbd {padding: 0.2rem 0.4rem;font-size: 87.5%;color: #fff;background-color: #212529;border-radius: 0.2rem;}
69+
kbd kbd {padding: 0;font-size: 100%;font-weight: 700;}
70+
pre {margin-top: 0;margin-bottom: 1rem;overflow: auto;}
71+
pre {display: block;font-size: 87.5%;color: #212529;}
72+
pre, code, kbd, samp {font-size: 1em;}
73+
pre code {font-size: inherit;color: inherit;word-break: normal;}
74+
a > code {color: inherit;}
75+
76+
/* image */
77+
figure {margin: 0 0 1rem;}
78+
img {vertical-align: middle;border-style: none;}
79+
svg {overflow: hidden;vertical-align: middle;}
80+
81+
/*table*/
82+
table {border-collapse: collapse;}
83+
caption {padding-top: 0.75rem;padding-bottom: 0.75rem;color: #6c757d;text-align: left;caption-side: bottom;}
84+
th {text-align: inherit;}
85+
86+
/* form */
87+
label {display: inline-block;margin-bottom: 0;}
88+
input, button, select, optgroup, textarea {margin: 0;font-family: inherit;font-size: inherit;line-height: inherit;}
89+
button {border-radius: 0;background: none; border: none;}
90+
button:focus {outline: 1px dotted;outline: none;}
91+
button, input {overflow: visible;}
92+
button, select {text-transform: none;}
93+
select {word-wrap: normal;}
94+
button, [type="button"], [type="reset"], [type="submit"] {-webkit-appearance: button;}
95+
button:not(:disabled), [type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled) {cursor: pointer;}
96+
button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {padding: 0;border-style: none;}
97+
input[type="radio"], input[type="checkbox"] {box-sizing: border-box;padding: 0;}
98+
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {-webkit-appearance: listbox;}
99+
textarea {overflow: auto;resize: vertical;}
100+
fieldset {min-width: 0;padding: 0;margin: 0;border: 0;}
101+
legend {display: block;width: 100%;max-width: 100%;padding: 0;margin-bottom: .5rem;font-size: 1.5rem;line-height: inherit;color: inherit;white-space: normal;}
102+
progress {vertical-align: baseline;}
103+
[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button {height: auto;}
104+
[type="search"] {outline-offset: -2px;-webkit-appearance: none;}
105+
[type="search"]::-webkit-search-decoration {-webkit-appearance: none;}
106+
::-webkit-file-upload-button {font: inherit;-webkit-appearance: button;}
107+
output {display: inline-block;}
108+
summary {display: list-item;cursor: pointer;}
109+
template {display: none;}
110+
[hidden] {display: none !important;}
111+
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:active {
112+
-webkit-animation-name: autofill;
113+
-webkit-animation-fill-mode: both;
114+
transition: background-color 5000s ease-in-out 0s;
115+
}
116+
/* 修復 chrome auto輸入之後的樣式 */
117+
@-webkit-keyframes autofill { to {background: none;} }
118+
1119
:root {
2-
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
120+
/*noinspection CssUnresolvedCustomProperty*/
121+
--vh100: calc(var(--vh, 1vh) * 100);
3122
}
123+

example/_components/Toaster.stories.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

example/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Acrool React Toaster</title>
7+
<title>Acrool React Img</title>
8+
<link rel="stylesheet" type="text/css" href="/static/styles/reset.css?v=3" />
89
</head>
910
<body>
1011
<div id="root"></div>
1112
<script type="module" src="/src/main.tsx"></script>
1213
</body>
1314
</html>
15+

0 commit comments

Comments
 (0)