@velocity-astro/cms-ui 0.1.0-beta.1 → 0.1.0-beta.12
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/component-registry.json +93 -8
- package/dist/components/BarChart/BarChart.d.ts +23 -0
- package/dist/components/BarChart/BarChart.d.ts.map +1 -0
- package/dist/components/BarChart/BarChart.js +19 -0
- package/dist/components/BarChart/BarChart.js.map +1 -0
- package/dist/components/BarChart/BarChart.variants.d.ts +29 -0
- package/dist/components/BarChart/BarChart.variants.d.ts.map +1 -0
- package/dist/components/BarChart/BarChart.variants.js +81 -0
- package/dist/components/BarChart/BarChart.variants.js.map +1 -0
- package/dist/components/BarChart/index.d.ts +2 -0
- package/dist/components/BarChart/index.d.ts.map +1 -0
- package/dist/components/BarChart/index.js +2 -0
- package/dist/components/BarChart/index.js.map +1 -0
- package/dist/components/Button/Button.d.ts +6 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +5 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.variants.d.ts +6 -1
- package/dist/components/Button/Button.variants.d.ts.map +1 -1
- package/dist/components/Button/Button.variants.js +13 -1
- package/dist/components/Button/Button.variants.js.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +3 -3
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.variants.d.ts +4 -1
- package/dist/components/Card/Card.variants.d.ts.map +1 -1
- package/dist/components/Card/Card.variants.js +6 -1
- package/dist/components/Card/Card.variants.js.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +30 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.js +32 -0
- package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.variants.d.ts +24 -0
- package/dist/components/ColorPicker/ColorPicker.variants.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.variants.js +42 -0
- package/dist/components/ColorPicker/ColorPicker.variants.js.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +2 -0
- package/dist/components/ColorPicker/index.d.ts.map +1 -0
- package/dist/components/ColorPicker/index.js +2 -0
- package/dist/components/ColorPicker/index.js.map +1 -0
- package/dist/components/FileButton/FileButton.d.ts +3 -1
- package/dist/components/FileButton/FileButton.d.ts.map +1 -1
- package/dist/components/FileButton/FileButton.js +2 -2
- package/dist/components/FileButton/FileButton.js.map +1 -1
- package/dist/components/Grid/Grid.variants.d.ts +1 -0
- package/dist/components/Grid/Grid.variants.d.ts.map +1 -1
- package/dist/components/Grid/Grid.variants.js +4 -3
- package/dist/components/Grid/Grid.variants.js.map +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts.map +1 -1
- package/dist/components/Heading/Heading.js +2 -2
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/Heading/Heading.variants.d.ts +1 -0
- package/dist/components/Heading/Heading.variants.d.ts.map +1 -1
- package/dist/components/Heading/Heading.variants.js +2 -0
- package/dist/components/Heading/Heading.variants.js.map +1 -1
- package/dist/components/LoadingMark/LoadingMark.d.ts +11 -0
- package/dist/components/LoadingMark/LoadingMark.d.ts.map +1 -0
- package/dist/components/LoadingMark/LoadingMark.js +17 -0
- package/dist/components/LoadingMark/LoadingMark.js.map +1 -0
- package/dist/components/LoadingMark/LoadingMark.variants.d.ts +22 -0
- package/dist/components/LoadingMark/LoadingMark.variants.d.ts.map +1 -0
- package/dist/components/LoadingMark/LoadingMark.variants.js +18 -0
- package/dist/components/LoadingMark/LoadingMark.variants.js.map +1 -0
- package/dist/components/LoadingMark/index.d.ts +2 -0
- package/dist/components/LoadingMark/index.d.ts.map +1 -0
- package/dist/components/LoadingMark/index.js +2 -0
- package/dist/components/LoadingMark/index.js.map +1 -0
- package/dist/components/Logo/Logo.d.ts +10 -2
- package/dist/components/Logo/Logo.d.ts.map +1 -1
- package/dist/components/Logo/Logo.js +11 -3
- package/dist/components/Logo/Logo.js.map +1 -1
- package/dist/components/Logo/Logo.variants.d.ts +5 -2
- package/dist/components/Logo/Logo.variants.d.ts.map +1 -1
- package/dist/components/Logo/Logo.variants.js +10 -1
- package/dist/components/Logo/Logo.variants.js.map +1 -1
- package/dist/components/Meter/Meter.d.ts +13 -0
- package/dist/components/Meter/Meter.d.ts.map +1 -0
- package/dist/components/Meter/Meter.js +8 -0
- package/dist/components/Meter/Meter.js.map +1 -0
- package/dist/components/Meter/Meter.variants.d.ts +14 -0
- package/dist/components/Meter/Meter.variants.d.ts.map +1 -0
- package/dist/components/Meter/Meter.variants.js +39 -0
- package/dist/components/Meter/Meter.variants.js.map +1 -0
- package/dist/components/Meter/index.d.ts +2 -0
- package/dist/components/Meter/index.d.ts.map +1 -0
- package/dist/components/Meter/index.js +2 -0
- package/dist/components/Meter/index.js.map +1 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +8 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.js +62 -17
- package/dist/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Segmented/Segmented.d.ts +14 -1
- package/dist/components/Segmented/Segmented.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.js +14 -5
- package/dist/components/Segmented/Segmented.js.map +1 -1
- package/dist/components/Segmented/Segmented.variants.d.ts +14 -1
- package/dist/components/Segmented/Segmented.variants.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.variants.js +19 -3
- package/dist/components/Segmented/Segmented.variants.js.map +1 -1
- package/dist/components/Spotlight/Spotlight.d.ts +16 -0
- package/dist/components/Spotlight/Spotlight.d.ts.map +1 -0
- package/dist/components/Spotlight/Spotlight.js +28 -0
- package/dist/components/Spotlight/Spotlight.js.map +1 -0
- package/dist/components/Spotlight/Spotlight.variants.d.ts +8 -0
- package/dist/components/Spotlight/Spotlight.variants.d.ts.map +1 -0
- package/dist/components/Spotlight/Spotlight.variants.js +15 -0
- package/dist/components/Spotlight/Spotlight.variants.js.map +1 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/Spotlight/index.d.ts.map +1 -0
- package/dist/components/Spotlight/index.js +2 -0
- package/dist/components/Spotlight/index.js.map +1 -0
- package/dist/components/Table/Table.d.ts +8 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.js +4 -4
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.variants.d.ts +6 -2
- package/dist/components/Table/Table.variants.d.ts.map +1 -1
- package/dist/components/Table/Table.variants.js +11 -5
- package/dist/components/Table/Table.variants.js.map +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/scales.d.ts +2 -2
- package/dist/components/scales.d.ts.map +1 -1
- package/dist/components/scales.js +4 -2
- package/dist/components/scales.js.map +1 -1
- package/dist/patterns/AppShell/AppShell.d.ts +38 -8
- package/dist/patterns/AppShell/AppShell.d.ts.map +1 -1
- package/dist/patterns/AppShell/AppShell.js +46 -7
- package/dist/patterns/AppShell/AppShell.js.map +1 -1
- package/dist/patterns/AppShell/AppShell.variants.d.ts +89 -20
- package/dist/patterns/AppShell/AppShell.variants.d.ts.map +1 -1
- package/dist/patterns/AppShell/AppShell.variants.js +148 -23
- package/dist/patterns/AppShell/AppShell.variants.js.map +1 -1
- package/dist/patterns/AppShell/index.d.ts +1 -1
- package/dist/patterns/AppShell/index.d.ts.map +1 -1
- package/dist/patterns/AppShell/index.js.map +1 -1
- package/dist/patterns/CommandPalette/CommandPalette.d.ts +43 -0
- package/dist/patterns/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.js +19 -0
- package/dist/patterns/CommandPalette/CommandPalette.js.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts +18 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.js +21 -0
- package/dist/patterns/CommandPalette/CommandPalette.variants.js.map +1 -0
- package/dist/patterns/CommandPalette/index.d.ts +2 -0
- package/dist/patterns/CommandPalette/index.d.ts.map +1 -0
- package/dist/patterns/CommandPalette/index.js +2 -0
- package/dist/patterns/CommandPalette/index.js.map +1 -0
- package/dist/patterns/ImagePicker/ImagePicker.d.ts +9 -1
- package/dist/patterns/ImagePicker/ImagePicker.d.ts.map +1 -1
- package/dist/patterns/ImagePicker/ImagePicker.js +13 -8
- package/dist/patterns/ImagePicker/ImagePicker.js.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.d.ts +2 -0
- package/dist/patterns/OptionPicker/OptionPicker.d.ts.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.js +8 -3
- package/dist/patterns/OptionPicker/OptionPicker.js.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts +10 -4
- package/dist/patterns/OptionPicker/OptionPicker.variants.d.ts.map +1 -1
- package/dist/patterns/OptionPicker/OptionPicker.variants.js +29 -6
- package/dist/patterns/OptionPicker/OptionPicker.variants.js.map +1 -1
- package/dist/patterns/Outline/Outline.d.ts +26 -0
- package/dist/patterns/Outline/Outline.d.ts.map +1 -0
- package/dist/patterns/Outline/Outline.js +21 -0
- package/dist/patterns/Outline/Outline.js.map +1 -0
- package/dist/patterns/Outline/Outline.variants.d.ts +11 -0
- package/dist/patterns/Outline/Outline.variants.d.ts.map +1 -0
- package/dist/patterns/Outline/Outline.variants.js +21 -0
- package/dist/patterns/Outline/Outline.variants.js.map +1 -0
- package/dist/patterns/Outline/index.d.ts +2 -0
- package/dist/patterns/Outline/index.d.ts.map +1 -0
- package/dist/patterns/Outline/index.js +2 -0
- package/dist/patterns/Outline/index.js.map +1 -0
- package/dist/patterns/PageHeader/PageHeader.d.ts +33 -4
- package/dist/patterns/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.js +31 -6
- package/dist/patterns/PageHeader/PageHeader.js.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.variants.d.ts +23 -2
- package/dist/patterns/PageHeader/PageHeader.variants.d.ts.map +1 -1
- package/dist/patterns/PageHeader/PageHeader.variants.js +33 -2
- package/dist/patterns/PageHeader/PageHeader.variants.js.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.d.ts +138 -4
- package/dist/patterns/PagePreview/PagePreview.d.ts.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.js +159 -13
- package/dist/patterns/PagePreview/PagePreview.js.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.variants.d.ts +15 -2
- package/dist/patterns/PagePreview/PagePreview.variants.d.ts.map +1 -1
- package/dist/patterns/PagePreview/PagePreview.variants.js +22 -6
- package/dist/patterns/PagePreview/PagePreview.variants.js.map +1 -1
- package/dist/patterns/PagePreview/index.d.ts +1 -1
- package/dist/patterns/PagePreview/index.d.ts.map +1 -1
- package/dist/patterns/PagePreview/index.js.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.d.ts +20 -4
- package/dist/patterns/SaveBar/SaveBar.d.ts.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.js +22 -4
- package/dist/patterns/SaveBar/SaveBar.js.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.variants.d.ts +27 -5
- package/dist/patterns/SaveBar/SaveBar.variants.d.ts.map +1 -1
- package/dist/patterns/SaveBar/SaveBar.variants.js +39 -6
- package/dist/patterns/SaveBar/SaveBar.variants.js.map +1 -1
- package/dist/patterns/SectionList/SectionList.d.ts.map +1 -1
- package/dist/patterns/SectionList/SectionList.js +2 -2
- package/dist/patterns/SectionList/SectionList.js.map +1 -1
- package/dist/patterns/SectionList/SectionList.variants.d.ts +4 -1
- package/dist/patterns/SectionList/SectionList.variants.d.ts.map +1 -1
- package/dist/patterns/SectionList/SectionList.variants.js +5 -2
- package/dist/patterns/SectionList/SectionList.variants.js.map +1 -1
- package/dist/patterns/SiteWindow/SiteWindow.d.ts +20 -0
- package/dist/patterns/SiteWindow/SiteWindow.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.js +8 -0
- package/dist/patterns/SiteWindow/SiteWindow.js.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts +24 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.js +25 -0
- package/dist/patterns/SiteWindow/SiteWindow.variants.js.map +1 -0
- package/dist/patterns/SiteWindow/index.d.ts +2 -0
- package/dist/patterns/SiteWindow/index.d.ts.map +1 -0
- package/dist/patterns/SiteWindow/index.js +2 -0
- package/dist/patterns/SiteWindow/index.js.map +1 -0
- package/dist/patterns/Split/Split.variants.d.ts +2 -2
- package/dist/patterns/Split/Split.variants.d.ts.map +1 -1
- package/dist/patterns/Split/Split.variants.js +2 -2
- package/dist/patterns/Split/Split.variants.js.map +1 -1
- package/dist/patterns/Welcome/Welcome.d.ts +18 -0
- package/dist/patterns/Welcome/Welcome.d.ts.map +1 -0
- package/dist/patterns/Welcome/Welcome.js +20 -0
- package/dist/patterns/Welcome/Welcome.js.map +1 -0
- package/dist/patterns/Welcome/Welcome.variants.d.ts +12 -0
- package/dist/patterns/Welcome/Welcome.variants.d.ts.map +1 -0
- package/dist/patterns/Welcome/Welcome.variants.js +12 -0
- package/dist/patterns/Welcome/Welcome.variants.js.map +1 -0
- package/dist/patterns/Welcome/index.d.ts +2 -0
- package/dist/patterns/Welcome/index.d.ts.map +1 -0
- package/dist/patterns/Welcome/index.js +2 -0
- package/dist/patterns/Welcome/index.js.map +1 -0
- package/dist/patterns/Workbench/Workbench.d.ts +35 -4
- package/dist/patterns/Workbench/Workbench.d.ts.map +1 -1
- package/dist/patterns/Workbench/Workbench.js +59 -4
- package/dist/patterns/Workbench/Workbench.js.map +1 -1
- package/dist/patterns/Workbench/Workbench.variants.d.ts +56 -4
- package/dist/patterns/Workbench/Workbench.variants.d.ts.map +1 -1
- package/dist/patterns/Workbench/Workbench.variants.js +111 -4
- package/dist/patterns/Workbench/Workbench.variants.js.map +1 -1
- package/dist/patterns/Workbench/index.d.ts +1 -1
- package/dist/patterns/Workbench/index.d.ts.map +1 -1
- package/dist/patterns/Workbench/index.js.map +1 -1
- package/dist/patterns/index.d.ts +4 -0
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +4 -0
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/page-bar.d.ts +17 -0
- package/dist/patterns/page-bar.d.ts.map +1 -0
- package/dist/patterns/page-bar.js +22 -0
- package/dist/patterns/page-bar.js.map +1 -0
- package/package.json +2 -1
- package/src/styles.css +179 -0
- package/src/tokens/tokens.css +27 -1
package/component-registry.json
CHANGED
|
@@ -104,6 +104,15 @@
|
|
|
104
104
|
"example": "<Checkbox label=\"Featured listing\" isSelected={featured} onChange={setFeatured} />",
|
|
105
105
|
"uses": []
|
|
106
106
|
},
|
|
107
|
+
{
|
|
108
|
+
"name": "ColorPicker",
|
|
109
|
+
"layer": "component",
|
|
110
|
+
"group": "Forms",
|
|
111
|
+
"description": "A colour, typed as a hex colour or chosen in an area of shades and a slider of hues, or from suggested ones.",
|
|
112
|
+
"example": "<ColorPicker label=\"Brand colour\" pickLabel=\"Choose a colour\" hueLabel=\"Hue\" value={colour} onChange={setColour} />",
|
|
113
|
+
"useInstead": "Segmented with swatches for a choice among a template's named looks.",
|
|
114
|
+
"uses": []
|
|
115
|
+
},
|
|
107
116
|
{
|
|
108
117
|
"name": "Select",
|
|
109
118
|
"layer": "component",
|
|
@@ -166,6 +175,24 @@
|
|
|
166
175
|
"useInstead": "ImagePicker to choose an image.",
|
|
167
176
|
"uses": []
|
|
168
177
|
},
|
|
178
|
+
{
|
|
179
|
+
"name": "BarChart",
|
|
180
|
+
"layer": "component",
|
|
181
|
+
"group": "Data",
|
|
182
|
+
"description": "Values side by side as bars, as columns (a run of days) or rows (named things), with one bar able to stand out.",
|
|
183
|
+
"example": "<BarChart label=\"Submissions in the last 14 days\" bars={days} highlightId={today} />",
|
|
184
|
+
"useInstead": "Table or Stat for exact figures; Meter for progress toward one target.",
|
|
185
|
+
"uses": []
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "Meter",
|
|
189
|
+
"layer": "component",
|
|
190
|
+
"group": "Data",
|
|
191
|
+
"description": "How far something is toward a whole, as a bar in the brand's colour with its words above it.",
|
|
192
|
+
"example": "<Meter label=\"November target\" value={13800} max={20000} valueText=\"69% of $20,000\" />",
|
|
193
|
+
"useInstead": "Spinner or LoadingState for something still loading.",
|
|
194
|
+
"uses": []
|
|
195
|
+
},
|
|
169
196
|
{
|
|
170
197
|
"name": "Stat",
|
|
171
198
|
"layer": "component",
|
|
@@ -215,16 +242,16 @@
|
|
|
215
242
|
"name": "OptionPicker",
|
|
216
243
|
"layer": "pattern",
|
|
217
244
|
"group": "Overlays",
|
|
218
|
-
"description": "A window to choose one thing from a set of named kinds, in groups, each with a line on what it gives. Choosing closes it.",
|
|
245
|
+
"description": "A window to choose one thing from a set of named kinds, in groups, each with a line on what it gives and, when it has one, a picture. Choosing closes it.",
|
|
219
246
|
"example": "<OptionPicker isOpen={isOpen} onOpenChange={setOpen} title=\"Add a section\" closeLabel=\"Close\" groups={groups} onChoose={add} emptyText=\"No kinds of section yet\" />",
|
|
220
247
|
"useInstead": "Menu for a handful of actions; Select to choose a field's value; ImagePicker to choose a picture.",
|
|
221
|
-
"uses": ["Dialog"]
|
|
248
|
+
"uses": ["Dialog", "Thumbnail"]
|
|
222
249
|
},
|
|
223
250
|
{
|
|
224
251
|
"name": "Workbench",
|
|
225
252
|
"layer": "pattern",
|
|
226
253
|
"group": "Layout",
|
|
227
|
-
"description": "A form with what it makes shown large beside it and kept in view: the sections of a page, and the page.",
|
|
254
|
+
"description": "A form with what it makes shown large beside it and kept in view: the sections of a page, and the page. With view=\"whole\" the two take the whole window, the form a panel at the side that can be put away.",
|
|
228
255
|
"example": "<Workbench paneLabel=\"The page\" pane={<PagePreview … />}>…</Workbench>",
|
|
229
256
|
"useInstead": "Split for a form with a few settings beside it; Grid for things of equal weight.",
|
|
230
257
|
"uses": []
|
|
@@ -272,8 +299,10 @@
|
|
|
272
299
|
"description": "The top of every screen: its title, what it is for, and its main actions.",
|
|
273
300
|
"example": "<PageHeader title=\"Listings\" actions={<Button>New listing</Button>} />",
|
|
274
301
|
"uses": [
|
|
302
|
+
"Button",
|
|
275
303
|
"Heading",
|
|
276
|
-
"
|
|
304
|
+
"IconButton",
|
|
305
|
+
"Menu",
|
|
277
306
|
"Text"
|
|
278
307
|
]
|
|
279
308
|
},
|
|
@@ -337,14 +366,52 @@
|
|
|
337
366
|
"IconButton"
|
|
338
367
|
]
|
|
339
368
|
},
|
|
369
|
+
{
|
|
370
|
+
"name": "CommandPalette",
|
|
371
|
+
"layer": "pattern",
|
|
372
|
+
"group": "Overlays",
|
|
373
|
+
"description": "A window to find anything by typing and go there: a box, and under it the matches in groups.",
|
|
374
|
+
"example": "<CommandPalette isOpen={isOpen} onOpenChange={setOpen} label=\"Search and commands\" placeholder=\"Search, jump to or create anything\" emptyText=\"Nothing matches that.\" groups={groups} onAction={run} />",
|
|
375
|
+
"useInstead": "SearchField to narrow down one list on a screen.",
|
|
376
|
+
"uses": []
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "Outline",
|
|
380
|
+
"layer": "pattern",
|
|
381
|
+
"group": "Navigation",
|
|
382
|
+
"description": "The parts of something long, by name and in order, with the current one marked. Choosing one goes to it.",
|
|
383
|
+
"example": "<Outline title=\"Sections\" items={sections} currentId={current} onChoose={goTo} emptyText=\"No sections yet.\" />",
|
|
384
|
+
"useInstead": "SectionList to put sections in order and edit them.",
|
|
385
|
+
"uses": []
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "Welcome",
|
|
389
|
+
"layer": "pattern",
|
|
390
|
+
"group": "Page",
|
|
391
|
+
"description": "The top of a screen that greets the person: what matters now in large words, one phrase set apart, what to do first, and the site beside it.",
|
|
392
|
+
"example": "<Welcome eyebrow=\"Saturday, 21 November\" title=\"Good morning, Dana. 3 drafts are waiting.\" highlight=\"Dana\" actions={actions} aside={preview} />",
|
|
393
|
+
"useInstead": "PageHeader for the top of every other screen.",
|
|
394
|
+
"uses": []
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "SiteWindow",
|
|
398
|
+
"layer": "pattern",
|
|
399
|
+
"group": "Page",
|
|
400
|
+
"description": "A page of the site in a small browser window, as visitors see it now. The whole card is one link.",
|
|
401
|
+
"example": "<SiteWindow address=\"lakeshore.example\" src=\"/\" title=\"The home page\" label=\"Edit the home page\" meta=\"Published 3 days ago\" onPress={edit} />",
|
|
402
|
+
"useInstead": "PagePreview to see and work on a draft.",
|
|
403
|
+
"uses": []
|
|
404
|
+
},
|
|
340
405
|
{
|
|
341
406
|
"name": "AppShell",
|
|
342
407
|
"layer": "pattern",
|
|
343
408
|
"group": "Page",
|
|
344
|
-
"description": "The frame around every screen: the
|
|
345
|
-
"example": "<AppShell siteName=\"Lakeshore Realty\" navLabel=\"Main\" skipLabel=\"Skip to content\" nav={groups} account={account}>…</AppShell>",
|
|
409
|
+
"description": "The frame around every screen: the rail of sections, the current section's places beside it, the bar with the search, and the main area.",
|
|
410
|
+
"example": "<AppShell logoLabel=\"Velocity\" siteName=\"Lakeshore Realty\" navLabel=\"Main\" skipLabel=\"Skip to content\" search={search} nav={groups} account={account}>…</AppShell>",
|
|
346
411
|
"uses": [
|
|
347
|
-
"
|
|
412
|
+
"Logo",
|
|
413
|
+
"Menu",
|
|
414
|
+
"Tooltip"
|
|
348
415
|
]
|
|
349
416
|
},
|
|
350
417
|
{
|
|
@@ -391,6 +458,15 @@
|
|
|
391
458
|
"useInstead": "Button isPending for an action under way.",
|
|
392
459
|
"uses": []
|
|
393
460
|
},
|
|
461
|
+
{
|
|
462
|
+
"name": "LoadingMark",
|
|
463
|
+
"layer": "component",
|
|
464
|
+
"group": "Status",
|
|
465
|
+
"description": "The whole screen while the app opens: the Velocity mark in the middle, its facets arriving in grey and taking their colour.",
|
|
466
|
+
"example": "<LoadingMark label=\"Opening the editor\" />",
|
|
467
|
+
"useInstead": "LoadingState with a shape where the screen's layout is known; Spinner for a part of a screen.",
|
|
468
|
+
"uses": []
|
|
469
|
+
},
|
|
394
470
|
{
|
|
395
471
|
"name": "AuthShell",
|
|
396
472
|
"layer": "pattern",
|
|
@@ -420,6 +496,15 @@
|
|
|
420
496
|
"example": "<DateField label=\"Listed on\" value={listedOn} onChange={setListedOn} />",
|
|
421
497
|
"uses": []
|
|
422
498
|
},
|
|
499
|
+
{
|
|
500
|
+
"name": "Spotlight",
|
|
501
|
+
"layer": "component",
|
|
502
|
+
"group": "Feedback",
|
|
503
|
+
"description": "Brings what it holds into view and marks it for a moment, when something elsewhere on the screen pointed at it.",
|
|
504
|
+
"example": "<Spotlight at={pressed?.at}>\n <TextField label=\"Title\" />\n</Spotlight>",
|
|
505
|
+
"useInstead": "SectionList's revealId for a row that opens; Toast for news.",
|
|
506
|
+
"uses": []
|
|
507
|
+
},
|
|
423
508
|
{
|
|
424
509
|
"name": "Fieldset",
|
|
425
510
|
"layer": "component",
|
|
@@ -444,7 +529,7 @@
|
|
|
444
529
|
"description": "A few choices in a row, one always chosen: a filter over a list, or a language.",
|
|
445
530
|
"example": "<Segmented label=\"Show\" options={options} selected={filter} onChange={setFilter} />",
|
|
446
531
|
"useInstead": "Tabs with empty panels to filter a list.",
|
|
447
|
-
"uses": []
|
|
532
|
+
"uses": ["Tooltip"]
|
|
448
533
|
},
|
|
449
534
|
{
|
|
450
535
|
"name": "SearchField",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface BarChartBar {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
/** What the bar stands for: "Mon", "Listings". */
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly value: number;
|
|
6
|
+
/** The value as it is said: "3 submissions", "$12,000". */
|
|
7
|
+
readonly valueText: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BarChartProps {
|
|
10
|
+
/** What the chart shows, for screen readers: "Submissions in the last 14 days". */
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly bars: readonly BarChartBar[];
|
|
13
|
+
/** `columns` for a run of days or short labels; `rows` for named things, with their values beside them. */
|
|
14
|
+
readonly layout?: 'columns' | 'rows';
|
|
15
|
+
/** The one bar to stand out, such as today. */
|
|
16
|
+
readonly highlightId?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Values side by side as bars, as columns or as rows. The bars are a picture: what they show is
|
|
20
|
+
* also a list that screen readers read, each with its value in words.
|
|
21
|
+
*/
|
|
22
|
+
export declare function BarChart({ label, bars, layout, highlightId }: BarChartProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,2GAA2G;IAC3G,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IACrC,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAQD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAkB,EAAE,WAAW,EAAE,EAAE,aAAa,+BAyCvF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { barChartClass, barChartColumnBarVariants, barChartColumnClass, barChartColumnLabelClass, barChartColumnTrackClass, barChartColumnsClass, barChartListClass, barChartRowBarHolderClass, barChartRowBarVariants, barChartRowClass, barChartRowLabelClass, barChartRowTrackClass, barChartRowValueClass, barChartRowsClass, } from './BarChart.variants.js';
|
|
4
|
+
/** How far along a bar is, in twentieths of the longest. A value above nothing always shows a sliver. */
|
|
5
|
+
const stepOf = (value, most) => {
|
|
6
|
+
if (most <= 0 || value <= 0)
|
|
7
|
+
return 0;
|
|
8
|
+
return Math.min(20, Math.max(1, Math.round((value / most) * 20)));
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Values side by side as bars, as columns or as rows. The bars are a picture: what they show is
|
|
12
|
+
* also a list that screen readers read, each with its value in words.
|
|
13
|
+
*/
|
|
14
|
+
export function BarChart({ label, bars, layout = 'columns', highlightId }) {
|
|
15
|
+
const titleId = useId();
|
|
16
|
+
const most = Math.max(0, ...bars.map((bar) => bar.value));
|
|
17
|
+
return (_jsxs("figure", { className: barChartClass, "aria-labelledby": titleId, children: [_jsx("figcaption", { id: titleId, className: barChartListClass, children: label }), _jsx("ul", { className: barChartListClass, children: bars.map((bar) => (_jsx("li", { children: `${bar.label}: ${bar.valueText}` }, bar.id))) }), layout === 'columns' ? (_jsx("div", { "aria-hidden": true, className: barChartColumnsClass, children: bars.map((bar) => (_jsxs("div", { className: barChartColumnClass, children: [_jsx("div", { className: barChartColumnTrackClass, children: _jsx("div", { className: barChartColumnBarVariants({ step: stepOf(bar.value, most), isHighlighted: bar.id === highlightId }) }) }), _jsx("span", { className: barChartColumnLabelClass, children: bar.label })] }, bar.id))) })) : (_jsx("div", { "aria-hidden": true, className: barChartRowsClass, children: bars.map((bar) => (_jsxs("div", { className: barChartRowClass, children: [_jsx("span", { className: barChartRowLabelClass, children: bar.label }), _jsxs("span", { className: barChartRowTrackClass, children: [_jsx("span", { className: barChartRowBarHolderClass, children: _jsx("span", { className: barChartRowBarVariants({ step: stepOf(bar.value, most), isHighlighted: bar.id === highlightId }) }) }), _jsx("span", { className: barChartRowValueClass, children: bar.valueText })] })] }, bar.id))) }))] }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=BarChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAqBhC,yGAAyG;AACzG,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,IAAY,EAAW,EAAE;IACtD,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAY,CAAC;AAC/E,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAiB;IACtF,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1D,OAAO,CACL,kBAAQ,SAAS,EAAE,aAAa,qBAAmB,OAAO,aACxD,qBAAY,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,YAClD,KAAK,GACK,EACb,aAAI,SAAS,EAAE,iBAAiB,YAC7B,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,uBAAkB,GAAG,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,SAAS,EAAE,IAAzC,GAAG,CAAC,EAAE,CAAyC,CACzD,CAAC,GACC,EACJ,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CACtB,mCAAiB,SAAS,EAAE,oBAAoB,YAC7C,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,eAAkB,SAAS,EAAE,mBAAmB,aAC9C,cAAK,SAAS,EAAE,wBAAwB,YACtC,cAAK,SAAS,EAAE,yBAAyB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,KAAK,WAAW,EAAE,CAAC,GAAI,GACnH,EACN,eAAM,SAAS,EAAE,wBAAwB,YAAG,GAAG,CAAC,KAAK,GAAQ,KAJrD,GAAG,CAAC,EAAE,CAKV,CACP,CAAC,GACE,CACP,CAAC,CAAC,CAAC,CACF,mCAAiB,SAAS,EAAE,iBAAiB,YAC1C,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,eAAkB,SAAS,EAAE,gBAAgB,aAC3C,eAAM,SAAS,EAAE,qBAAqB,YAAG,GAAG,CAAC,KAAK,GAAQ,EAC1D,gBAAM,SAAS,EAAE,qBAAqB,aACpC,eAAM,SAAS,EAAE,yBAAyB,YACxC,eAAM,SAAS,EAAE,sBAAsB,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,KAAK,WAAW,EAAE,CAAC,GAAI,GAChH,EACP,eAAM,SAAS,EAAE,qBAAqB,YAAG,GAAG,CAAC,SAAS,GAAQ,IACzD,KAPC,GAAG,CAAC,EAAE,CAQV,CACP,CAAC,GACE,CACP,IACM,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bars drawn with sizes from the theme: the length of a bar goes in twentieths of its track, so it is
|
|
3
|
+
* always a step of the scale. The one bar a chart sets apart (today, say) is in the brand colour,
|
|
4
|
+
* the one orange of a screen; the rest are quieter, in the text colour.
|
|
5
|
+
*/
|
|
6
|
+
export declare const barChartClass = "flex w-full flex-col gap-3";
|
|
7
|
+
export declare const barChartColumnsClass = "flex h-40 w-full items-end gap-1.5";
|
|
8
|
+
export declare const barChartColumnClass = "flex h-full min-w-0 flex-1 flex-col items-center justify-end gap-1.5";
|
|
9
|
+
/** A day with nothing still shows where its bar would stand, on the line along the foot. */
|
|
10
|
+
export declare const barChartColumnTrackClass = "flex w-full flex-1 items-end border-b border-border";
|
|
11
|
+
export declare const barChartColumnBarVariants: (props?: ({
|
|
12
|
+
step?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | null | undefined;
|
|
13
|
+
isHighlighted?: boolean | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
export declare const barChartColumnLabelClass = "w-full truncate text-center text-xs text-foreground-muted";
|
|
16
|
+
export declare const barChartRowsClass = "flex w-full flex-col gap-3";
|
|
17
|
+
export declare const barChartRowClass = "grid grid-cols-3 items-center gap-3";
|
|
18
|
+
export declare const barChartRowLabelClass = "truncate text-sm text-foreground-secondary";
|
|
19
|
+
export declare const barChartRowTrackClass = "col-span-2 flex items-center gap-3";
|
|
20
|
+
export declare const barChartRowBarHolderClass = "flex h-2.5 min-w-0 flex-1 rounded-full bg-background-tertiary";
|
|
21
|
+
export declare const barChartRowBarVariants: (props?: ({
|
|
22
|
+
step?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | null | undefined;
|
|
23
|
+
isHighlighted?: boolean | null | undefined;
|
|
24
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
25
|
+
export declare const barChartRowValueClass = "w-20 shrink-0 text-right text-sm font-semibold text-foreground tabular-nums";
|
|
26
|
+
/** What the chart shows, said as a list for screen readers: the bars are only a picture of it. */
|
|
27
|
+
export declare const barChartListClass = "sr-only";
|
|
28
|
+
export type BarStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
29
|
+
//# sourceMappingURL=BarChart.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.variants.d.ts","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.variants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAG1D,eAAO,MAAM,oBAAoB,uCAAuC,CAAC;AACzE,eAAO,MAAM,mBAAmB,yEAAyE,CAAC;AAC1G,4FAA4F;AAC5F,eAAO,MAAM,wBAAwB,wDAAwD,CAAC;AAC9F,eAAO,MAAM,yBAAyB;;;8EA4BpC,CAAC;AACH,eAAO,MAAM,wBAAwB,8DAA8D,CAAC;AAGpG,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAC9D,eAAO,MAAM,gBAAgB,wCAAwC,CAAC;AACtE,eAAO,MAAM,qBAAqB,+CAA+C,CAAC;AAClF,eAAO,MAAM,qBAAqB,uCAAuC,CAAC;AAC1E,eAAO,MAAM,yBAAyB,kEAAkE,CAAC;AACzG,eAAO,MAAM,sBAAsB;;;8EA4BjC,CAAC;AACH,eAAO,MAAM,qBAAqB,gFAAgF,CAAC;AAEnH,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* Bars drawn with sizes from the theme: the length of a bar goes in twentieths of its track, so it is
|
|
4
|
+
* always a step of the scale. The one bar a chart sets apart (today, say) is in the brand colour,
|
|
5
|
+
* the one orange of a screen; the rest are quieter, in the text colour.
|
|
6
|
+
*/
|
|
7
|
+
export const barChartClass = 'flex w-full flex-col gap-3';
|
|
8
|
+
/* --- Columns: one per day, or per short label ------------------------------ */
|
|
9
|
+
export const barChartColumnsClass = 'flex h-40 w-full items-end gap-1.5';
|
|
10
|
+
export const barChartColumnClass = 'flex h-full min-w-0 flex-1 flex-col items-center justify-end gap-1.5';
|
|
11
|
+
/** A day with nothing still shows where its bar would stand, on the line along the foot. */
|
|
12
|
+
export const barChartColumnTrackClass = 'flex w-full flex-1 items-end border-b border-border';
|
|
13
|
+
export const barChartColumnBarVariants = cva('w-full rounded-t-sm transition-all motion-slide', {
|
|
14
|
+
variants: {
|
|
15
|
+
step: {
|
|
16
|
+
0: 'h-0',
|
|
17
|
+
1: 'h-1/20',
|
|
18
|
+
2: 'h-2/20',
|
|
19
|
+
3: 'h-3/20',
|
|
20
|
+
4: 'h-4/20',
|
|
21
|
+
5: 'h-5/20',
|
|
22
|
+
6: 'h-6/20',
|
|
23
|
+
7: 'h-7/20',
|
|
24
|
+
8: 'h-8/20',
|
|
25
|
+
9: 'h-9/20',
|
|
26
|
+
10: 'h-10/20',
|
|
27
|
+
11: 'h-11/20',
|
|
28
|
+
12: 'h-12/20',
|
|
29
|
+
13: 'h-13/20',
|
|
30
|
+
14: 'h-14/20',
|
|
31
|
+
15: 'h-15/20',
|
|
32
|
+
16: 'h-16/20',
|
|
33
|
+
17: 'h-17/20',
|
|
34
|
+
18: 'h-18/20',
|
|
35
|
+
19: 'h-19/20',
|
|
36
|
+
20: 'h-full',
|
|
37
|
+
},
|
|
38
|
+
isHighlighted: { true: 'bg-brand-fill', false: 'bg-foreground-subtle' },
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: { step: 0, isHighlighted: false },
|
|
41
|
+
});
|
|
42
|
+
export const barChartColumnLabelClass = 'w-full truncate text-center text-xs text-foreground-muted';
|
|
43
|
+
/* --- Rows: one per named thing, its label on the left ----------------------- */
|
|
44
|
+
export const barChartRowsClass = 'flex w-full flex-col gap-3';
|
|
45
|
+
export const barChartRowClass = 'grid grid-cols-3 items-center gap-3';
|
|
46
|
+
export const barChartRowLabelClass = 'truncate text-sm text-foreground-secondary';
|
|
47
|
+
export const barChartRowTrackClass = 'col-span-2 flex items-center gap-3';
|
|
48
|
+
export const barChartRowBarHolderClass = 'flex h-2.5 min-w-0 flex-1 rounded-full bg-background-tertiary';
|
|
49
|
+
export const barChartRowBarVariants = cva('h-full rounded-full transition-all motion-slide', {
|
|
50
|
+
variants: {
|
|
51
|
+
step: {
|
|
52
|
+
0: 'w-0',
|
|
53
|
+
1: 'w-1/20',
|
|
54
|
+
2: 'w-2/20',
|
|
55
|
+
3: 'w-3/20',
|
|
56
|
+
4: 'w-4/20',
|
|
57
|
+
5: 'w-5/20',
|
|
58
|
+
6: 'w-6/20',
|
|
59
|
+
7: 'w-7/20',
|
|
60
|
+
8: 'w-8/20',
|
|
61
|
+
9: 'w-9/20',
|
|
62
|
+
10: 'w-10/20',
|
|
63
|
+
11: 'w-11/20',
|
|
64
|
+
12: 'w-12/20',
|
|
65
|
+
13: 'w-13/20',
|
|
66
|
+
14: 'w-14/20',
|
|
67
|
+
15: 'w-15/20',
|
|
68
|
+
16: 'w-16/20',
|
|
69
|
+
17: 'w-17/20',
|
|
70
|
+
18: 'w-18/20',
|
|
71
|
+
19: 'w-19/20',
|
|
72
|
+
20: 'w-full',
|
|
73
|
+
},
|
|
74
|
+
isHighlighted: { true: 'bg-brand-fill', false: 'bg-foreground-subtle' },
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: { step: 0, isHighlighted: false },
|
|
77
|
+
});
|
|
78
|
+
export const barChartRowValueClass = 'w-20 shrink-0 text-right text-sm font-semibold text-foreground tabular-nums';
|
|
79
|
+
/** What the chart shows, said as a list for screen readers: the bars are only a picture of it. */
|
|
80
|
+
export const barChartListClass = 'sr-only';
|
|
81
|
+
//# sourceMappingURL=BarChart.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.variants.js","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAE1D,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,sEAAsE,CAAC;AAC1G,4FAA4F;AAC5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,qDAAqD,CAAC;AAC9F,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC,iDAAiD,EAAE;IAC9F,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,QAAQ;SACb;QACD,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,sBAAsB,EAAE;KACxE;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE;CACnD,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,2DAA2D,CAAC;AAEpG,kFAAkF;AAClF,MAAM,CAAC,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,qCAAqC,CAAC;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,4CAA4C,CAAC;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,oCAAoC,CAAC;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,+DAA+D,CAAC;AACzG,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC,iDAAiD,EAAE;IAC3F,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,QAAQ;SACb;QACD,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,sBAAsB,EAAE;KACxE;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE;CACnD,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,6EAA6E,CAAC;AAEnH,kGAAkG;AAClG,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BarChart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/BarChart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,eAAe,CAAC"}
|
|
@@ -15,7 +15,12 @@ export interface ButtonProps extends ButtonVariants {
|
|
|
15
15
|
readonly isPending?: boolean;
|
|
16
16
|
/** Takes focus when it appears. For the safe choice in a dialog, and nowhere else. */
|
|
17
17
|
readonly autoFocus?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* On a phone (below `md`) the button shows its icon alone, square, and its words are only read out:
|
|
20
|
+
* for a screen's main button in the bar at the top, where a phone has room for one row. Needs `icon`.
|
|
21
|
+
*/
|
|
22
|
+
readonly collapses?: boolean;
|
|
18
23
|
}
|
|
19
24
|
/** Starts an action. */
|
|
20
|
-
export declare function Button({ children, icon: Icon, onPress, type, isDisabled, isPending, autoFocus, size, ...variants }: ButtonProps): import("react").JSX.Element;
|
|
25
|
+
export declare function Button({ children, icon: Icon, onPress, type, isDisabled, isPending, autoFocus, collapses, size, ...variants }: ButtonProps): import("react").JSX.Element;
|
|
21
26
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAA+D,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAExH,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC/C,gDAAgD;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,gGAAgG;IAChG,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,sFAAsF;IACtF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAwB;AACxB,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EACP,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EACjB,IAAI,EACJ,GAAG,QAAQ,EACZ,EAAE,WAAW,+BAiBb"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { LoaderCircle } from 'lucide-react';
|
|
3
3
|
import { Button as AriaButton } from 'react-aria-components';
|
|
4
|
-
import { buttonVariants, iconSize, spinnerClass } from './Button.variants.js';
|
|
4
|
+
import { buttonLabelVariants, buttonVariants, iconSize, spinnerClass } from './Button.variants.js';
|
|
5
5
|
/** Starts an action. */
|
|
6
|
-
export function Button({ children, icon: Icon, onPress, type = 'button', isDisabled = false, isPending = false, autoFocus = false, size, ...variants }) {
|
|
6
|
+
export function Button({ children, icon: Icon, onPress, type = 'button', isDisabled = false, isPending = false, autoFocus = false, collapses = false, size, ...variants }) {
|
|
7
7
|
const Leading = isPending ? LoaderCircle : Icon;
|
|
8
|
-
|
|
8
|
+
// Without an icon there would be nothing left to see: such a button never collapses.
|
|
9
|
+
const isCollapsing = collapses && Icon !== undefined;
|
|
10
|
+
return (_jsxs(AriaButton, { className: buttonVariants({ size, ...variants, collapses: isCollapsing }), type: type, isDisabled: isDisabled, isPending: isPending, autoFocus: autoFocus, ...(onPress && { onPress }), children: [Leading && _jsx(Leading, { "aria-hidden": true, size: iconSize[size ?? 'md'], ...(isPending && { className: spinnerClass }) }), isCollapsing ? _jsx("span", { className: buttonLabelVariants({ collapses: true }), children: children }) : children] }));
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAmB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAmB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAC;AAsBxH,wBAAwB;AACxB,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,GAAG,QAAQ,EACC;IACZ,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,qFAAqF;IACrF,MAAM,YAAY,GAAG,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC;IACrD,OAAO,CACL,MAAC,UAAU,IACT,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EACzE,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,KAChB,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,CAAC,aAE3B,OAAO,IAAI,KAAC,OAAO,yBAAa,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,KAAM,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,GAAI,EAChH,YAAY,CAAC,CAAC,CAAC,eAAM,SAAS,EAAE,mBAAmB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,YAAG,QAAQ,GAAQ,CAAC,CAAC,CAAC,QAAQ,IAC5F,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const buttonVariants: (props?: ({
|
|
3
|
-
variant?: "primary" | "secondary" | "ghost" | "danger" | null | undefined;
|
|
3
|
+
variant?: "primary" | "secondary" | "ghost" | "danger" | "brand" | null | undefined;
|
|
4
4
|
size?: "sm" | "md" | null | undefined;
|
|
5
5
|
fullWidth?: boolean | null | undefined;
|
|
6
|
+
collapses?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/** The words of a button that collapses: read out, and shown from `md` up. */
|
|
9
|
+
export declare const buttonLabelVariants: (props?: ({
|
|
10
|
+
collapses?: boolean | null | undefined;
|
|
6
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
12
|
/** The icon's size in pixels for each button size. */
|
|
8
13
|
export declare const iconSize: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"Button.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,cAAc;;;;;8EAkC1B,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB;;8EAG9B,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,QAAQ;;;CAA8B,CAAC;AAEpD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -12,6 +12,8 @@ export const buttonVariants = cva([
|
|
|
12
12
|
secondary: 'border border-border bg-secondary text-secondary-foreground data-hovered:border-border-strong data-hovered:bg-secondary-hover data-pressed:bg-secondary-hover',
|
|
13
13
|
ghost: 'text-foreground-secondary data-hovered:bg-secondary data-hovered:text-foreground data-pressed:bg-secondary-hover',
|
|
14
14
|
danger: 'bg-destructive text-destructive-foreground data-hovered:opacity-90 data-pressed:opacity-90',
|
|
15
|
+
// The brand's colour, a screen's one orange: for the one step a whole view leads to, such as Publish in the visual editor.
|
|
16
|
+
brand: 'bg-brand-fill text-brand-ink data-hovered:bg-brand-fill-hover data-pressed:bg-brand-fill-hover',
|
|
15
17
|
},
|
|
16
18
|
size: {
|
|
17
19
|
sm: 'h-8 px-3 text-sm',
|
|
@@ -20,8 +22,18 @@ export const buttonVariants = cva([
|
|
|
20
22
|
fullWidth: {
|
|
21
23
|
true: 'w-full',
|
|
22
24
|
},
|
|
25
|
+
/** On a phone, its icon alone in a square: `px-0` with the width of its height. */
|
|
26
|
+
collapses: {
|
|
27
|
+
true: 'max-md:aspect-square max-md:px-0',
|
|
28
|
+
false: '',
|
|
29
|
+
},
|
|
23
30
|
},
|
|
24
|
-
defaultVariants: { variant: 'primary', size: 'md' },
|
|
31
|
+
defaultVariants: { variant: 'primary', size: 'md', collapses: false },
|
|
32
|
+
});
|
|
33
|
+
/** The words of a button that collapses: read out, and shown from `md` up. */
|
|
34
|
+
export const buttonLabelVariants = cva('', {
|
|
35
|
+
variants: { collapses: { true: 'max-md:sr-only', false: '' } },
|
|
36
|
+
defaultVariants: { collapses: false },
|
|
25
37
|
});
|
|
26
38
|
/** The icon's size in pixels for each button size. */
|
|
27
39
|
export const iconSize = { sm: 14, md: 16 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.variants.js","sourceRoot":"","sources":["../../../src/components/Button/Button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B;IACE,gHAAgH;IAChH,cAAc;IACd,gJAAgJ;IAChJ,0BAA0B;IAC1B,yBAAyB;CAC1B,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,gGAAgG;YACzG,SAAS,EACP,+JAA+J;YACjK,KAAK,EAAE,kHAAkH;YACzH,MAAM,EAAE,4FAA4F;
|
|
1
|
+
{"version":3,"file":"Button.variants.js","sourceRoot":"","sources":["../../../src/components/Button/Button.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B;IACE,gHAAgH;IAChH,cAAc;IACd,gJAAgJ;IAChJ,0BAA0B;IAC1B,yBAAyB;CAC1B,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,gGAAgG;YACzG,SAAS,EACP,+JAA+J;YACjK,KAAK,EAAE,kHAAkH;YACzH,MAAM,EAAE,4FAA4F;YACpG,2HAA2H;YAC3H,KAAK,EAAE,gGAAgG;SACxG;QACD,IAAI,EAAE;YACJ,EAAE,EAAE,kBAAkB;YACtB,EAAE,EAAE,qBAAqB;SAC1B;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;SACf;QACD,mFAAmF;QACnF,SAAS,EAAE;YACT,IAAI,EAAE,kCAAkC;YACxC,KAAK,EAAE,EAAE;SACV;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;CACtE,CACF,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC,EAAE,EAAE;IACzC,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;IAC9D,eAAe,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;CACtC,CAAC,CAAC;AAEH,sDAAsD;AACtD,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAW,CAAC;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC"}
|
|
@@ -8,8 +8,10 @@ export interface CardProps {
|
|
|
8
8
|
readonly actions?: ReactNode;
|
|
9
9
|
/** What can be done with the whole card, in a row under what it holds: a few buttons. */
|
|
10
10
|
readonly footer?: ReactNode;
|
|
11
|
+
/** What it holds runs to its edges, for a `Table` with `frame="none"` or a list of rows. */
|
|
12
|
+
readonly isFlush?: boolean;
|
|
11
13
|
readonly children?: ReactNode;
|
|
12
14
|
}
|
|
13
15
|
/** A framed part of a screen with its own heading, such as one section of a long form. */
|
|
14
|
-
export declare function Card({ title, description, actions, footer, children }: CardProps): import("react").JSX.Element;
|
|
16
|
+
export declare function Card({ title, description, actions, footer, isFlush, children }: CardProps): import("react").JSX.Element;
|
|
15
17
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,MAAM,WAAW,SAAS;IACxB,wGAAwG;IACxG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,0FAA0F;AAC1F,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,SAAS,+
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,MAAM,WAAW,SAAS;IACxB,wGAAwG;IACxG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,0FAA0F;AAC1F,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,OAAe,EAAE,QAAQ,EAAE,EAAE,SAAS,+BAmBjG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from 'react';
|
|
3
|
-
import { cardActionsClass,
|
|
3
|
+
import { cardActionsClass, cardBodyVariants, cardClass, cardDescriptionClass, cardFooterClass, cardHeaderClass, cardHeadingClass, cardTitleClass } from './Card.variants.js';
|
|
4
4
|
/** A framed part of a screen with its own heading, such as one section of a long form. */
|
|
5
|
-
export function Card({ title, description, actions, footer, children }) {
|
|
5
|
+
export function Card({ title, description, actions, footer, isFlush = false, children }) {
|
|
6
6
|
const titleId = useId();
|
|
7
|
-
return (_jsxs("section", { className: cardClass, ...(title !== undefined && { 'aria-labelledby': titleId }), children: [title !== undefined && (_jsxs("div", { className: cardHeaderClass, children: [_jsxs("div", { className: cardHeadingClass, children: [_jsx("h2", { id: titleId, className: cardTitleClass, children: title }), description !== undefined && _jsx("p", { className: cardDescriptionClass, children: description })] }), actions !== undefined && _jsx("div", { className: cardActionsClass, children: actions })] })), children !== undefined && _jsx("div", { className:
|
|
7
|
+
return (_jsxs("section", { className: cardClass, ...(title !== undefined && { 'aria-labelledby': titleId }), children: [title !== undefined && (_jsxs("div", { className: cardHeaderClass, children: [_jsxs("div", { className: cardHeadingClass, children: [_jsx("h2", { id: titleId, className: cardTitleClass, children: title }), description !== undefined && _jsx("p", { className: cardDescriptionClass, children: description })] }), actions !== undefined && _jsx("div", { className: cardActionsClass, children: actions })] })), children !== undefined && _jsx("div", { className: cardBodyVariants({ isFlush }), children: children }), footer !== undefined && _jsx("div", { className: cardFooterClass, children: footer })] }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=Card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgB7K,0FAA0F;AAC1F,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAa;IAChG,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,OAAO,CACL,mBAAS,SAAS,EAAE,SAAS,KAAM,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,aACvF,KAAK,KAAK,SAAS,IAAI,CACtB,eAAK,SAAS,EAAE,eAAe,aAC7B,eAAK,SAAS,EAAE,gBAAgB,aAC9B,aAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,YACvC,KAAK,GACH,EACJ,WAAW,KAAK,SAAS,IAAI,YAAG,SAAS,EAAE,oBAAoB,YAAG,WAAW,GAAK,IAC/E,EACL,OAAO,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,gBAAgB,YAAG,OAAO,GAAO,IACvE,CACP,EACA,QAAQ,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,YAAG,QAAQ,GAAO,EACzF,MAAM,KAAK,SAAS,IAAI,cAAK,SAAS,EAAE,eAAe,YAAG,MAAM,GAAO,IAChE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -4,6 +4,9 @@ export declare const cardHeadingClass = "flex min-w-0 flex-col gap-1";
|
|
|
4
4
|
export declare const cardTitleClass = "font-display text-lg font-semibold text-foreground";
|
|
5
5
|
export declare const cardDescriptionClass = "text-sm text-foreground-muted";
|
|
6
6
|
export declare const cardActionsClass = "flex shrink-0 items-center gap-3";
|
|
7
|
-
|
|
7
|
+
/** Flush, what the card holds runs to its edges: a table or a list of rows, which have their own spacing. */
|
|
8
|
+
export declare const cardBodyVariants: (props?: ({
|
|
9
|
+
isFlush?: boolean | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
11
|
export declare const cardFooterClass = "flex flex-wrap items-center gap-2 border-t border-border px-6 py-3";
|
|
9
12
|
//# sourceMappingURL=Card.variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.variants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Card.variants.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.variants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,kEAAkE,CAAC;AACzF,eAAO,MAAM,eAAe,4EAA4E,CAAC;AACzG,eAAO,MAAM,gBAAgB,gCAAgC,CAAC;AAC9D,eAAO,MAAM,cAAc,uDAAuD,CAAC;AACnF,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,gBAAgB,qCAAqC,CAAC;AACnE,6GAA6G;AAC7G,eAAO,MAAM,gBAAgB;;8EAG3B,CAAC;AACH,eAAO,MAAM,eAAe,uEAAuE,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
1
2
|
export const cardClass = 'flex min-w-0 flex-col rounded-xl border border-border bg-card';
|
|
2
3
|
export const cardHeaderClass = 'flex items-start justify-between gap-4 border-b border-border px-6 py-4';
|
|
3
4
|
export const cardHeadingClass = 'flex min-w-0 flex-col gap-1';
|
|
4
5
|
export const cardTitleClass = 'font-display text-lg font-semibold text-foreground';
|
|
5
6
|
export const cardDescriptionClass = 'text-sm text-foreground-muted';
|
|
6
7
|
export const cardActionsClass = 'flex shrink-0 items-center gap-3';
|
|
7
|
-
|
|
8
|
+
/** Flush, what the card holds runs to its edges: a table or a list of rows, which have their own spacing. */
|
|
9
|
+
export const cardBodyVariants = cva('flex flex-1 flex-col', {
|
|
10
|
+
variants: { isFlush: { true: '', false: 'gap-5 p-6' } },
|
|
11
|
+
defaultVariants: { isFlush: false },
|
|
12
|
+
});
|
|
8
13
|
export const cardFooterClass = 'flex flex-wrap items-center gap-2 border-t border-border px-6 py-3';
|
|
9
14
|
//# sourceMappingURL=Card.variants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.variants.js","sourceRoot":"","sources":["../../../src/components/Card/Card.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,+DAA+D,CAAC;AACzF,MAAM,CAAC,MAAM,eAAe,GAAG,yEAAyE,CAAC;AACzG,MAAM,CAAC,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,oDAAoD,CAAC;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,+BAA+B,CAAC;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AACnE,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Card.variants.js","sourceRoot":"","sources":["../../../src/components/Card/Card.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG,+DAA+D,CAAC;AACzF,MAAM,CAAC,MAAM,eAAe,GAAG,yEAAyE,CAAC;AACzG,MAAM,CAAC,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,oDAAoD,CAAC;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,+BAA+B,CAAC;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AACnE,6GAA6G;AAC7G,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,sBAAsB,EAAE;IAC1D,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE;IACvD,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;CACpC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,oEAAoE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ColorPickerVariants } from './ColorPicker.variants.js';
|
|
2
|
+
export interface ColorPickerProps extends ColorPickerVariants {
|
|
3
|
+
/** Always given. It is read out even when it is not shown. */
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly isLabelHidden?: boolean;
|
|
6
|
+
/** The colour, as a hex colour (six hex digits after a hash), or nothing yet. */
|
|
7
|
+
readonly value?: string;
|
|
8
|
+
/** Called with the colour as a hex colour, or `undefined` when the field is emptied. */
|
|
9
|
+
readonly onChange: (value: string | undefined) => void;
|
|
10
|
+
/** Names the button beside the field that opens the colour area, such as "Choose a colour". */
|
|
11
|
+
readonly pickLabel: string;
|
|
12
|
+
/** Names the slider of hues, such as "Hue". */
|
|
13
|
+
readonly hueLabel: string;
|
|
14
|
+
/** Colours to offer at a press, as hex colours: a template's own palette. */
|
|
15
|
+
readonly presets?: readonly string[];
|
|
16
|
+
/** Names the presets, such as "Suggested colours". Needed with `presets`. */
|
|
17
|
+
readonly presetsLabel?: string;
|
|
18
|
+
/** Help that stays visible under the field. */
|
|
19
|
+
readonly description?: string;
|
|
20
|
+
/** What is wrong and how to fix it. Setting it marks the field invalid. */
|
|
21
|
+
readonly errorMessage?: string;
|
|
22
|
+
readonly isRequired?: boolean;
|
|
23
|
+
readonly isDisabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A colour, typed as a hex colour or chosen in an area of shades and a slider of hues, or from a
|
|
27
|
+
* few suggested ones. What is handed back is always a hex colour.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ColorPicker({ label, isLabelHidden, value, onChange, pickLabel, hueLabel, presets, presetsLabel, description, errorMessage, isRequired, isDisabled, width, }: ColorPickerProps): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=ColorPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAgBL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACvD,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAkBD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAkB,EAClB,UAAkB,EAClB,KAAK,GACN,EAAE,gBAAgB,+BAiElB"}
|