bestax-mcp 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/data/catalog.json +1869 -0
- package/data/components/Autocomplete.json +604 -0
- package/data/components/Avatar.json +220 -0
- package/data/components/Avatars.json +294 -0
- package/data/components/Badge.json +261 -0
- package/data/components/Block.json +105 -0
- package/data/components/Box.json +157 -0
- package/data/components/Breadcrumb.json +155 -0
- package/data/components/Button.json +599 -0
- package/data/components/Buttons.json +533 -0
- package/data/components/Card.json +506 -0
- package/data/components/Carousel.json +512 -0
- package/data/components/Cell.json +154 -0
- package/data/components/Checkbox.json +176 -0
- package/data/components/Checkboxes.json +240 -0
- package/data/components/Code.json +128 -0
- package/data/components/Collapse.json +218 -0
- package/data/components/Column.json +284 -0
- package/data/components/Columns.json +542 -0
- package/data/components/ConfigProvider.json +16 -0
- package/data/components/Container.json +149 -0
- package/data/components/Content.json +228 -0
- package/data/components/Control.json +484 -0
- package/data/components/DateInput.json +872 -0
- package/data/components/DateTimeInput.json +952 -0
- package/data/components/Delete.json +153 -0
- package/data/components/Dialog.json +285 -0
- package/data/components/Divider.json +68 -0
- package/data/components/Dropdown.json +353 -0
- package/data/components/Emphasis.json +99 -0
- package/data/components/Field.json +539 -0
- package/data/components/Figure.json +143 -0
- package/data/components/File.json +403 -0
- package/data/components/Footer.json +109 -0
- package/data/components/Grid.json +357 -0
- package/data/components/Hero.json +340 -0
- package/data/components/Icon.json +232 -0
- package/data/components/IconText.json +307 -0
- package/data/components/Image.json +166 -0
- package/data/components/Input.json +583 -0
- package/data/components/Level.json +332 -0
- package/data/components/Link.json +154 -0
- package/data/components/LinkButton.json +247 -0
- package/data/components/ListItem.json +101 -0
- package/data/components/Loading.json +323 -0
- package/data/components/Media.json +345 -0
- package/data/components/Menu.json +317 -0
- package/data/components/Message.json +303 -0
- package/data/components/Modal.json +444 -0
- package/data/components/Navbar.json +996 -0
- package/data/components/Notification.json +165 -0
- package/data/components/Numberinput.json +364 -0
- package/data/components/OrderedList.json +189 -0
- package/data/components/Pagination.json +619 -0
- package/data/components/Panel.json +582 -0
- package/data/components/Paragraph.json +107 -0
- package/data/components/Pre.json +114 -0
- package/data/components/Progress.json +137 -0
- package/data/components/Radio.json +164 -0
- package/data/components/Radios.json +240 -0
- package/data/components/Rate.json +466 -0
- package/data/components/Reveal.json +177 -0
- package/data/components/Section.json +123 -0
- package/data/components/Select.json +526 -0
- package/data/components/Sidebar.json +488 -0
- package/data/components/Skeleton.json +162 -0
- package/data/components/Slider.json +534 -0
- package/data/components/Span.json +100 -0
- package/data/components/Steps.json +452 -0
- package/data/components/Strong.json +105 -0
- package/data/components/SubTitle.json +233 -0
- package/data/components/Switch.json +291 -0
- package/data/components/Table.json +490 -0
- package/data/components/Tabs.json +592 -0
- package/data/components/Tag.json +197 -0
- package/data/components/Taginput.json +587 -0
- package/data/components/Tags.json +181 -0
- package/data/components/TextArea.json +483 -0
- package/data/components/Theme.json +65 -0
- package/data/components/TimeInput.json +906 -0
- package/data/components/Title.json +240 -0
- package/data/components/Toast.json +308 -0
- package/data/components/Tooltip.json +212 -0
- package/data/components/UnorderedList.json +149 -0
- package/data/components/Valid value constants.json +16 -0
- package/data/components/classNames.json +65 -0
- package/data/components/useBulmaClasses.json +169 -0
- package/data/components/usePrefixedClassNames.json +25 -0
- package/data/skills/bestax-custom-component/SKILL.md +196 -0
- package/data/skills/bestax-custom-component/examples/stat-card.tsx +105 -0
- package/data/skills/bestax-custom-component/references/api.md +90 -0
- package/data/skills/bestax-custom-component/references/component-catalog.md +149 -0
- package/data/skills/bestax-custom-component/references/library-contributor.md +395 -0
- package/data/skills/bestax-custom-component/references/patterns.md +136 -0
- package/data/skills/bestax-form/SKILL.md +254 -0
- package/data/skills/bestax-form/references/api.md +103 -0
- package/data/skills/bestax-form/references/patterns.md +210 -0
- package/data/skills/bestax-icons/SKILL.md +80 -0
- package/data/skills/bestax-icons/examples/icon-usage.tsx +80 -0
- package/data/skills/bestax-icons/references/icon-libraries.md +131 -0
- package/data/skills/bestax-layout-scaffold/SKILL.md +196 -0
- package/data/skills/bestax-layout-scaffold/examples/app-shell.tsx +86 -0
- package/data/skills/bestax-layout-scaffold/examples/card-grid.tsx +106 -0
- package/data/skills/bestax-layout-scaffold/examples/centered.tsx +56 -0
- package/data/skills/bestax-layout-scaffold/examples/content-page.tsx +90 -0
- package/data/skills/bestax-layout-scaffold/examples/landing.tsx +122 -0
- package/data/skills/bestax-layout-scaffold/references/archetypes.md +246 -0
- package/data/skills/bestax-layout-scaffold/references/layout-components.md +269 -0
- package/data/skills/bestax-migrate/SKILL.md +78 -0
- package/data/skills/bestax-migrate/references/component-map.md +91 -0
- package/data/skills/bestax-migrate/references/css-migration.md +100 -0
- package/data/skills/bestax-migrate/references/prop-map.md +48 -0
- package/data/skills/bestax-migrate/references/unmappables.md +124 -0
- package/data/skills/bestax-optimize/SKILL.md +131 -0
- package/data/skills/bestax-optimize/references/modular-build.md +173 -0
- package/data/skills/bestax-theming/SKILL.md +117 -0
- package/data/skills/bestax-theming/examples/dark-mode.tsx +38 -0
- package/data/skills/bestax-theming/examples/theme-config.tsx +60 -0
- package/data/skills/bestax-theming/references/css-variables.md +466 -0
- package/data/skills/bestax-theming/references/themeable-components.md +119 -0
- package/data/skills.json +148 -0
- package/dist/data.d.ts +131 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +111 -0
- package/dist/format.d.ts +37 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +178 -0
- package/dist/helper-props.d.ts +57 -0
- package/dist/helper-props.d.ts.map +1 -0
- package/dist/helper-props.js +249 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/search.d.ts +32 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +194 -0
- package/dist/server.d.ts +28 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +616 -0
- package/dist/version.d.ts +29 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +147 -0
- package/package.json +70 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Title",
|
|
3
|
+
"kind": "component",
|
|
4
|
+
"category": "elements",
|
|
5
|
+
"slug": "elements/title",
|
|
6
|
+
"docsUrl": "https://bestax.io/docs/api/elements/title",
|
|
7
|
+
"examples": [
|
|
8
|
+
{ "title": "Default Title", "code": "<Title>Default Title</Title>" },
|
|
9
|
+
{
|
|
10
|
+
"title": "Has Skeleton",
|
|
11
|
+
"code": "<Title hasSkeleton>Title with Skeleton Effect</Title>"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"title": "Is Skeleton",
|
|
15
|
+
"code": "<Title skeleton>Title Skeleton Effect</Title>"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "Different Sizes",
|
|
19
|
+
"code": "<>\n <Title size=\"1\">Title Size 1</Title>\n <Title size=\"3\">Title Size 3</Title>\n</>"
|
|
20
|
+
},
|
|
21
|
+
{ "title": "Spaced Title", "code": "<Title isSpaced>Spaced Title</Title>" },
|
|
22
|
+
{
|
|
23
|
+
"title": "With Margin",
|
|
24
|
+
"code": "<Title m=\"4\">Title with Margin</Title>"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "As Paragraph",
|
|
28
|
+
"code": "<Title as=\"p\" size=\"3\">\n Title as Paragraph\n</Title>"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"title": "All Sizes",
|
|
32
|
+
"code": "<>\n {['1', '2', '3', '4', '5', '6'].map(size => (\n <Title key={size} size={size}>\n Title Size {size}\n </Title>\n ))}\n</>"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"title": "Title and Subtitle",
|
|
36
|
+
"code": "<Block>\n <Title as=\"p\" size=\"1\">\n Title 1\n </Title>\n <SubTitle as=\"p\" size=\"3\">\n Subtitle 3\n </SubTitle>\n</Block>"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"accessibility": "- **Semantic HTML:** Use appropriate heading levels for document structure.\n- **Spacing:** Use `isSpaced` for extra margin when needed.\n- **Screen readers:** Headings are key landmarks, so set the correct `as` and `size` prop for hierarchy.\n\n:::tip\nWhen using `as=\"p\"`, the element is visually styled as a heading but semantically a paragraph.\n:::",
|
|
40
|
+
"related": ["Block", "SubTitle", "useBulmaClasses"],
|
|
41
|
+
"storybook": "https://bestax.io/storybook/?path=/story/elements-title--default",
|
|
42
|
+
"summary": "The `Title` component renders a Bulma-styled title (heading), supporting sizes `1`-`6`, spacing, and rendering as any heading or paragraph element (`h1`-`h6`, `p`).",
|
|
43
|
+
"import": "import { Title } from '@allxsmith/bestax-bulma';",
|
|
44
|
+
"sourceFile": "bulma-ui/src/elements/Title.tsx",
|
|
45
|
+
"rootClass": "title",
|
|
46
|
+
"parts": [
|
|
47
|
+
{
|
|
48
|
+
"path": "Title",
|
|
49
|
+
"summary": "The `Title` component renders a Bulma-styled title (heading), supporting sizes `1`-`6`, spacing, and rendering as any heading or paragraph element (`h1`-`h6`, `p`).",
|
|
50
|
+
"component": null,
|
|
51
|
+
"props": [
|
|
52
|
+
{
|
|
53
|
+
"name": "className",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"default": null,
|
|
56
|
+
"description": "Additional CSS classes to apply.",
|
|
57
|
+
"required": false,
|
|
58
|
+
"inherited": false,
|
|
59
|
+
"deprecated": false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "size",
|
|
63
|
+
"type": "'1' | '2' | '3' | '4' | '5' | '6'",
|
|
64
|
+
"default": null,
|
|
65
|
+
"description": "Size of the title (Bulma sizes).",
|
|
66
|
+
"required": false,
|
|
67
|
+
"inherited": false,
|
|
68
|
+
"deprecated": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "isSpaced",
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"default": "false",
|
|
74
|
+
"description": "Adds margin below the title.",
|
|
75
|
+
"required": false,
|
|
76
|
+
"inherited": false,
|
|
77
|
+
"deprecated": false
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "as",
|
|
81
|
+
"type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p'",
|
|
82
|
+
"default": "'h1'",
|
|
83
|
+
"description": "HTML element to render as (h1-h6 or p).",
|
|
84
|
+
"required": false,
|
|
85
|
+
"inherited": false,
|
|
86
|
+
"deprecated": false
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "hasSkeleton",
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"default": "false",
|
|
92
|
+
"description": "Applies the `has-skeleton` class to part of the content.",
|
|
93
|
+
"required": false,
|
|
94
|
+
"inherited": false,
|
|
95
|
+
"deprecated": false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "children",
|
|
99
|
+
"type": "React.ReactNode",
|
|
100
|
+
"default": null,
|
|
101
|
+
"description": "Title content.",
|
|
102
|
+
"required": false,
|
|
103
|
+
"inherited": false,
|
|
104
|
+
"deprecated": false
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "textColor",
|
|
108
|
+
"type": "Bulma color | 'inherit' | 'current'",
|
|
109
|
+
"default": null,
|
|
110
|
+
"description": "Text color helper.",
|
|
111
|
+
"required": false,
|
|
112
|
+
"inherited": false,
|
|
113
|
+
"deprecated": false,
|
|
114
|
+
"valuesRef": "helpers/valid-values"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "bgColor",
|
|
118
|
+
"type": "Bulma color | 'inherit' | 'current'",
|
|
119
|
+
"default": null,
|
|
120
|
+
"description": "Background color helper.",
|
|
121
|
+
"required": false,
|
|
122
|
+
"inherited": false,
|
|
123
|
+
"deprecated": false,
|
|
124
|
+
"valuesRef": "helpers/valid-values"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"extraProps": [
|
|
128
|
+
{
|
|
129
|
+
"name": "skeleton",
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"default": null,
|
|
132
|
+
"description": "Applies the `is-skeleton` class to the entire component.",
|
|
133
|
+
"required": false,
|
|
134
|
+
"inherited": false,
|
|
135
|
+
"deprecated": false
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"catchAll": "All standard <h1>–<h6> attributes and Bulma helper props",
|
|
139
|
+
"types": []
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"cssVars": [
|
|
143
|
+
{
|
|
144
|
+
"css": "--bulma-title-color",
|
|
145
|
+
"sass": "$title-color",
|
|
146
|
+
"default": "var(--bulma-text-strong)",
|
|
147
|
+
"scope": "component"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"css": "--bulma-title-family",
|
|
151
|
+
"sass": "$title-family",
|
|
152
|
+
"default": "false",
|
|
153
|
+
"scope": "component"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"css": "--bulma-title-size",
|
|
157
|
+
"sass": "$title-size",
|
|
158
|
+
"default": "var(--bulma-size-3)",
|
|
159
|
+
"scope": "component"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"css": "--bulma-title-weight",
|
|
163
|
+
"sass": "$title-weight",
|
|
164
|
+
"default": "var(--bulma-weight-extrabold)",
|
|
165
|
+
"scope": "component"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"css": "--bulma-title-line-height",
|
|
169
|
+
"sass": "$title-line-height",
|
|
170
|
+
"default": "1.125",
|
|
171
|
+
"scope": "component"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"css": "--bulma-title-strong-color",
|
|
175
|
+
"sass": "$title-strong-color",
|
|
176
|
+
"default": "inherit",
|
|
177
|
+
"scope": "component"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"css": "--bulma-title-strong-weight",
|
|
181
|
+
"sass": "$title-strong-weight",
|
|
182
|
+
"default": "inherit",
|
|
183
|
+
"scope": "component"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"css": "--bulma-title-sub-size",
|
|
187
|
+
"sass": "$title-sub-size",
|
|
188
|
+
"default": "0.75em",
|
|
189
|
+
"scope": "component"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"css": "--bulma-title-sup-size",
|
|
193
|
+
"sass": "$title-sup-size",
|
|
194
|
+
"default": "0.75em",
|
|
195
|
+
"scope": "component"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"css": "--bulma-subtitle-color",
|
|
199
|
+
"sass": "$subtitle-color",
|
|
200
|
+
"default": "var(--bulma-text)",
|
|
201
|
+
"scope": "component"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"css": "--bulma-subtitle-family",
|
|
205
|
+
"sass": "$subtitle-family",
|
|
206
|
+
"default": "false",
|
|
207
|
+
"scope": "component"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"css": "--bulma-subtitle-size",
|
|
211
|
+
"sass": "$subtitle-size",
|
|
212
|
+
"default": "var(--bulma-size-5)",
|
|
213
|
+
"scope": "component"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"css": "--bulma-subtitle-weight",
|
|
217
|
+
"sass": "$subtitle-weight",
|
|
218
|
+
"default": "var(--bulma-weight-normal)",
|
|
219
|
+
"scope": "component"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"css": "--bulma-subtitle-line-height",
|
|
223
|
+
"sass": "$subtitle-line-height",
|
|
224
|
+
"default": "1.25",
|
|
225
|
+
"scope": "component"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"css": "--bulma-subtitle-strong-color",
|
|
229
|
+
"sass": "$subtitle-strong-color",
|
|
230
|
+
"default": "var(--bulma-text-strong)",
|
|
231
|
+
"scope": "component"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"css": "--bulma-subtitle-strong-weight",
|
|
235
|
+
"sass": "$subtitle-strong-weight",
|
|
236
|
+
"default": "var(--bulma-weight-semibold)",
|
|
237
|
+
"scope": "component"
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Toast",
|
|
3
|
+
"kind": "component",
|
|
4
|
+
"category": "components",
|
|
5
|
+
"slug": "components/toast",
|
|
6
|
+
"docsUrl": "https://bestax.io/docs/api/components/toast",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"title": "Basic Toast",
|
|
10
|
+
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button color=\"primary\" onClick={() => setShowToast(true)}>\n Show Toast\n </Button>\n {showToast && (\n <Toast\n inline\n message=\"This is a notification message!\"\n duration={0}\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"title": "Toast Types",
|
|
14
|
+
"code": "function example() {\n const [toastType, setToastType] = useState(null);\n return (\n <Block>\n <Buttons>\n <Button color=\"success\" onClick={() => setToastType('success')}>\n Success\n </Button>\n <Button color=\"danger\" onClick={() => setToastType('danger')}>\n Danger\n </Button>\n <Button color=\"warning\" onClick={() => setToastType('warning')}>\n Warning\n </Button>\n <Button color=\"info\" onClick={() => setToastType('info')}>\n Info\n </Button>\n </Buttons>\n {toastType && (\n <Toast\n inline\n message={`This is a ${toastType} message!`}\n type={toastType}\n duration={0}\n onClose={() => setToastType(null)}\n />\n )}\n </Block>\n );\n}"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"title": "Toast Positions",
|
|
18
|
+
"code": "function example() {\n const [position, setPosition] = useState(null);\n const [box, setBox] = useState(null);\n return (\n <div\n ref={setBox}\n style={{\n position: 'relative',\n height: '300px',\n transform: 'translateZ(0)',\n border: '1px dashed var(--ifm-color-emphasis-300)',\n padding: '1rem',\n }}\n >\n <Buttons>\n <Button onClick={() => setPosition('top-left')}>Top Left</Button>\n <Button onClick={() => setPosition('top-center')}>Top Center</Button>\n <Button onClick={() => setPosition('top-right')}>Top Right</Button>\n </Buttons>\n <Buttons>\n <Button onClick={() => setPosition('bottom-left')}>Bottom Left</Button>\n <Button onClick={() => setPosition('bottom-center')}>\n Bottom Center\n </Button>\n <Button onClick={() => setPosition('bottom-right')}>\n Bottom Right\n </Button>\n </Buttons>\n {position && box && (\n <Toast\n container={box}\n message={`Position: ${position}`}\n position={position}\n type=\"info\"\n duration={0}\n onClose={() => setPosition(null)}\n />\n )}\n </div>\n );\n}"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"title": "Action Button",
|
|
22
|
+
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button color=\"primary\" onClick={() => setShowToast(true)}>\n Show Toast with Action\n </Button>\n {showToast && (\n <Toast\n inline\n message=\"Item deleted\"\n actionText=\"Undo\"\n actionType=\"info\"\n onAction={() => alert('Undone!')}\n duration={0}\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"title": "Cancel + Action Buttons",
|
|
26
|
+
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button color=\"primary\" onClick={() => setShowToast(true)}>\n Show Confirm Toast\n </Button>\n {showToast && (\n <Toast\n inline\n message=\"Are you sure you want to proceed?\"\n cancelText=\"Cancel\"\n actionText=\"Confirm\"\n actionType=\"danger\"\n duration={0}\n onAction={() => alert('Confirmed!')}\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Closable",
|
|
30
|
+
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button color=\"primary\" onClick={() => setShowToast(true)}>\n Show Closable Toast\n </Button>\n {showToast && (\n <Toast\n inline\n message=\"This toast has a close button\"\n closable\n duration={0}\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"title": "Indefinite",
|
|
34
|
+
"code": "function example() {\n const [showToast, setShowToast] = useState(false);\n return (\n <Block>\n <Button onClick={() => setShowToast(true)}>Show Indefinite Toast</Button>\n {showToast && (\n <Toast\n inline\n message=\"This won't auto-dismiss\"\n indefinite\n onClose={() => setShowToast(false)}\n />\n )}\n </Block>\n );\n}"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"accessibility": "- Uses `role=\"alert\"` for screen reader announcement.\n- Has `aria-live=\"polite\"` for non-intrusive notifications.\n- The closable button has `aria-label=\"Close\"`.\n- `pauseOnHover` lets users keep the toast visible while reading.\n- `cancelable` (default `true`) supports Escape-key dismiss.",
|
|
38
|
+
"related": ["Dialog"],
|
|
39
|
+
"storybook": "https://bestax.io/storybook/?path=/story/components-toast",
|
|
40
|
+
"summary": "The `Toast` component provides brief notification messages with optional action and cancel buttons.",
|
|
41
|
+
"import": "import { Toast, ToastContainer, toast } from '@allxsmith/bestax-bulma';",
|
|
42
|
+
"sourceFile": "bulma-ui/src/components/Toast.tsx",
|
|
43
|
+
"rootClass": "toast",
|
|
44
|
+
"parts": [
|
|
45
|
+
{
|
|
46
|
+
"path": "Toast",
|
|
47
|
+
"summary": "The `Toast` component provides brief notification messages with optional action and cancel buttons.",
|
|
48
|
+
"component": null,
|
|
49
|
+
"props": [
|
|
50
|
+
{
|
|
51
|
+
"name": "message",
|
|
52
|
+
"type": "string",
|
|
53
|
+
"default": null,
|
|
54
|
+
"description": "The message to display (required).",
|
|
55
|
+
"required": false,
|
|
56
|
+
"inherited": false,
|
|
57
|
+
"deprecated": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "type",
|
|
61
|
+
"type": "'default' | 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
62
|
+
"default": "'default'",
|
|
63
|
+
"description": "Color variant — colors the toast **background**.",
|
|
64
|
+
"required": false,
|
|
65
|
+
"inherited": false,
|
|
66
|
+
"deprecated": false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "actionType",
|
|
70
|
+
"type": "'default' | 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'",
|
|
71
|
+
"default": null,
|
|
72
|
+
"description": "Color variant — colors the **action button** text.",
|
|
73
|
+
"required": false,
|
|
74
|
+
"inherited": false,
|
|
75
|
+
"deprecated": false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "position",
|
|
79
|
+
"type": "'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'",
|
|
80
|
+
"default": "'top-right'",
|
|
81
|
+
"description": "Position on the screen. Default: 'top-right'.",
|
|
82
|
+
"required": false,
|
|
83
|
+
"inherited": false,
|
|
84
|
+
"deprecated": false
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "duration",
|
|
88
|
+
"type": "number",
|
|
89
|
+
"default": "2000",
|
|
90
|
+
"description": "Duration in ms before auto-close. `0` disables auto-close.",
|
|
91
|
+
"required": false,
|
|
92
|
+
"inherited": false,
|
|
93
|
+
"deprecated": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "indefinite",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"default": "false",
|
|
99
|
+
"description": "Keeps the toast visible until dismissed.",
|
|
100
|
+
"required": false,
|
|
101
|
+
"inherited": false,
|
|
102
|
+
"deprecated": false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "dismissible",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"default": "true",
|
|
108
|
+
"description": "Whether clicking the toast (or outside it) dismisses it.",
|
|
109
|
+
"required": false,
|
|
110
|
+
"inherited": false,
|
|
111
|
+
"deprecated": false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "closable",
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"default": "false",
|
|
117
|
+
"description": "Show an explicit close (X) button. Default: false.",
|
|
118
|
+
"required": false,
|
|
119
|
+
"inherited": false,
|
|
120
|
+
"deprecated": false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "rounded",
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"default": "false",
|
|
126
|
+
"description": "Pill-shaped (rounded corners).",
|
|
127
|
+
"required": false,
|
|
128
|
+
"inherited": false,
|
|
129
|
+
"deprecated": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "pauseOnHover",
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"default": "false",
|
|
135
|
+
"description": "Pause auto-close timer on hover. Default: false.",
|
|
136
|
+
"required": false,
|
|
137
|
+
"inherited": false,
|
|
138
|
+
"deprecated": false
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "cancelable",
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"default": "true",
|
|
144
|
+
"description": "Whether the toast can be dismissed with Escape. Default: true.",
|
|
145
|
+
"required": false,
|
|
146
|
+
"inherited": false,
|
|
147
|
+
"deprecated": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "actionText",
|
|
151
|
+
"type": "string",
|
|
152
|
+
"default": null,
|
|
153
|
+
"description": "Text for an action button (e.g. \"Undo\").",
|
|
154
|
+
"required": false,
|
|
155
|
+
"inherited": false,
|
|
156
|
+
"deprecated": false
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "cancelText",
|
|
160
|
+
"type": "string",
|
|
161
|
+
"default": null,
|
|
162
|
+
"description": "Text for a cancel button.",
|
|
163
|
+
"required": false,
|
|
164
|
+
"inherited": false,
|
|
165
|
+
"deprecated": false
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "onAction",
|
|
169
|
+
"type": "() => void",
|
|
170
|
+
"default": null,
|
|
171
|
+
"description": "Callback when the action button is clicked.",
|
|
172
|
+
"required": false,
|
|
173
|
+
"inherited": false,
|
|
174
|
+
"deprecated": false
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "onClose",
|
|
178
|
+
"type": "() => void",
|
|
179
|
+
"default": null,
|
|
180
|
+
"description": "Callback when toast closes.",
|
|
181
|
+
"required": false,
|
|
182
|
+
"inherited": false,
|
|
183
|
+
"deprecated": false
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "container",
|
|
187
|
+
"type": "string | HTMLElement",
|
|
188
|
+
"default": null,
|
|
189
|
+
"description": "CSS selector or DOM node to mount the toast into.",
|
|
190
|
+
"required": false,
|
|
191
|
+
"inherited": false,
|
|
192
|
+
"deprecated": false
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "inline",
|
|
196
|
+
"type": "boolean",
|
|
197
|
+
"default": "false",
|
|
198
|
+
"description": "Renders inline instead of using a portal.",
|
|
199
|
+
"required": false,
|
|
200
|
+
"inherited": false,
|
|
201
|
+
"deprecated": false
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"extraProps": [
|
|
205
|
+
{
|
|
206
|
+
"name": "className",
|
|
207
|
+
"type": "string",
|
|
208
|
+
"default": null,
|
|
209
|
+
"description": "Additional CSS classes.",
|
|
210
|
+
"required": false,
|
|
211
|
+
"inherited": false,
|
|
212
|
+
"deprecated": false
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "ref",
|
|
216
|
+
"type": "React.Ref<HTMLDivElement>",
|
|
217
|
+
"default": null,
|
|
218
|
+
"description": "Ref forwarded to the toast element.",
|
|
219
|
+
"required": false,
|
|
220
|
+
"inherited": false,
|
|
221
|
+
"deprecated": false
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"catchAll": "All standard <div> attributes and Bulma helper props",
|
|
225
|
+
"types": []
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"cssVars": [
|
|
229
|
+
{
|
|
230
|
+
"css": "--bulma-toast-background",
|
|
231
|
+
"sass": "$toast-background",
|
|
232
|
+
"default": "hsl(0, 0%, 21%)",
|
|
233
|
+
"scope": "component"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"css": "--bulma-toast-color",
|
|
237
|
+
"sass": "$toast-color",
|
|
238
|
+
"default": "hsl(0, 0%, 96%)",
|
|
239
|
+
"scope": "component"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"css": "--bulma-toast-radius",
|
|
243
|
+
"sass": "$toast-radius",
|
|
244
|
+
"default": "var(--bulma-radius)",
|
|
245
|
+
"scope": "component"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"css": "--bulma-toast-shadow",
|
|
249
|
+
"sass": "$toast-shadow",
|
|
250
|
+
"default": "0 4px 12px hsla(0, 0%, 0%, 0.2)",
|
|
251
|
+
"scope": "component"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"css": "--bulma-toast-padding",
|
|
255
|
+
"sass": "$toast-padding",
|
|
256
|
+
"default": "0.875rem 1.25rem",
|
|
257
|
+
"scope": "component"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"css": "--bulma-toast-min-width",
|
|
261
|
+
"sass": "$toast-min-width",
|
|
262
|
+
"default": "288px",
|
|
263
|
+
"scope": "component"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"css": "--bulma-toast-max-width",
|
|
267
|
+
"sass": "$toast-max-width",
|
|
268
|
+
"default": "568px",
|
|
269
|
+
"scope": "component"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"css": "--bulma-toast-gap",
|
|
273
|
+
"sass": "$toast-gap",
|
|
274
|
+
"default": "1rem",
|
|
275
|
+
"scope": "component"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"css": "--bulma-toast-message-size",
|
|
279
|
+
"sass": "$toast-message-size",
|
|
280
|
+
"default": "0.95rem",
|
|
281
|
+
"scope": "component"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"css": "--bulma-toast-animation-duration",
|
|
285
|
+
"sass": "$toast-animation-duration",
|
|
286
|
+
"default": "0.3s",
|
|
287
|
+
"scope": "component"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"css": "--bulma-toast-action-weight",
|
|
291
|
+
"sass": "$toast-action-weight",
|
|
292
|
+
"default": "var(--bulma-weight-semibold)",
|
|
293
|
+
"scope": "component"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"css": "--bulma-toast-action-radius",
|
|
297
|
+
"sass": "$toast-action-radius",
|
|
298
|
+
"default": "var(--bulma-radius)",
|
|
299
|
+
"scope": "component"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"css": "--bulma-toast-action-hover-opacity",
|
|
303
|
+
"sass": "$toast-action-hover-opacity",
|
|
304
|
+
"default": "0.1",
|
|
305
|
+
"scope": "component"
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
}
|