@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
|
@@ -1,14 +1,37 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
1
2
|
// The description sits on the highlighted option's background too, where the muted colour is too faint in dark.
|
|
2
3
|
export const optionPickerListClass = 'flex flex-col gap-4 pb-4 outline-none';
|
|
3
4
|
export const optionPickerEmptyClass = 'py-6 text-center text-sm text-foreground-muted';
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export const optionPickerGroupVariants = cva('', {
|
|
6
|
+
variants: {
|
|
7
|
+
layout: {
|
|
8
|
+
rows: 'flex flex-col gap-1',
|
|
9
|
+
// The group's name takes a row of its own above its cards.
|
|
10
|
+
cards: 'grid grid-cols-2 gap-2 sm:grid-cols-3',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const optionPickerGroupLabelClass = 'col-span-full px-2 pb-1 text-xs font-medium tracking-wide text-foreground-muted uppercase';
|
|
15
|
+
export const optionPickerOptionVariants = cva([
|
|
16
|
+
'flex cursor-default rounded-md p-2 outline-none',
|
|
8
17
|
'transition-colors motion-fast data-hovered:bg-secondary data-focused:bg-secondary',
|
|
9
18
|
'data-focus-visible:ring-2 data-focus-visible:ring-input-focus',
|
|
10
|
-
]
|
|
11
|
-
|
|
19
|
+
], {
|
|
20
|
+
variants: {
|
|
21
|
+
layout: {
|
|
22
|
+
rows: 'items-center gap-3',
|
|
23
|
+
cards: 'flex-col gap-2',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const optionPickerIconVariants = cva('grid shrink-0 place-items-center rounded-md bg-secondary text-secondary-foreground', {
|
|
28
|
+
variants: {
|
|
29
|
+
layout: {
|
|
30
|
+
rows: 'size-9',
|
|
31
|
+
cards: 'aspect-video w-full border border-border',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
12
35
|
export const optionPickerTextClass = 'flex min-w-0 flex-col';
|
|
13
36
|
export const optionPickerLabelClass = 'text-sm font-medium text-foreground';
|
|
14
37
|
export const optionPickerDescriptionClass = 'text-sm text-foreground-secondary';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionPicker.variants.js","sourceRoot":"","sources":["../../../src/patterns/OptionPicker/OptionPicker.variants.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,MAAM,CAAC,MAAM,qBAAqB,GAAG,uCAAuC,CAAC;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,gDAAgD,CAAC;AACvF,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"OptionPicker.variants.js","sourceRoot":"","sources":["../../../src/patterns/OptionPicker/OptionPicker.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,gHAAgH;AAChH,MAAM,CAAC,MAAM,qBAAqB,GAAG,uCAAuC,CAAC;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,gDAAgD,CAAC;AACvF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC,EAAE,EAAE;IAC/C,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,IAAI,EAAE,qBAAqB;YAC3B,2DAA2D;YAC3D,KAAK,EAAE,uCAAuC;SAC/C;KACF;CACF,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,2FAA2F,CAAC;AACvI,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAC3C;IACE,iDAAiD;IACjD,mFAAmF;IACnF,+DAA+D;CAChE,EACD;IACE,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,gBAAgB;SACxB;KACF;CACF,CACF,CAAC;AACF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC,oFAAoF,EAAE;IAChI,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,0CAA0C;SAClD;KACF;CACF,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,qCAAqC,CAAC;AAC5E,MAAM,CAAC,MAAM,4BAA4B,GAAG,mCAAmC,CAAC;AAEhF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
export interface OutlineItem {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
/** What it is called: "Page opening", "Text". */
|
|
5
|
+
readonly label: string;
|
|
6
|
+
/** How far inside other items it is: 0 at the top, at most 3. */
|
|
7
|
+
readonly depth?: 0 | 1 | 2 | 3;
|
|
8
|
+
readonly icon?: LucideIcon;
|
|
9
|
+
}
|
|
10
|
+
export interface OutlineProps {
|
|
11
|
+
/** Over the list, and its name for screen readers: "Sections". */
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly items: readonly OutlineItem[];
|
|
14
|
+
/** The one being looked at. */
|
|
15
|
+
readonly currentId?: string;
|
|
16
|
+
/** Called when one is chosen, with a press or with Enter. */
|
|
17
|
+
readonly onChoose: (id: string) => void;
|
|
18
|
+
/** Shown when there is nothing to list. */
|
|
19
|
+
readonly emptyText: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The parts of something long, by name, in order: the sections of a page. Choosing one goes to it.
|
|
23
|
+
* It is a way around, not a way to change: what is chosen is edited where it is.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Outline({ title, items, currentId, onChoose, emptyText }: OutlineProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=Outline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outline.d.ts","sourceRoot":"","sources":["../../../src/patterns/Outline/Outline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,+BAA+B;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,+BAmCrF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { ListBox, ListBoxItem } from 'react-aria-components';
|
|
4
|
+
import { outlineClass, outlineEmptyClass, outlineIconClass, outlineIconSize, outlineItemVariants, outlineLabelClass, outlineListClass, outlineTitleClass, } from './Outline.variants.js';
|
|
5
|
+
/**
|
|
6
|
+
* The parts of something long, by name, in order: the sections of a page. Choosing one goes to it.
|
|
7
|
+
* It is a way around, not a way to change: what is chosen is edited where it is.
|
|
8
|
+
*/
|
|
9
|
+
export function Outline({ title, items, currentId, onChoose, emptyText }) {
|
|
10
|
+
const titleId = useId();
|
|
11
|
+
return (_jsxs("div", { className: outlineClass, children: [_jsx("div", { id: titleId, className: outlineTitleClass, children: title }), _jsx(ListBox, { "aria-labelledby": titleId, className: outlineListClass, items: items, selectionMode: "single", selectedKeys: currentId === undefined ? [] : [currentId], onSelectionChange: (keys) => {
|
|
12
|
+
if (keys === 'all')
|
|
13
|
+
return;
|
|
14
|
+
const [first] = [...keys];
|
|
15
|
+
// Pressing the one already chosen would let it go: it is chosen again instead, so it is gone to.
|
|
16
|
+
const chosen = first === undefined ? currentId : String(first);
|
|
17
|
+
if (chosen !== undefined)
|
|
18
|
+
onChoose(chosen);
|
|
19
|
+
}, renderEmptyState: () => _jsx("div", { className: outlineEmptyClass, children: emptyText }), children: ({ id, label, depth = 0, icon: Icon }) => (_jsxs(ListBoxItem, { id: id, textValue: label, className: outlineItemVariants({ depth }), children: [Icon && (_jsx("span", { "aria-hidden": true, className: outlineIconClass, children: _jsx(Icon, { size: outlineIconSize }) })), _jsx("span", { className: outlineLabelClass, children: label })] })) })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outline.js","sourceRoot":"","sources":["../../../src/patterns/Outline/Outline.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAuB/B;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAgB;IACpF,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,OAAO,CACL,eAAK,SAAS,EAAE,YAAY,aAC1B,cAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,YAC3C,KAAK,GACF,EACN,KAAC,OAAO,uBACW,OAAO,EACxB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,KAAK,EACZ,aAAa,EAAC,QAAQ,EACtB,YAAY,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EACxD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE;oBAC1B,IAAI,IAAI,KAAK,KAAK;wBAAE,OAAO;oBAC3B,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;oBAC1B,iGAAiG;oBACjG,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC/D,IAAI,MAAM,KAAK,SAAS;wBAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC7C,CAAC,EACD,gBAAgB,EAAE,GAAG,EAAE,CAAC,cAAK,SAAS,EAAE,iBAAiB,YAAG,SAAS,GAAO,YAE3E,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACzC,MAAC,WAAW,IAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,mBAAmB,CAAC,EAAE,KAAK,EAAE,CAAC,aAC7E,IAAI,IAAI,CACP,oCAAkB,SAAS,EAAE,gBAAgB,YAC3C,KAAC,IAAI,IAAC,IAAI,EAAE,eAAe,GAAI,GAC1B,CACR,EACD,eAAM,SAAS,EAAE,iBAAiB,YAAG,KAAK,GAAQ,IACtC,CACf,GACO,IACN,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const outlineClass = "flex min-h-0 flex-col gap-2";
|
|
2
|
+
export declare const outlineTitleClass = "px-2 text-xs font-semibold tracking-widest text-foreground-subtle uppercase";
|
|
3
|
+
export declare const outlineListClass = "flex flex-col gap-0.5 outline-none";
|
|
4
|
+
export declare const outlineItemVariants: (props?: ({
|
|
5
|
+
depth?: 0 | 1 | 2 | 3 | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const outlineIconClass = "flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground-muted";
|
|
8
|
+
export declare const outlineIconSize = 14;
|
|
9
|
+
export declare const outlineLabelClass = "min-w-0 flex-1 truncate";
|
|
10
|
+
export declare const outlineEmptyClass = "px-2 py-3 text-sm text-foreground-muted";
|
|
11
|
+
//# sourceMappingURL=Outline.variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outline.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/Outline/Outline.variants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,gCAAgC,CAAC;AAC1D,eAAO,MAAM,iBAAiB,gFAAgF,CAAC;AAC/G,eAAO,MAAM,gBAAgB,uCAAuC,CAAC;AACrE,eAAO,MAAM,mBAAmB;;8EAc/B,CAAC;AACF,eAAO,MAAM,gBAAgB,0HAA0H,CAAC;AACxJ,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AAC3D,eAAO,MAAM,iBAAiB,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
export const outlineClass = 'flex min-h-0 flex-col gap-2';
|
|
3
|
+
export const outlineTitleClass = 'px-2 text-xs font-semibold tracking-widest text-foreground-subtle uppercase';
|
|
4
|
+
export const outlineListClass = 'flex flex-col gap-0.5 outline-none';
|
|
5
|
+
export const outlineItemVariants = cva([
|
|
6
|
+
'flex min-h-9 cursor-default items-center gap-2.5 rounded-lg px-2 text-base text-foreground-secondary transition-colors motion-fast outline-none',
|
|
7
|
+
'data-hovered:bg-background-secondary data-hovered:text-foreground',
|
|
8
|
+
'data-focus-visible:ring-2 data-focus-visible:ring-ring data-focus-visible:ring-inset',
|
|
9
|
+
'data-selected:bg-background-tertiary data-selected:font-semibold data-selected:text-foreground',
|
|
10
|
+
], {
|
|
11
|
+
variants: {
|
|
12
|
+
/** A section inside another is set in under it, a step for each level. */
|
|
13
|
+
depth: { 0: '', 1: 'pl-6', 2: 'pl-10', 3: 'pl-14' },
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: { depth: 0 },
|
|
16
|
+
});
|
|
17
|
+
export const outlineIconClass = 'flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground-muted';
|
|
18
|
+
export const outlineIconSize = 14;
|
|
19
|
+
export const outlineLabelClass = 'min-w-0 flex-1 truncate';
|
|
20
|
+
export const outlineEmptyClass = 'px-2 py-3 text-sm text-foreground-muted';
|
|
21
|
+
//# sourceMappingURL=Outline.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Outline.variants.js","sourceRoot":"","sources":["../../../src/patterns/Outline/Outline.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,6BAA6B,CAAC;AAC1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,6EAA6E,CAAC;AAC/G,MAAM,CAAC,MAAM,gBAAgB,GAAG,oCAAoC,CAAC;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC;IACE,iJAAiJ;IACjJ,mEAAmE;IACnE,sFAAsF;IACtF,gGAAgG;CACjG,EACD;IACE,QAAQ,EAAE;QACR,0EAA0E;QAC1E,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;KACpD;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;CAC9B,CACF,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,uHAAuH,CAAC;AACxJ,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAClC,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,yCAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/Outline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/Outline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuC,MAAM,cAAc,CAAC"}
|
|
@@ -1,12 +1,41 @@
|
|
|
1
|
+
import { type LucideIcon } from 'lucide-react';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
/** One of a screen's other buttons: a button from `md` up, an item of the screen's one menu on a phone. */
|
|
4
|
+
export interface PageAction {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly icon: LucideIcon;
|
|
8
|
+
readonly onPress: () => void;
|
|
9
|
+
/** How it looks as a button: `secondary` (the default), or `ghost` for what is pressed seldom, such as erasing. */
|
|
10
|
+
readonly variant?: 'secondary' | 'ghost';
|
|
11
|
+
/** `danger` for what cannot be undone: red in the menu. */
|
|
12
|
+
readonly tone?: 'default' | 'danger';
|
|
13
|
+
readonly isDisabled?: boolean;
|
|
14
|
+
/** Under way: the button shows a spinner. */
|
|
15
|
+
readonly isPending?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PageHeaderSecondary {
|
|
18
|
+
/** Names the menu they fold into on a phone, such as "More actions". */
|
|
19
|
+
readonly moreLabel: string;
|
|
20
|
+
readonly actions: readonly PageAction[];
|
|
21
|
+
}
|
|
2
22
|
export interface PageHeaderProps {
|
|
3
23
|
/** The name of the screen. It becomes the page's only level 1 heading. */
|
|
4
24
|
readonly title: string;
|
|
5
|
-
/** One sentence on what the screen is for. */
|
|
25
|
+
/** One sentence on what the screen is for, or how much it holds. Left out on a phone, in the bar. */
|
|
6
26
|
readonly description?: string;
|
|
7
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The screen's main buttons, main action last, shown on every window. In the bar a phone has one row, so
|
|
29
|
+
* keep to one or two, and give a button `collapses` so it is its icon alone there.
|
|
30
|
+
*/
|
|
8
31
|
readonly actions?: ReactNode;
|
|
32
|
+
/** The screen's other buttons, before the main ones: buttons from `md` up, one menu on a phone. */
|
|
33
|
+
readonly secondary?: PageHeaderSecondary;
|
|
9
34
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The top of every screen: its title, what it is for, and its actions. Inside `AppShell` it is drawn in the
|
|
37
|
+
* shell's bar, so the screen's own area holds only its content; on a phone it is one row there: the title,
|
|
38
|
+
* cut to fit, the menu of other actions and the main ones.
|
|
39
|
+
*/
|
|
40
|
+
export declare function PageHeader({ title, description, actions, secondary }: PageHeaderProps): import("react").JSX.Element | null;
|
|
12
41
|
//# sourceMappingURL=PageHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBvC,2GAA2G;AAC3G,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,mHAAmH;IACnH,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qGAAqG;IACrG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,mGAAmG;IACnG,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,sCA+DrF"}
|
|
@@ -1,10 +1,35 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Ellipsis } from 'lucide-react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { Button } from '../../components/Button/index.js';
|
|
2
5
|
import { Heading } from '../../components/Heading/index.js';
|
|
3
|
-
import {
|
|
6
|
+
import { IconButton } from '../../components/IconButton/index.js';
|
|
7
|
+
import { Menu } from '../../components/Menu/index.js';
|
|
4
8
|
import { Text } from '../../components/Text/index.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
import { usePageBar } from '../page-bar.js';
|
|
10
|
+
import { pageHeaderActionsVariants, pageHeaderDescriptionVariants, pageHeaderMoreClass, pageHeaderSecondaryClass, pageHeaderTitleVariants, pageHeaderVariants, } from './PageHeader.variants.js';
|
|
11
|
+
/**
|
|
12
|
+
* The top of every screen: its title, what it is for, and its actions. Inside `AppShell` it is drawn in the
|
|
13
|
+
* shell's bar, so the screen's own area holds only its content; on a phone it is one row there: the title,
|
|
14
|
+
* cut to fit, the menu of other actions and the main ones.
|
|
15
|
+
*/
|
|
16
|
+
export function PageHeader({ title, description, actions, secondary }) {
|
|
17
|
+
const bar = usePageBar();
|
|
18
|
+
// The shell is still drawing its bar: the header comes once there is a place for it.
|
|
19
|
+
if (bar === null)
|
|
20
|
+
return null;
|
|
21
|
+
const place = bar === undefined ? 'page' : 'bar';
|
|
22
|
+
const inBar = place === 'bar';
|
|
23
|
+
// In the shell's bar, which is the page's header already, it is one part of it.
|
|
24
|
+
const Element = inBar ? 'div' : 'header';
|
|
25
|
+
const others = secondary !== undefined && secondary.actions.length > 0 ? secondary : undefined;
|
|
26
|
+
const header = (_jsxs(Element, { className: pageHeaderVariants({ place }), children: [_jsxs("div", { className: pageHeaderTitleVariants({ place }), children: [_jsx(Heading, { level: 1, ...(inBar && { size: 'lg', truncate: true }), children: title }), description !== undefined && (_jsx("div", { className: pageHeaderDescriptionVariants({ place }), children: _jsx(Text, { tone: inBar ? 'muted' : 'secondary', size: inBar ? 'sm' : 'base', truncate: inBar, children: description }) }))] }), (others !== undefined || actions !== undefined) && (_jsxs("div", { className: pageHeaderActionsVariants({ place }), children: [others !== undefined && (_jsxs(_Fragment, { children: [_jsx("div", { className: pageHeaderSecondaryClass, children: others.actions.map((action) => (_jsx(Button, { variant: action.variant ?? 'secondary', icon: action.icon, onPress: action.onPress, ...(action.isDisabled !== undefined && { isDisabled: action.isDisabled }), ...(action.isPending !== undefined && { isPending: action.isPending }), children: action.label }, action.id))) }), _jsx("div", { className: pageHeaderMoreClass, children: _jsx(Menu, { placement: "bottom end", trigger: _jsx(IconButton, { label: others.moreLabel, icon: Ellipsis }), actions: others.actions.map(({ id, label, icon, tone, isDisabled }) => ({
|
|
27
|
+
id,
|
|
28
|
+
label,
|
|
29
|
+
icon,
|
|
30
|
+
...(tone !== undefined && { tone }),
|
|
31
|
+
...(isDisabled !== undefined && { isDisabled }),
|
|
32
|
+
})), onAction: (id) => others.actions.find((action) => action.id === id)?.onPress() }) })] })), actions] }))] }));
|
|
33
|
+
return bar === undefined ? header : createPortal(header, bar);
|
|
9
34
|
}
|
|
10
35
|
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAqClC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAmB;IACpF,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,qFAAqF;IACrF,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,MAAM,KAAK,GAAG,GAAG,KAAK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AC,MAAM,EAAE,GAAG,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* On its own, the top of a screen, with the actions under the title when there is no room beside it.
|
|
3
|
+
* In the shell's bar, one row on every window: the title and its sentence on the left, the actions on the right.
|
|
4
|
+
*/
|
|
5
|
+
export declare const pageHeaderVariants: (props?: ({
|
|
6
|
+
place?: "page" | "bar" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/** In the bar, one row: the title, then its sentence after it, cut to fit. */
|
|
9
|
+
export declare const pageHeaderTitleVariants: (props?: ({
|
|
10
|
+
place?: "page" | "bar" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
/** In the bar a phone has room for the title alone: the sentence after it comes from `md` up. */
|
|
13
|
+
export declare const pageHeaderDescriptionVariants: (props?: ({
|
|
14
|
+
place?: "page" | "bar" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
/** In the bar they never wrap: on a phone they are icons and one menu. */
|
|
17
|
+
export declare const pageHeaderActionsVariants: (props?: ({
|
|
18
|
+
place?: "page" | "bar" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
/** The other buttons, as buttons from `md` up. */
|
|
21
|
+
export declare const pageHeaderSecondaryClass = "hidden items-center gap-2 md:flex";
|
|
22
|
+
/** The same, as one menu on a phone. */
|
|
23
|
+
export declare const pageHeaderMoreClass = "flex md:hidden";
|
|
3
24
|
//# sourceMappingURL=PageHeader.variants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.variants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageHeader.variants.d.ts","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.variants.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;8EAQ7B,CAAC;AACH,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB;;8EAGlC,CAAC;AACH,iGAAiG;AACjG,eAAO,MAAM,6BAA6B;;8EAGxC,CAAC;AACH,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB;;8EAGpC,CAAC;AACH,kDAAkD;AAClD,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAC5E,wCAAwC;AACxC,eAAO,MAAM,mBAAmB,mBAAmB,CAAC"}
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* On its own, the top of a screen, with the actions under the title when there is no room beside it.
|
|
4
|
+
* In the shell's bar, one row on every window: the title and its sentence on the left, the actions on the right.
|
|
5
|
+
*/
|
|
6
|
+
export const pageHeaderVariants = cva('flex min-w-0 justify-between', {
|
|
7
|
+
variants: {
|
|
8
|
+
place: {
|
|
9
|
+
page: 'flex-wrap items-start gap-x-6 gap-y-4',
|
|
10
|
+
bar: 'flex-1 items-center gap-2 md:gap-4 md:py-2',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: { place: 'page' },
|
|
14
|
+
});
|
|
15
|
+
/** In the bar, one row: the title, then its sentence after it, cut to fit. */
|
|
16
|
+
export const pageHeaderTitleVariants = cva('flex min-w-0', {
|
|
17
|
+
variants: { place: { page: 'flex-col gap-1', bar: 'flex-1 items-baseline gap-3' } },
|
|
18
|
+
defaultVariants: { place: 'page' },
|
|
19
|
+
});
|
|
20
|
+
/** In the bar a phone has room for the title alone: the sentence after it comes from `md` up. */
|
|
21
|
+
export const pageHeaderDescriptionVariants = cva('min-w-0', {
|
|
22
|
+
variants: { place: { page: '', bar: 'hidden flex-1 md:block' } },
|
|
23
|
+
defaultVariants: { place: 'page' },
|
|
24
|
+
});
|
|
25
|
+
/** In the bar they never wrap: on a phone they are icons and one menu. */
|
|
26
|
+
export const pageHeaderActionsVariants = cva('flex max-w-full shrink-0 items-center', {
|
|
27
|
+
variants: { place: { page: 'flex-wrap gap-2', bar: 'gap-1 md:gap-2' } },
|
|
28
|
+
defaultVariants: { place: 'page' },
|
|
29
|
+
});
|
|
30
|
+
/** The other buttons, as buttons from `md` up. */
|
|
31
|
+
export const pageHeaderSecondaryClass = 'hidden items-center gap-2 md:flex';
|
|
32
|
+
/** The same, as one menu on a phone. */
|
|
33
|
+
export const pageHeaderMoreClass = 'flex md:hidden';
|
|
3
34
|
//# sourceMappingURL=PageHeader.variants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.variants.js","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.variants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"PageHeader.variants.js","sourceRoot":"","sources":["../../../src/patterns/PageHeader/PageHeader.variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC,8BAA8B,EAAE;IACpE,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,uCAAuC;YAC7C,GAAG,EAAE,4CAA4C;SAClD;KACF;IACD,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC,cAAc,EAAE;IACzD,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,6BAA6B,EAAE,EAAE;IACnF,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,iGAAiG;AACjG,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC,SAAS,EAAE;IAC1D,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,wBAAwB,EAAE,EAAE;IAChE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC,uCAAuC,EAAE;IACpF,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE;IACvE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;CACnC,CAAC,CAAC;AACH,kDAAkD;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAG,mCAAmC,CAAC;AAC5E,wCAAwC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type PagePreviewVariants } from './PagePreview.variants.js';
|
|
3
|
+
/** What can be done to a section from the page itself. */
|
|
4
|
+
declare const ACTIONS: readonly ["up", "down", "duplicate", "remove", "addBefore", "addAfter"];
|
|
5
|
+
export type PageSectionAction = (typeof ACTIONS)[number];
|
|
6
|
+
declare const ITEM_ACTIONS: readonly ["up", "down", "duplicate", "remove"];
|
|
7
|
+
/** What can be done to one item of a list from the page. */
|
|
8
|
+
export type PageItemAction = (typeof ITEM_ACTIONS)[number];
|
|
9
|
+
/** A look of a section chosen among a few of the site's colours: its field, what it is called, each choice with a sample, and the one chosen. */
|
|
10
|
+
export interface PageSectionSwatches {
|
|
11
|
+
readonly field: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly chosen?: string;
|
|
14
|
+
readonly choices: readonly {
|
|
15
|
+
readonly value: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly colour: string;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
20
|
+
export interface PageSectionTools {
|
|
21
|
+
/** What each button is called, shown when the pointer rests on it, and the words on the button that adds a section. */
|
|
22
|
+
readonly labels: {
|
|
23
|
+
readonly up: string;
|
|
24
|
+
readonly down: string;
|
|
25
|
+
readonly duplicate: string;
|
|
26
|
+
readonly remove: string;
|
|
27
|
+
readonly add: string;
|
|
28
|
+
readonly addBefore: string;
|
|
29
|
+
readonly addAfter: string;
|
|
30
|
+
readonly picture?: string;
|
|
31
|
+
readonly link?: string;
|
|
32
|
+
readonly bold?: string;
|
|
33
|
+
readonly italic?: string;
|
|
34
|
+
readonly textLink?: string;
|
|
35
|
+
readonly itemUp?: string;
|
|
36
|
+
readonly itemDown?: string;
|
|
37
|
+
readonly itemDuplicate?: string;
|
|
38
|
+
readonly itemRemove?: string;
|
|
39
|
+
};
|
|
40
|
+
/** For each section's id: what it is called, and what can be done to it now. */
|
|
41
|
+
readonly sections: Readonly<Record<string, {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly up: boolean;
|
|
44
|
+
readonly down: boolean;
|
|
45
|
+
readonly copy: boolean;
|
|
46
|
+
readonly add: boolean;
|
|
47
|
+
readonly pictures?: readonly string[];
|
|
48
|
+
readonly links?: readonly string[];
|
|
49
|
+
readonly lists?: readonly {
|
|
50
|
+
readonly field: string;
|
|
51
|
+
readonly count: number;
|
|
52
|
+
readonly full: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
readonly swatches?: readonly PageSectionSwatches[];
|
|
55
|
+
readonly list?: string;
|
|
56
|
+
readonly group?: string;
|
|
57
|
+
}>>;
|
|
58
|
+
/**
|
|
59
|
+
* The places inside sections that hold sections of their own, each by the section it is in and its field (`id:columns.0.content`):
|
|
60
|
+
* which places take each other's sections (`group`), and whether one is empty or takes no more.
|
|
61
|
+
*/
|
|
62
|
+
readonly slots?: Readonly<Record<string, {
|
|
63
|
+
readonly group: string;
|
|
64
|
+
readonly empty: boolean;
|
|
65
|
+
readonly full: boolean;
|
|
66
|
+
}>>;
|
|
67
|
+
}
|
|
3
68
|
export interface PagePreviewProps extends PagePreviewVariants {
|
|
4
69
|
/** Names the frame for screen readers: "Why list with us, as it would look". */
|
|
5
70
|
readonly label: string;
|
|
@@ -14,16 +79,85 @@ export interface PagePreviewProps extends PagePreviewVariants {
|
|
|
14
79
|
readonly note?: string;
|
|
15
80
|
/** Controls for the preview, such as the choice of width. */
|
|
16
81
|
readonly toolbar?: ReactNode;
|
|
82
|
+
/** The one thing to do with the page, such as opening it larger: a `Button` at the start of the bar, in place of `note`. */
|
|
83
|
+
readonly action?: ReactNode;
|
|
17
84
|
/** Shown in place of the page when there is no `address`. */
|
|
18
85
|
readonly emptyText: string;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Called with a section's id when it is pressed on the page, and with the field that was
|
|
88
|
+
* pressed, as keys (`title`, `items.0.text`), where the page marks its fields.
|
|
89
|
+
*/
|
|
90
|
+
readonly onSectionPress?: (id: string, field?: string, inForm?: boolean) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Called when the page asks where a link in text being written there should lead, with the
|
|
93
|
+
* address it has now (or none) and how to answer: an address, nothing to take the link away,
|
|
94
|
+
* or `null` to leave it as it is. Ask the person, then answer.
|
|
95
|
+
*/
|
|
96
|
+
readonly onTextLink?: (href: string, answer: (href: string | null) => void) => void;
|
|
97
|
+
/** Called when a swatch on a section's bar is pressed: the section, the field and the choice. Whoever holds the sections makes the change. */
|
|
98
|
+
readonly onSectionSwatch?: (id: string, field: string, value: string) => void;
|
|
99
|
+
/** Called when the keys that take a change back are pressed on the page. The page takes nothing back itself. */
|
|
100
|
+
readonly onUndo?: () => void;
|
|
101
|
+
/** Called when the keys that make a change again are pressed on the page. */
|
|
102
|
+
readonly onRedo?: () => void;
|
|
103
|
+
/** Called when the keys that save are pressed on the page. The page saves nothing itself. */
|
|
104
|
+
readonly onSave?: () => void;
|
|
105
|
+
/**
|
|
106
|
+
* How many times Escape was pressed in the editor around the page. Each new count is told to the page as
|
|
107
|
+
* its own Escape: it drops a dragged section where it was and closes its list of sections, as Escape on
|
|
108
|
+
* the page does, wherever the keyboard happened to be.
|
|
109
|
+
*/
|
|
110
|
+
readonly escapes?: number;
|
|
111
|
+
/** The section the page should have in view, and outlined. */
|
|
22
112
|
readonly shownSectionId?: string;
|
|
113
|
+
/** Changes each time the section is asked for again, so the same one is brought into view again. */
|
|
114
|
+
readonly shownAt?: number;
|
|
115
|
+
/**
|
|
116
|
+
* Where words may be typed on the page itself: for each section's id, the fields of it, as keys
|
|
117
|
+
* (`title`, `items.0.text`). Left out, the page is only looked at and pressed.
|
|
118
|
+
*/
|
|
119
|
+
readonly typable?: Readonly<Record<string, readonly string[]>>;
|
|
120
|
+
/**
|
|
121
|
+
* Called as words are typed into a field on the page, with all the field now says. The page
|
|
122
|
+
* already shows them, so the change of `draft` that follows asks for no new page.
|
|
123
|
+
*/
|
|
124
|
+
readonly onWords?: (id: string, field: string, words: string) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Puts a small bar on the section the pointer is in (move up, move down, copy, remove) and a
|
|
127
|
+
* button at each of its edges that adds a section there. Left out, the page has none.
|
|
128
|
+
*/
|
|
129
|
+
readonly tools?: PageSectionTools;
|
|
130
|
+
/** Called when a button of `tools` is pressed on the page. The page changes nothing itself. */
|
|
131
|
+
readonly onSectionAction?: (id: string, action: PageSectionAction) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Called when a section is dragged by its bar and let go: with the section it should now come
|
|
134
|
+
* before, or `null` for after the last.
|
|
135
|
+
*/
|
|
136
|
+
readonly onSectionMove?: (id: string, beforeId: string | null, into?: string) => void;
|
|
137
|
+
/** Called when the button of an empty place inside a section is pressed on the page: the section and the place's field, as keys. Offer what can be added there. */
|
|
138
|
+
readonly onSectionSlot?: (id: string, field: string) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Called when the button on one of a section's pictures is pressed on the page, with the
|
|
141
|
+
* section's id and the picture's field, as keys. Open the window the picture is chosen in.
|
|
142
|
+
*/
|
|
143
|
+
readonly onSectionPicture?: (id: string, field: string) => void;
|
|
144
|
+
/**
|
|
145
|
+
* Called when the button on one of a section's links is pressed on the page, with the section's
|
|
146
|
+
* id and the link's field, as keys. Open a window the link is changed in.
|
|
147
|
+
*/
|
|
148
|
+
readonly onSectionLink?: (id: string, field: string) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Called when a button on one item of a section's list is pressed on the page, with the section's
|
|
151
|
+
* id, the list's field as keys, the item's place and what was asked. Whoever holds the list makes the change.
|
|
152
|
+
*/
|
|
153
|
+
readonly onSectionItem?: (id: string, field: string, at: number, action: PageItemAction) => void;
|
|
154
|
+
/** No border of its own, for a place that frames it already, such as a whole window. */
|
|
155
|
+
readonly isBare?: boolean;
|
|
23
156
|
}
|
|
24
157
|
/**
|
|
25
158
|
* A page of the site as it would look with what is in a form now, in a frame. The page is drawn
|
|
26
159
|
* by the site itself, so it looks exactly as it will; nothing of it is drawn here.
|
|
27
160
|
*/
|
|
28
|
-
export declare function PagePreview({ label, address, draft, note, toolbar, emptyText, onSectionPress, shownSectionId, width }: PagePreviewProps): import("react").JSX.Element;
|
|
161
|
+
export declare function PagePreview({ label, address, draft, note, toolbar, action, emptyText, onSectionPress, shownSectionId, shownAt, typable, onWords, tools, onSectionAction, onSectionMove, onSectionPicture, onSectionLink, onSectionItem, onSectionSwatch, onSectionSlot, onTextLink, onUndo, onRedo, onSave, escapes, isBare, width }: PagePreviewProps): import("react").JSX.Element;
|
|
162
|
+
export {};
|
|
29
163
|
//# sourceMappingURL=PagePreview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PagePreview.d.ts","sourceRoot":"","sources":["../../../src/patterns/PagePreview/PagePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PagePreview.d.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