@arshad-shah/cynosure 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/adapters/astro/index.d.ts +52 -0
- package/dist/adapters/astro/index.js +27 -0
- package/dist/adapters/astro/index.js.map +1 -0
- package/dist/adapters/vite/index.d.ts +11 -0
- package/dist/adapters/vite/index.js +33 -12
- package/dist/adapters/vite/index.js.map +1 -1
- package/dist/brands/googleplay.d.ts +2 -0
- package/dist/brands/googleplay.js +17 -0
- package/dist/brands/googleplay.js.map +1 -0
- package/dist/brands/index.d.ts +1 -0
- package/dist/brands/index.js +132 -130
- package/dist/components/Announcer/Announcer.js +5 -5
- package/dist/components/Announcer/Announcer.js.map +1 -1
- package/dist/components/AppShell/AppShell.js +50 -53
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/Avatar/Avatar.js +20 -20
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Button/Button.d.ts +17 -3
- package/dist/components/Button/Button.js +51 -44
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.js +69 -69
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Card/Card.d.ts +8 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/components/Checkbox/Checkbox.js +33 -8
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checklist/Checklist.js +21 -21
- package/dist/components/Checklist/Checklist.js.map +1 -1
- package/dist/components/Choice/Choice.d.ts +73 -0
- package/dist/components/Choice/Choice.js +41 -0
- package/dist/components/Choice/Choice.js.map +1 -0
- package/dist/components/Choice/index.d.ts +1 -0
- package/dist/components/ColorField/ColorField.js +198 -207
- package/dist/components/ColorField/ColorField.js.map +1 -1
- package/dist/components/Combobox/Combobox.js +86 -115
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Container/Container.d.ts +2 -2
- package/dist/components/Container/Container.js +17 -13
- package/dist/components/Container/Container.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.js +29 -28
- package/dist/components/CopyButton/CopyButton.js.map +1 -1
- package/dist/components/DeviceFrame/DeviceFrame.d.ts +63 -0
- package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
- package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
- package/dist/components/DeviceFrame/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +10 -1
- package/dist/components/Dialog/Dialog.js +82 -77
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +5 -2
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/Field/Field.js +31 -33
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/FileDrop/FileDrop.js +14 -14
- package/dist/components/FileDrop/FileDrop.js.map +1 -1
- package/dist/components/FloatingToolbar/FloatingToolbar.js +7 -6
- package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +32 -11
- package/dist/components/Grid/Grid.js +68 -46
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/index.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +4 -2
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +16 -1
- package/dist/components/IconButton/IconButton.js +14 -10
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconTile/IconTile.d.ts +45 -0
- package/dist/components/IconTile/IconTile.js +25 -0
- package/dist/components/IconTile/IconTile.js.map +1 -0
- package/dist/components/IconTile/index.d.ts +1 -0
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Inline/Inline.d.ts +3 -3
- package/dist/components/Inline/Inline.js +12 -22
- package/dist/components/Inline/Inline.js.map +1 -1
- package/dist/components/KeyValueEditor/KeyValueEditor.js +37 -36
- package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
- package/dist/components/Link/Link.d.ts +9 -1
- package/dist/components/Link/Link.js +20 -18
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/List/List.d.ts +73 -0
- package/dist/components/List/List.js +64 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/Notice/Notice.js +12 -11
- package/dist/components/Notice/Notice.js.map +1 -1
- package/dist/components/OptionList/OptionList.d.ts +69 -0
- package/dist/components/OptionList/OptionList.js +75 -0
- package/dist/components/OptionList/OptionList.js.map +1 -0
- package/dist/components/OptionList/index.d.ts +1 -0
- package/dist/components/PageHeader/PageHeader.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.js +27 -27
- package/dist/components/PageHeader/PageHeader.js.map +1 -1
- package/dist/components/Pagination/Pagination.js +31 -30
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/QRCode/QRCode.d.ts +56 -0
- package/dist/components/QRCode/QRCode.js +48 -0
- package/dist/components/QRCode/QRCode.js.map +1 -0
- package/dist/components/QRCode/index.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroup.js +32 -24
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Section/Section.d.ts +57 -0
- package/dist/components/Section/Section.js +27 -0
- package/dist/components/Section/Section.js.map +1 -0
- package/dist/components/Section/index.d.ts +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +12 -12
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/Select/Select.js +106 -133
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Sheet/Sheet.js +12 -7
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/SideNav/SideNav.js +55 -53
- package/dist/components/SideNav/SideNav.js.map +1 -1
- package/dist/components/SiteFooter/SiteFooter.d.ts +66 -0
- package/dist/components/SiteFooter/SiteFooter.js +80 -0
- package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
- package/dist/components/SiteFooter/index.d.ts +1 -0
- package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
- package/dist/components/SiteHeader/SiteHeader.js +114 -0
- package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
- package/dist/components/SiteHeader/index.d.ts +1 -0
- package/dist/components/SkipLink/SkipLink.d.ts +42 -0
- package/dist/components/SkipLink/SkipLink.js +43 -0
- package/dist/components/SkipLink/SkipLink.js.map +1 -0
- package/dist/components/SkipLink/index.d.ts +1 -0
- package/dist/components/SortableList/SortableList.js +13 -13
- package/dist/components/SortableList/SortableList.js.map +1 -1
- package/dist/components/Stack/Stack.d.ts +16 -7
- package/dist/components/Stack/Stack.js +25 -18
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/index.d.ts +1 -1
- package/dist/components/Stack/space.d.ts +29 -0
- package/dist/components/Stack/space.js +16 -5
- package/dist/components/Stack/space.js.map +1 -1
- package/dist/components/Stat/Stat.d.ts +88 -0
- package/dist/components/Stat/Stat.js +105 -0
- package/dist/components/Stat/Stat.js.map +1 -0
- package/dist/components/Stat/index.d.ts +1 -0
- package/dist/components/Steps/Steps.d.ts +10 -4
- package/dist/components/Steps/Steps.js +31 -30
- package/dist/components/Steps/Steps.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -4
- package/dist/components/Switch/Switch.js +18 -7
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Table/Table.js +11 -12
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +4 -1
- package/dist/components/Tabs/Tabs.js +71 -70
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TagInput/TagInput.js +76 -97
- package/dist/components/TagInput/TagInput.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +4 -0
- package/dist/components/TextField/TextField.js +30 -29
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +7 -1
- package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
- package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
- package/dist/components/Toast/Toast.js +22 -20
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +6 -1
- package/dist/components/Tooltip/Tooltip.js +19 -19
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
- package/dist/components/VisuallyHidden/index.d.ts +1 -0
- package/dist/foundations/ChoiceBase/ChoiceBase.js +8 -8
- package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
- package/dist/foundations/HiddenValue/HiddenValue.js +5 -5
- package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
- package/dist/foundations/Icon/Icon.d.ts +6 -1
- package/dist/foundations/Icon/Icon.js +15 -14
- package/dist/foundations/Icon/Icon.js.map +1 -1
- package/dist/foundations/image-outcome.d.ts +8 -3
- package/dist/foundations/image-outcome.js +12 -8
- package/dist/foundations/image-outcome.js.map +1 -1
- package/dist/foundations/printing.d.ts +6 -0
- package/dist/foundations/printing.js +17 -0
- package/dist/foundations/printing.js.map +1 -0
- package/dist/foundations/qr.d.ts +42 -0
- package/dist/foundations/qr.js +246 -0
- package/dist/foundations/qr.js.map +1 -0
- package/dist/icons/book-marked.d.ts +2 -0
- package/dist/icons/book-marked.js +14 -0
- package/dist/icons/book-marked.js.map +1 -0
- package/dist/icons/calendar-days.d.ts +2 -0
- package/dist/icons/calendar-days.js +24 -0
- package/dist/icons/calendar-days.js.map +1 -0
- package/dist/icons/check-square.d.ts +2 -0
- package/dist/icons/check-square.js +14 -0
- package/dist/icons/check-square.js.map +1 -0
- package/dist/icons/crescent.d.ts +2 -0
- package/dist/icons/crescent.js +14 -0
- package/dist/icons/crescent.js.map +1 -0
- package/dist/icons/index.d.ts +10 -0
- package/dist/icons/index.js +436 -416
- package/dist/icons/kaaba.d.ts +2 -0
- package/dist/icons/kaaba.js +14 -0
- package/dist/icons/kaaba.js.map +1 -0
- package/dist/icons/keywords.d.ts +11 -1
- package/dist/icons/keywords.js +89 -1
- package/dist/icons/keywords.js.map +1 -1
- package/dist/icons/list-tree.d.ts +2 -0
- package/dist/icons/list-tree.js +14 -0
- package/dist/icons/list-tree.js.map +1 -0
- package/dist/icons/mosque.d.ts +2 -0
- package/dist/icons/mosque.js +14 -0
- package/dist/icons/mosque.js.map +1 -0
- package/dist/icons/prayer-beads.d.ts +2 -0
- package/dist/icons/prayer-beads.js +67 -0
- package/dist/icons/prayer-beads.js.map +1 -0
- package/dist/icons/qr-code.d.ts +2 -0
- package/dist/icons/qr-code.js +38 -0
- package/dist/icons/qr-code.js.map +1 -0
- package/dist/icons/refresh-cw.d.ts +2 -0
- package/dist/icons/refresh-cw.js +14 -0
- package/dist/icons/refresh-cw.js.map +1 -0
- package/dist/icons/types.d.ts +1 -1
- package/dist/icons/types.js +2 -1
- package/dist/icons/types.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +274 -241
- package/dist/styles/announcer.css +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/avatar.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/calendar.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/choice-base.css +1 -0
- package/dist/styles/choice.css +1 -1
- package/dist/styles/color-field.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/copy-button.css +1 -1
- package/dist/styles/date-field.css +1 -1
- package/dist/styles/device-frame.css +1 -0
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/disclosure.css +1 -1
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-drop.css +1 -1
- package/dist/styles/floating-toolbar.css +1 -1
- package/dist/styles/generated-css.d.ts +1 -1
- package/dist/styles/generated-css.js +1 -1
- package/dist/styles/generated-css.js.map +1 -1
- package/dist/styles/grid.css +1 -1
- package/dist/styles/heading.css +1 -1
- package/dist/styles/icon-tile.css +1 -0
- package/dist/styles/icon.css +1 -1
- package/dist/styles/inline.css +1 -0
- package/dist/styles/key-value-editor.css +1 -1
- package/dist/styles/link.css +1 -1
- package/dist/styles/list.css +1 -0
- package/dist/styles/manifest.json +715 -0
- package/dist/styles/notice.css +1 -1
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/option-list.css +1 -0
- package/dist/styles/pagination.css +1 -1
- package/dist/styles/qr-code.css +1 -0
- package/dist/styles/radio-group.css +1 -1
- package/dist/styles/section.css +1 -0
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/sheet.css +1 -1
- package/dist/styles/side-nav.css +1 -1
- package/dist/styles/site-footer.css +1 -0
- package/dist/styles/site-header.css +1 -0
- package/dist/styles/skip-link.css +1 -0
- package/dist/styles/sortable-list.css +1 -1
- package/dist/styles/stack.css +1 -1
- package/dist/styles/stat.css +1 -0
- package/dist/styles/steps.css +1 -1
- package/dist/styles/switch.css +1 -0
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/tag-input.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/time-field.css +1 -1
- package/dist/styles/toast.css +1 -1
- package/dist/styles/visually-hidden.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/create-theme.js +137 -108
- package/dist/tokens/create-theme.js.map +1 -1
- package/package.json +6 -1
- package/dist/components/Checkbox/ChoiceRow.d.ts +0 -39
- package/dist/components/Checkbox/ChoiceRow.js +0 -58
- package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
- package/dist/styles/hidden-value.css +0 -1
- package/dist/styles/iconbutton.css +0 -1
- package/dist/styles/search-field.css +0 -1
|
@@ -12,6 +12,8 @@ export interface HeadingTokens {
|
|
|
12
12
|
sizeXl: string;
|
|
13
13
|
/** Font size of `size="2xl"` (the default for level 1). */
|
|
14
14
|
"size-2xl": string;
|
|
15
|
+
/** Font size of `size="3xl"`, between 2xl and display: a section page's title, fixed at 1.4 times 2xl. */
|
|
16
|
+
"size-3xl": string;
|
|
15
17
|
/** Font size of `size="display"`, a page's hero title. Grows with the viewport between 1.25 and 2 times 2xl. */
|
|
16
18
|
sizeDisplay: string;
|
|
17
19
|
/** Font family. Falls back to the display font. */
|
|
@@ -27,13 +29,13 @@ declare module "../../tokens/schema.js" {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
30
|
-
export type HeadingSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "display";
|
|
32
|
+
export type HeadingSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "display";
|
|
31
33
|
export interface HeadingProps {
|
|
32
34
|
/** The element rendered (`h1` to `h6`) and so the heading's place in the page outline. Default 2. */
|
|
33
35
|
level?: HeadingLevel;
|
|
34
36
|
/**
|
|
35
37
|
* How large it looks, whatever its level. Defaults to the level's size: 1 is "2xl", 2 is "xl", 3 is "lg",
|
|
36
|
-
* 4 is "md", 5 is "sm" and 6 is "xs". "
|
|
38
|
+
* 4 is "md", 5 is "sm" and 6 is "xs". "3xl" is 1.4 times "2xl" at every width; "display" is larger still and grows with the viewport, for a page's hero title.
|
|
37
39
|
*/
|
|
38
40
|
size?: HeadingSize;
|
|
39
41
|
/** Text colour: the ink colour, muted, the accent, or whatever the parent uses. Default "neutral". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","names":["forwardRef","jsx","SIZE_BY_LEVEL","Heading","level","size","tone","weight","align","truncate","id","className","style","children","ref","Tag","lines"],"sources":["../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\n\nexport interface HeadingTokens {\n /** Font size of `size=\"xs\"` (the default for level 6). */\n sizeXs: string;\n /** Font size of `size=\"sm\"` (the default for level 5). */\n sizeSm: string;\n /** Font size of `size=\"md\"` (the default for level 4). */\n sizeMd: string;\n /** Font size of `size=\"lg\"` (the default for level 3). */\n sizeLg: string;\n /** Font size of `size=\"xl\"` (the default for level 2). */\n sizeXl: string;\n /** Font size of `size=\"2xl\"` (the default for level 1). */\n \"size-2xl\": string;\n /** Font size of `size=\"display\"`, a page's hero title. Grows with the viewport between 1.25 and 2 times 2xl. */\n sizeDisplay: string;\n /** Font family. Falls back to the display font. */\n fontFamily: string;\n /** Weight of bold headings (the default weight). */\n fontWeight: string;\n /** Line height, as a number. Tighter than body text. */\n lineHeight: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n heading: HeadingTokens;\n }\n}\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"display\";\n\nexport interface HeadingProps {\n /** The element rendered (`h1` to `h6`) and so the heading's place in the page outline. Default 2. */\n level?: HeadingLevel;\n /**\n * How large it looks, whatever its level. Defaults to the level's size: 1 is \"2xl\", 2 is \"xl\", 3 is \"lg\",\n * 4 is \"md\", 5 is \"sm\" and 6 is \"xs\". \"
|
|
1
|
+
{"version":3,"file":"Heading.js","names":["forwardRef","jsx","SIZE_BY_LEVEL","Heading","level","size","tone","weight","align","truncate","id","className","style","children","ref","Tag","lines"],"sources":["../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\n\nexport interface HeadingTokens {\n /** Font size of `size=\"xs\"` (the default for level 6). */\n sizeXs: string;\n /** Font size of `size=\"sm\"` (the default for level 5). */\n sizeSm: string;\n /** Font size of `size=\"md\"` (the default for level 4). */\n sizeMd: string;\n /** Font size of `size=\"lg\"` (the default for level 3). */\n sizeLg: string;\n /** Font size of `size=\"xl\"` (the default for level 2). */\n sizeXl: string;\n /** Font size of `size=\"2xl\"` (the default for level 1). */\n \"size-2xl\": string;\n /** Font size of `size=\"3xl\"`, between 2xl and display: a section page's title, fixed at 1.4 times 2xl. */\n \"size-3xl\": string;\n /** Font size of `size=\"display\"`, a page's hero title. Grows with the viewport between 1.25 and 2 times 2xl. */\n sizeDisplay: string;\n /** Font family. Falls back to the display font. */\n fontFamily: string;\n /** Weight of bold headings (the default weight). */\n fontWeight: string;\n /** Line height, as a number. Tighter than body text. */\n lineHeight: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n heading: HeadingTokens;\n }\n}\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"display\";\n\nexport interface HeadingProps {\n /** The element rendered (`h1` to `h6`) and so the heading's place in the page outline. Default 2. */\n level?: HeadingLevel;\n /**\n * How large it looks, whatever its level. Defaults to the level's size: 1 is \"2xl\", 2 is \"xl\", 3 is \"lg\",\n * 4 is \"md\", 5 is \"sm\" and 6 is \"xs\". \"3xl\" is 1.4 times \"2xl\" at every width; \"display\" is larger still and grows with the viewport, for a page's hero title.\n */\n size?: HeadingSize;\n /** Text colour: the ink colour, muted, the accent, or whatever the parent uses. Default \"neutral\". */\n tone?: \"inherit\" | \"neutral\" | \"muted\" | \"accent\";\n /** Font weight. Default \"bold\". */\n weight?: \"medium\" | \"bold\";\n /** Text alignment, RTL aware. Left unset, it follows the parent. */\n align?: \"start\" | \"center\" | \"end\";\n /** `true` keeps it on one line and ends it with an ellipsis; a number cuts it after that many lines. Default false. */\n truncate?: boolean | number;\n /** Set on the heading element, for `aria-labelledby` and links to the section. */\n id?: string;\n /** Added to the heading element, for layout. */\n className?: string;\n /** Layout only. Restyle through `--cy-heading-*` tokens. */\n style?: CSSProperties;\n /** The heading's text. */\n children?: ReactNode;\n}\n\nconst SIZE_BY_LEVEL = [\"2xl\", \"xl\", \"lg\", \"md\", \"sm\", \"xs\"] as const;\n\n/** A section or page heading. `level` sets the element, `size` sets the look, so the outline stays correct. */\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n {\n level = 2,\n size,\n tone = \"neutral\",\n weight = \"bold\",\n align,\n truncate = false,\n id,\n className,\n style,\n children,\n },\n ref,\n) {\n const Tag = `h${level}` as \"h1\";\n const lines = typeof truncate === \"number\" && truncate > 0 ? Math.floor(truncate) : 0;\n return (\n <Tag\n ref={ref}\n id={id}\n className={`cy-heading${className ? ` ${className}` : \"\"}`}\n data-size={size ?? SIZE_BY_LEVEL[level - 1]}\n data-tone={tone}\n data-weight={weight}\n data-align={align}\n data-truncate={lines ? \"lines\" : truncate === true ? \"line\" : undefined}\n style={lines ? ({ \"--_lines\": lines, ...style } as CSSProperties) : style}\n >\n {children}\n </Tag>\n );\n});\n"],"mappings":";;;AA8DA,IAAME,IAAgB;AAAA,EAAC;AAAA,EAAO;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAI,GAG7CC,IAAUH,EAA6C,SAClE,EACE,OAAAI,IAAQ,GACR,MAAAC,GACA,MAAAC,IAAO,WACP,QAAAC,IAAS,QACT,OAAAC,GACA,UAAAC,IAAW,IACX,IAAAC,GACA,WAAAC,GACA,OAAAC,GACA,UAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAM,IAAIX,CAAA,IACVY,IAAQ,OAAOP,KAAa,YAAYA,IAAW,IAAI,KAAK,MAAMA,CAAQ,IAAI;AACpF,SACE,gBAAAR,EAACc,GAAD;AAAA,IACO,KAAAD;AAAA,IACD,IAAAJ;AAAA,IACJ,WAAW,aAAaC,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACtD,aAAWN,KAAQH,EAAcE,IAAQ,CAAA;AAAA,IACzC,aAAWE;AAAA,IACX,eAAaC;AAAA,IACb,cAAYC;AAAA,IACZ,iBAAeQ,IAAQ,UAAUP,MAAa,KAAO,SAAS;AAAA,IAC9D,OAAOO,IAAS;AAAA,MAAE,YAAYA;AAAA,MAAO,GAAGJ;AAAA,IAAM,IAAsBA;AAAA,IAEnE,UAAAC;AAAA,EACE,CAAA;AAET,CAAC"}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import type { IconData } from "../../icons/types.js";
|
|
2
2
|
import type { Placement } from "../../overlay/position.js";
|
|
3
3
|
import { type ButtonProps } from "../Button/Button.js";
|
|
4
|
-
export interface IconButtonProps extends Omit<ButtonProps, "children" | "icon" | "iconEnd" | "fullWidth"> {
|
|
4
|
+
export interface IconButtonProps extends Omit<ButtonProps, "children" | "icon" | "iconEnd" | "fullWidth" | "square"> {
|
|
5
5
|
/** The Facet icon shown in the button. */
|
|
6
6
|
icon: IconData;
|
|
7
7
|
/** Required accessible name, also shown as the tooltip. */
|
|
8
8
|
label: string;
|
|
9
9
|
/** Where the label tooltip appears. */
|
|
10
10
|
tooltipPlacement?: Placement;
|
|
11
|
+
/**
|
|
12
|
+
* The icon points along the reading direction (previous, next, back): it is mirrored in right-to-left text, as
|
|
13
|
+
* Icon's `flipRtl`. Default false.
|
|
14
|
+
*/
|
|
15
|
+
flipRtl?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Any CSS colour for the icon, as Icon's `color` (e.g. a status the button shows for a moment). Default: the
|
|
18
|
+
* button's text colour.
|
|
19
|
+
*/
|
|
20
|
+
iconColor?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Added to the element around the button (the tooltip's anchor, the box the parent lays out), for layout: a grid
|
|
23
|
+
* area, `flex`, margins. `className` goes on the button itself.
|
|
24
|
+
*/
|
|
25
|
+
wrapperClassName?: string | undefined;
|
|
11
26
|
}
|
|
12
27
|
/** A square Button with only an icon. Its label is the accessible name and a Tooltip (no native title). */
|
|
13
28
|
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Icon as
|
|
2
|
+
import { Icon as l } from "../../foundations/Icon/Icon.js";
|
|
3
3
|
import { Button as p } from "../Button/Button.js";
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { forwardRef as
|
|
4
|
+
import { Tooltip as u } from "../Tooltip/Tooltip.js";
|
|
5
|
+
import { forwardRef as s } from "react";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
7
|
+
var z = s(function({ icon: i, label: t, className: r, tooltipPlacement: m = "top", flipRtl: c = !1, iconColor: n, wrapperClassName: a, ...e }, f) {
|
|
8
|
+
return /* @__PURE__ */ o(u, {
|
|
9
9
|
content: t,
|
|
10
10
|
placement: m,
|
|
11
|
+
className: a,
|
|
11
12
|
children: /* @__PURE__ */ o(p, {
|
|
12
|
-
ref:
|
|
13
|
-
...
|
|
13
|
+
ref: f,
|
|
14
|
+
...e,
|
|
15
|
+
square: !0,
|
|
14
16
|
"aria-label": t,
|
|
15
17
|
className: `cy-icon-button${r ? ` ${r}` : ""}`,
|
|
16
|
-
children: /* @__PURE__ */ o(
|
|
18
|
+
children: /* @__PURE__ */ o(l, {
|
|
17
19
|
icon: i,
|
|
18
|
-
size:
|
|
20
|
+
size: e.size === "lg" ? "lg" : "md",
|
|
21
|
+
flipRtl: c,
|
|
22
|
+
...n ? { color: n } : {}
|
|
19
23
|
})
|
|
20
24
|
})
|
|
21
25
|
});
|
|
22
26
|
});
|
|
23
27
|
export {
|
|
24
|
-
|
|
28
|
+
z as IconButton
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","names":["Icon","Button","Tooltip","forwardRef","jsx","IconButton","icon","label","className","tooltipPlacement","rest","ref"],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Placement } from \"../../overlay/position.js\";\nimport { Button, type ButtonProps } from \"../Button/Button.js\";\nimport { Tooltip } from \"../Tooltip/Tooltip.js\";\n\nexport interface IconButtonProps
|
|
1
|
+
{"version":3,"file":"IconButton.js","names":["Icon","Button","Tooltip","forwardRef","jsx","IconButton","icon","label","className","tooltipPlacement","flipRtl","iconColor","wrapperClassName","rest","ref"],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Placement } from \"../../overlay/position.js\";\nimport { Button, type ButtonProps } from \"../Button/Button.js\";\nimport { Tooltip } from \"../Tooltip/Tooltip.js\";\n\nexport interface IconButtonProps\n extends Omit<ButtonProps, \"children\" | \"icon\" | \"iconEnd\" | \"fullWidth\" | \"square\"> {\n /** The Facet icon shown in the button. */\n icon: IconData;\n /** Required accessible name, also shown as the tooltip. */\n label: string;\n /** Where the label tooltip appears. */\n tooltipPlacement?: Placement;\n /**\n * The icon points along the reading direction (previous, next, back): it is mirrored in right-to-left text, as\n * Icon's `flipRtl`. Default false.\n */\n flipRtl?: boolean;\n /**\n * Any CSS colour for the icon, as Icon's `color` (e.g. a status the button shows for a moment). Default: the\n * button's text colour.\n */\n iconColor?: string | undefined;\n /**\n * Added to the element around the button (the tooltip's anchor, the box the parent lays out), for layout: a grid\n * area, `flex`, margins. `className` goes on the button itself.\n */\n wrapperClassName?: string | undefined;\n}\n\n/** A square Button with only an icon. Its label is the accessible name and a Tooltip (no native title). */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { icon, label, className, tooltipPlacement = \"top\", flipRtl = false, iconColor, wrapperClassName, ...rest },\n ref,\n) {\n return (\n <Tooltip content={label} placement={tooltipPlacement} className={wrapperClassName}>\n <Button\n ref={ref}\n {...rest}\n square\n aria-label={label}\n className={`cy-icon-button${className ? ` ${className}` : \"\"}`}\n >\n <Icon\n icon={icon}\n size={rest.size === \"lg\" ? \"lg\" : \"md\"}\n flipRtl={flipRtl}\n {...(iconColor ? { color: iconColor } : {})}\n />\n </Button>\n </Tooltip>\n );\n});\n"],"mappings":";;;;;;AAiCA,IAAaK,IAAaF,EAA+C,SACvE,EAAE,MAAAG,GAAM,OAAAC,GAAO,WAAAC,GAAW,kBAAAC,IAAmB,OAAO,SAAAC,IAAU,IAAO,WAAAC,GAAW,kBAAAC,GAAkB,GAAGC,EAAA,GACrGC,GACA;AACA,SACE,gBAAAV,EAACF,GAAD;AAAA,IAAS,SAASK;AAAA,IAAO,WAAWE;AAAA,IAAkB,WAAWG;AAAA,IAC/D,UAAA,gBAAAR,EAACH,GAAD;AAAA,MACO,KAAAa;AAAA,MACL,GAAID;AAAA,MACJ,QAAA;AAAA,MACA,cAAYN;AAAA,MACZ,WAAW,iBAAiBC,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,MAE1D,UAAA,gBAAAJ,EAACJ,GAAD;AAAA,QACQ,MAAAM;AAAA,QACN,MAAMO,EAAK,SAAS,OAAO,OAAO;AAAA,QACzB,SAAAH;AAAA,QACT,GAAKC,IAAY,EAAE,OAAOA,EAAU,IAAI,CAAC;AAAA,MAC1C,CAAA;AAAA,IACK,CAAA;AAAA,EACD,CAAA;AAEb,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import type { IconData } from "../../icons/types.js";
|
|
3
|
+
import type { Size, Tone } from "../../tokens/schema.js";
|
|
4
|
+
export interface IconTileTokens {
|
|
5
|
+
/** Width and height at `size="sm"` (the small control height). */
|
|
6
|
+
sizeSm: string;
|
|
7
|
+
/** Width and height at `size="md"` (the medium control height). */
|
|
8
|
+
sizeMd: string;
|
|
9
|
+
/** Width and height at `size="lg"` (the large control height). */
|
|
10
|
+
sizeLg: string;
|
|
11
|
+
/** Corner radius of the square shape. Default: the tile's size times the theme's radius factor. */
|
|
12
|
+
radius: string;
|
|
13
|
+
/** Tint strength of the soft variant (percentage of the tone mixed into the surface). */
|
|
14
|
+
softMix: string;
|
|
15
|
+
/** Size of the icon as a fraction of the tile, a number. Default 0.5. */
|
|
16
|
+
iconScale: string;
|
|
17
|
+
}
|
|
18
|
+
declare module "../../tokens/schema.js" {
|
|
19
|
+
interface ComponentTokens {
|
|
20
|
+
iconTile: IconTileTokens;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export interface IconTileProps {
|
|
24
|
+
/** The Facet icon drawn on the tile. */
|
|
25
|
+
icon: IconData;
|
|
26
|
+
/**
|
|
27
|
+
* Accessible name. With it the tile is an image (`role="img"`) named by it; without it the tile is decorative and
|
|
28
|
+
* hidden from assistive technology, for when text beside it says the same thing.
|
|
29
|
+
*/
|
|
30
|
+
label?: string | undefined;
|
|
31
|
+
/** Width and height: the control heights, so they scale with the theme. Default "md". */
|
|
32
|
+
size?: Size;
|
|
33
|
+
/** Semantic colour. Default "accent". */
|
|
34
|
+
tone?: Tone;
|
|
35
|
+
/** `soft` tinted fill, `solid` full tone fill, `outline` a tinted border on the surface. Default "soft". */
|
|
36
|
+
variant?: "soft" | "solid" | "outline";
|
|
37
|
+
/** Outline: a square with rounded corners, or a circle. Default "square". */
|
|
38
|
+
shape?: "square" | "circle";
|
|
39
|
+
/** Added to the root element, for layout. */
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Layout only. Restyle through --cy-icon-tile-* tokens. */
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
/** A Facet icon on a tinted square or circle: a feature's mark, a stat's or a list item's icon. */
|
|
45
|
+
export declare const IconTile: import("react").ForwardRefExoticComponent<IconTileProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon as f } from "../../foundations/Icon/Icon.js";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
5
|
+
var I = s(function({ icon: t, label: a, size: i = "md", tone: o = "accent", variant: n = "soft", shape: c = "square", className: r, style: d }, m) {
|
|
6
|
+
return /* @__PURE__ */ e("span", {
|
|
7
|
+
ref: m,
|
|
8
|
+
className: `cy-icon-tile${r ? ` ${r}` : ""}`,
|
|
9
|
+
...a ? {
|
|
10
|
+
role: "img",
|
|
11
|
+
"aria-label": a
|
|
12
|
+
} : { "aria-hidden": !0 },
|
|
13
|
+
"data-size": i,
|
|
14
|
+
"data-tone": o,
|
|
15
|
+
"data-variant": n,
|
|
16
|
+
"data-shape": c,
|
|
17
|
+
style: d,
|
|
18
|
+
children: /* @__PURE__ */ e(f, { icon: t })
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
I as IconTile
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=IconTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconTile.js","names":["Icon","forwardRef","jsx","IconTile","icon","label","size","tone","variant","shape","className","style","ref"],"sources":["../../../src/components/IconTile/IconTile.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\n\nexport interface IconTileTokens {\n /** Width and height at `size=\"sm\"` (the small control height). */\n sizeSm: string;\n /** Width and height at `size=\"md\"` (the medium control height). */\n sizeMd: string;\n /** Width and height at `size=\"lg\"` (the large control height). */\n sizeLg: string;\n /** Corner radius of the square shape. Default: the tile's size times the theme's radius factor. */\n radius: string;\n /** Tint strength of the soft variant (percentage of the tone mixed into the surface). */\n softMix: string;\n /** Size of the icon as a fraction of the tile, a number. Default 0.5. */\n iconScale: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n iconTile: IconTileTokens;\n }\n}\n\nexport interface IconTileProps {\n /** The Facet icon drawn on the tile. */\n icon: IconData;\n /**\n * Accessible name. With it the tile is an image (`role=\"img\"`) named by it; without it the tile is decorative and\n * hidden from assistive technology, for when text beside it says the same thing.\n */\n label?: string | undefined;\n /** Width and height: the control heights, so they scale with the theme. Default \"md\". */\n size?: Size;\n /** Semantic colour. Default \"accent\". */\n tone?: Tone;\n /** `soft` tinted fill, `solid` full tone fill, `outline` a tinted border on the surface. Default \"soft\". */\n variant?: \"soft\" | \"solid\" | \"outline\";\n /** Outline: a square with rounded corners, or a circle. Default \"square\". */\n shape?: \"square\" | \"circle\";\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-icon-tile-* tokens. */\n style?: CSSProperties;\n}\n\n/** A Facet icon on a tinted square or circle: a feature's mark, a stat's or a list item's icon. */\nexport const IconTile = forwardRef<HTMLSpanElement, IconTileProps>(function IconTile(\n { icon, label, size = \"md\", tone = \"accent\", variant = \"soft\", shape = \"square\", className, style },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={`cy-icon-tile${className ? ` ${className}` : \"\"}`}\n {...(label ? { role: \"img\", \"aria-label\": label } : { \"aria-hidden\": true })}\n data-size={size}\n data-tone={tone}\n data-variant={variant}\n data-shape={shape}\n style={style}\n >\n <Icon icon={icon} />\n </span>\n );\n});\n"],"mappings":";;;;AAiDA,IAAaG,IAAWF,EAA2C,SACjE,EAAE,MAAAG,GAAM,OAAAC,GAAO,MAAAC,IAAO,MAAM,MAAAC,IAAO,UAAU,SAAAC,IAAU,QAAQ,OAAAC,IAAQ,UAAU,WAAAC,GAAW,OAAAC,EAAA,GAC5FC,GACA;AACA,SACE,gBAAAV,EAAC,QAAD;AAAA,IACO,KAAAU;AAAA,IACL,WAAW,eAAeF,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACxD,GAAKL,IAAQ;AAAA,MAAE,MAAM;AAAA,MAAO,cAAcA;AAAA,IAAM,IAAI,EAAE,eAAe,GAAK;AAAA,IAC1E,aAAWC;AAAA,IACX,aAAWC;AAAA,IACX,gBAAcC;AAAA,IACd,cAAYC;AAAA,IACL,OAAAE;AAAA,IAEP,UAAA,gBAAAT,EAACF,GAAD,EAAY,MAAAI,EAAO,CAAA;AAAA,EACf,CAAA;AAEV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconTile, type IconTileProps, type IconTileTokens } from "./IconTile.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","names":["_Fragment","Icon","AspectRatio","useImageOutcome","image","Skeleton","forwardRef","useId","useImperativeHandle","useRef","Fragment$1","jsx","jsxs","Image","src","alt","srcSet","sizes","width","height","ratio","fit","position","radius","loading","placeholder","fallback","caption","onLoad","onError","className","style","ref","captionId","el","key","picture","state","content","event","frame"],"sources":["../../../src/components/Image/Image.tsx"],"sourcesContent":["import {\n type CSSProperties,\n forwardRef,\n type ReactNode,\n type SyntheticEvent,\n useId,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { useImageOutcome } from \"../../foundations/image-outcome.js\";\nimport { image } from \"../../icons/image.js\";\nimport { AspectRatio, type AspectRatioRadius } from \"../AspectRatio/AspectRatio.js\";\nimport { Skeleton } from \"../Skeleton/Skeleton.js\";\n\nexport interface ImageTokens {\n /** Corner radius of every Image, whatever its `radius` prop says. */\n radius: string;\n /** Fill of the box shown when the picture fails to load. */\n fallbackBackground: string;\n /** Icon and text colour of that box. */\n fallbackColor: string;\n /** Space between the picture and its caption. */\n captionGap: string;\n /** Text colour of the caption. */\n captionColor: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n image: ImageTokens;\n }\n}\n\nexport interface ImageProps {\n /** Address of the picture. Changing it loads the new picture, also after a failure. */\n src: string;\n /** What the picture shows, for people who cannot see it. `\"\"` marks it decorative and hides it from them. */\n alt: string;\n /** Candidate files for different screen densities or widths, as on `<img>`. */\n srcSet?: string | undefined;\n /** With `srcSet`: how wide the picture is shown, as on `<img>`. */\n sizes?: string | undefined;\n /** Natural width in pixels. With `height` and no `ratio`, it reserves the picture's space before it loads. */\n width?: number | undefined;\n /** Natural height in pixels. */\n height?: number | undefined;\n /**\n * Width divided by height of the box the picture fills (`16 / 9`, `\"4/3\"`), kept at any width with AspectRatio.\n * Without it the picture has its natural size, no wider than its container.\n */\n ratio?: number | string | undefined;\n /** With `ratio`: `cover` fills the box and crops, `contain` shows the whole picture. Default \"cover\". */\n fit?: \"cover\" | \"contain\";\n /** With `ratio`: which part stays in view when cropped, as CSS `object-position` (`\"top\"`, `\"20% 80%\"`). */\n position?: string | undefined;\n /** Rounds the corners from the radius tokens. Default \"none\". */\n radius?: AspectRatioRadius;\n /** `lazy` waits until the picture is near the screen; `eager` loads it at once. Default \"lazy\". */\n loading?: \"lazy\" | \"eager\";\n /** Shown while the picture loads, in place of the Skeleton. */\n placeholder?: ReactNode;\n /** Shown when the picture fails, in place of the box with an icon and the `alt` text. */\n fallback?: ReactNode;\n /** A caption under the picture: wraps it in a `figure` named by the caption. */\n caption?: ReactNode;\n /** Called when the picture has loaded. */\n onLoad?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;\n /** Called when the picture fails to load. The fallback is shown as well. */\n onError?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;\n /** Added to the root element (the `figure` when there is a caption), for layout. */\n className?: string;\n /** Layout only (width, margin, placement), on the root element. Restyle through --cy-image-* tokens. */\n style?: CSSProperties;\n}\n\n/** A picture that keeps its space while it loads, shows a placeholder until then and a fallback when it fails. */\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(function Image(\n {\n src,\n alt,\n srcSet,\n sizes,\n width,\n height,\n ratio,\n fit = \"cover\",\n position,\n radius = \"none\",\n loading = \"lazy\",\n placeholder,\n fallback,\n caption,\n onLoad,\n onError,\n className,\n style,\n },\n ref,\n) {\n const captionId = useId();\n const el = useRef<HTMLImageElement>(null);\n useImperativeHandle(ref, () => el.current as HTMLImageElement);\n // One outcome per picture: a new `src` starts again from \"loading\", whatever happened to the last one.\n const key = `${src} ${srcSet ?? \"\"}`;\n const picture = useImageOutcome(el, key);\n const state = picture.outcome;\n\n const content = (\n <>\n {state === \"error\" ? (\n <span\n className=\"cy-image-fallback\"\n data-default={fallback === undefined ? \"\" : undefined}\n aria-hidden={fallback === undefined && alt === \"\" ? true : undefined}\n style={\n ratio === undefined && width && height\n ? { inlineSize: width, aspectRatio: `${width} / ${height}` }\n : undefined\n }\n >\n {fallback ?? (\n <>\n <Icon icon={image} />\n {alt && <span className=\"cy-image-alt cy-reset\">{alt}</span>}\n </>\n )}\n </span>\n ) : (\n <img\n // A new element for each picture, so `complete` never describes the one before.\n key={key}\n ref={el}\n className=\"cy-image-img cy-reset\"\n src={src}\n alt={alt}\n srcSet={srcSet}\n sizes={sizes}\n width={width}\n height={height}\n loading={loading}\n decoding=\"async\"\n style={position === undefined ? undefined : { objectPosition: position }}\n onLoad={(event) => {\n picture.loaded();\n onLoad?.(event);\n }}\n onError={(event) => {\n picture.failed();\n onError?.(event);\n }}\n />\n )}\n {state === \"loading\" && (\n <span className=\"cy-image-placeholder cy-reset\">\n {placeholder ?? <Skeleton shape=\"block\" height=\"100%\" />}\n </span>\n )}\n </>\n );\n\n const Frame = ratio === undefined ? \"span\" : \"div\";\n const frame = (\n <Frame\n className={!caption && className ? `cy-image ${className}` : \"cy-image\"}\n data-state={state}\n data-fit={fit}\n data-radius={radius}\n data-ratio={ratio === undefined ? undefined : \"\"}\n style={caption ? undefined : style}\n >\n {ratio === undefined ? content : <AspectRatio ratio={ratio}>{content}</AspectRatio>}\n </Frame>\n );\n if (!caption) return frame;\n return (\n <figure\n className={className ? `cy-image-figure ${className}` : \"cy-image-figure\"}\n aria-labelledby={captionId}\n style={style}\n >\n {frame}\n <figcaption id={captionId} className=\"cy-image-caption\">\n {caption}\n </figcaption>\n </figure>\n );\n});\n"],"mappings":";;;;;;;;AA6EA,IAAaa,IAAQP,EAAyC,SAC5D,EACE,KAAAQ,GACA,KAAAC,GACA,QAAAC,GACA,OAAAC,GACA,OAAAC,GACA,QAAAC,GACA,OAAAC,GACA,KAAAC,IAAM,SACN,UAAAC,GACA,QAAAC,IAAS,QACT,SAAAC,IAAU,QACV,aAAAC,GACA,UAAAC,GACA,SAAAC,GACA,QAAAC,GACA,SAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAY1B,EAAM,GAClB2B,IAAKzB,EAAyB,IAAI;AACxC,EAAAD,EAAoBwB,GAAA,MAAWE,EAAG,OAA2B;
|
|
1
|
+
{"version":3,"file":"Image.js","names":["_Fragment","Icon","AspectRatio","useImageOutcome","image","Skeleton","forwardRef","useId","useImperativeHandle","useRef","Fragment$1","jsx","jsxs","Image","src","alt","srcSet","sizes","width","height","ratio","fit","position","radius","loading","placeholder","fallback","caption","onLoad","onError","className","style","ref","captionId","el","key","picture","state","content","event","frame"],"sources":["../../../src/components/Image/Image.tsx"],"sourcesContent":["import {\n type CSSProperties,\n forwardRef,\n type ReactNode,\n type SyntheticEvent,\n useId,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { useImageOutcome } from \"../../foundations/image-outcome.js\";\nimport { image } from \"../../icons/image.js\";\nimport { AspectRatio, type AspectRatioRadius } from \"../AspectRatio/AspectRatio.js\";\nimport { Skeleton } from \"../Skeleton/Skeleton.js\";\n\nexport interface ImageTokens {\n /** Corner radius of every Image, whatever its `radius` prop says. */\n radius: string;\n /** Fill of the box shown when the picture fails to load. */\n fallbackBackground: string;\n /** Icon and text colour of that box. */\n fallbackColor: string;\n /** Space between the picture and its caption. */\n captionGap: string;\n /** Text colour of the caption. */\n captionColor: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n image: ImageTokens;\n }\n}\n\nexport interface ImageProps {\n /** Address of the picture. Changing it loads the new picture, also after a failure. */\n src: string;\n /** What the picture shows, for people who cannot see it. `\"\"` marks it decorative and hides it from them. */\n alt: string;\n /** Candidate files for different screen densities or widths, as on `<img>`. */\n srcSet?: string | undefined;\n /** With `srcSet`: how wide the picture is shown, as on `<img>`. */\n sizes?: string | undefined;\n /** Natural width in pixels. With `height` and no `ratio`, it reserves the picture's space before it loads. */\n width?: number | undefined;\n /** Natural height in pixels. */\n height?: number | undefined;\n /**\n * Width divided by height of the box the picture fills (`16 / 9`, `\"4/3\"`), kept at any width with AspectRatio.\n * Without it the picture has its natural size, no wider than its container.\n */\n ratio?: number | string | undefined;\n /** With `ratio`: `cover` fills the box and crops, `contain` shows the whole picture. Default \"cover\". */\n fit?: \"cover\" | \"contain\";\n /** With `ratio`: which part stays in view when cropped, as CSS `object-position` (`\"top\"`, `\"20% 80%\"`). */\n position?: string | undefined;\n /** Rounds the corners from the radius tokens. Default \"none\". */\n radius?: AspectRatioRadius;\n /** `lazy` waits until the picture is near the screen; `eager` loads it at once. Default \"lazy\". */\n loading?: \"lazy\" | \"eager\";\n /** Shown while the picture loads, in place of the Skeleton. */\n placeholder?: ReactNode;\n /** Shown when the picture fails, in place of the box with an icon and the `alt` text. */\n fallback?: ReactNode;\n /** A caption under the picture: wraps it in a `figure` named by the caption. */\n caption?: ReactNode;\n /** Called when the picture has loaded. */\n onLoad?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;\n /** Called when the picture fails to load. The fallback is shown as well. */\n onError?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;\n /** Added to the root element (the `figure` when there is a caption), for layout. */\n className?: string;\n /** Layout only (width, margin, placement), on the root element. Restyle through --cy-image-* tokens. */\n style?: CSSProperties;\n}\n\n/** A picture that keeps its space while it loads, shows a placeholder until then and a fallback when it fails. */\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(function Image(\n {\n src,\n alt,\n srcSet,\n sizes,\n width,\n height,\n ratio,\n fit = \"cover\",\n position,\n radius = \"none\",\n loading = \"lazy\",\n placeholder,\n fallback,\n caption,\n onLoad,\n onError,\n className,\n style,\n },\n ref,\n) {\n const captionId = useId();\n const el = useRef<HTMLImageElement>(null);\n useImperativeHandle(ref, () => el.current as HTMLImageElement);\n // One outcome per picture: a new `src` starts again from \"loading\", whatever happened to the last one. Before\n // script runs the state is \"pending\" and the picture shows as the browser has it (pages never hydrated).\n const key = `${src} ${srcSet ?? \"\"}`;\n const picture = useImageOutcome(el, key);\n const state = picture.outcome;\n\n const content = (\n <>\n {state === \"error\" ? (\n <span\n className=\"cy-image-fallback\"\n data-default={fallback === undefined ? \"\" : undefined}\n aria-hidden={fallback === undefined && alt === \"\" ? true : undefined}\n style={\n ratio === undefined && width && height\n ? { inlineSize: width, aspectRatio: `${width} / ${height}` }\n : undefined\n }\n >\n {fallback ?? (\n <>\n <Icon icon={image} />\n {alt && <span className=\"cy-image-alt cy-reset\">{alt}</span>}\n </>\n )}\n </span>\n ) : (\n <img\n // A new element for each picture, so `complete` never describes the one before.\n key={key}\n ref={el}\n className=\"cy-image-img cy-reset\"\n src={src}\n alt={alt}\n srcSet={srcSet}\n sizes={sizes}\n width={width}\n height={height}\n loading={loading}\n decoding=\"async\"\n style={position === undefined ? undefined : { objectPosition: position }}\n onLoad={(event) => {\n picture.loaded();\n onLoad?.(event);\n }}\n onError={(event) => {\n picture.failed();\n onError?.(event);\n }}\n />\n )}\n {state === \"loading\" && (\n <span className=\"cy-image-placeholder cy-reset\">\n {placeholder ?? <Skeleton shape=\"block\" height=\"100%\" />}\n </span>\n )}\n </>\n );\n\n const Frame = ratio === undefined ? \"span\" : \"div\";\n const frame = (\n <Frame\n className={!caption && className ? `cy-image ${className}` : \"cy-image\"}\n data-state={state}\n data-fit={fit}\n data-radius={radius}\n data-ratio={ratio === undefined ? undefined : \"\"}\n style={caption ? undefined : style}\n >\n {ratio === undefined ? content : <AspectRatio ratio={ratio}>{content}</AspectRatio>}\n </Frame>\n );\n if (!caption) return frame;\n return (\n <figure\n className={className ? `cy-image-figure ${className}` : \"cy-image-figure\"}\n aria-labelledby={captionId}\n style={style}\n >\n {frame}\n <figcaption id={captionId} className=\"cy-image-caption\">\n {caption}\n </figcaption>\n </figure>\n );\n});\n"],"mappings":";;;;;;;;AA6EA,IAAaa,IAAQP,EAAyC,SAC5D,EACE,KAAAQ,GACA,KAAAC,GACA,QAAAC,GACA,OAAAC,GACA,OAAAC,GACA,QAAAC,GACA,OAAAC,GACA,KAAAC,IAAM,SACN,UAAAC,GACA,QAAAC,IAAS,QACT,SAAAC,IAAU,QACV,aAAAC,GACA,UAAAC,GACA,SAAAC,GACA,QAAAC,GACA,SAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAY1B,EAAM,GAClB2B,IAAKzB,EAAyB,IAAI;AACxC,EAAAD,EAAoBwB,GAAA,MAAWE,EAAG,OAA2B;AAG7D,QAAMC,IAAM,GAAGrB,CAAA,IAAOE,KAAU,EAAA,IAC1BoB,IAAUjC,EAAgB+B,GAAIC,CAAG,GACjCE,IAAQD,EAAQ,SAEhBE,IACJ,gBAAA1B,EAAAZ,GAAA,EAAA,UAAA,CACGqC,MAAU,UACT,gBAAA1B,EAAC,QAAD;AAAA,IACE,WAAU;AAAA,IACV,gBAAce,MAAa,SAAY,KAAK;AAAA,IAC5C,eAAaA,MAAa,UAAaX,MAAQ,KAAK,KAAO;AAAA,IAC3D,OACEK,MAAU,UAAaF,KAASC,IAC5B;AAAA,MAAE,YAAYD;AAAA,MAAO,aAAa,GAAGA,CAAA,MAAWC,CAAA;AAAA,IAAS,IACzD;AAAA,IAGL,UAAAO,KACC,gBAAAd,EAAAZ,GAAA,EAAA,UAAA,CACE,gBAAAW,EAACV,GAAD,EAAM,MAAMG,EAAQ,CAAA,GACnBW,KAAO,gBAAAJ,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,MAAyB,UAAAI;AAAA,IAAU,CAAA,CAC3D,EAAA,CAAA;AAAA,EAEA,CAAA,IAEN,gBAAAJ,EAAC,OAAD;AAAA,IAGE,KAAKuB;AAAA,IACL,WAAU;AAAA,IACL,KAAApB;AAAA,IACA,KAAAC;AAAA,IACG,QAAAC;AAAA,IACD,OAAAC;AAAA,IACA,OAAAC;AAAA,IACC,QAAAC;AAAA,IACC,SAAAK;AAAA,IACT,UAAS;AAAA,IACT,OAAOF,MAAa,SAAY,SAAY,EAAE,gBAAgBA,EAAS;AAAA,IACvE,QAAA,CAASiB,MAAU;AACjB,MAAAH,EAAQ,OAAO,GACfR,IAASW,CAAK;AAAA,IAChB;AAAA,IACA,SAAA,CAAUA,MAAU;AAClB,MAAAH,EAAQ,OAAO,GACfP,IAAUU,CAAK;AAAA,IACjB;AAAA,EACD,GApBMJ,CAoBN,GAEFE,MAAU,aACT,gBAAA1B,EAAC,QAAD;AAAA,IAAM,WAAU;AAAA,IACb,UAAAc,KAAe,gBAAAd,EAACN,GAAD;AAAA,MAAU,OAAM;AAAA,MAAQ,QAAO;AAAA,IAAQ,CAAA;AAAA,EACnD,CAAA,CAER,EAAA,CAAA,GAIEmC,IACJ,gBAAA7B,EAFYS,MAAU,SAAY,SAAS,OAE3C;AAAA,IACE,WAAW,CAACO,KAAWG,IAAY,YAAYA,CAAA,KAAc;AAAA,IAC7D,cAAYO;AAAA,IACZ,YAAUhB;AAAA,IACV,eAAaE;AAAA,IACb,cAAYH,MAAU,SAAY,SAAY;AAAA,IAC9C,OAAOO,IAAU,SAAYI;AAAA,IAE5B,UAAAX,MAAU,SAAYkB,IAAU,gBAAA3B,EAACT,GAAD;AAAA,MAAoB,OAAAkB;AAAA,MAAQ,UAAAkB;AAAA,IAAqB,CAAA;AAAA,EAC7E,CAAA;AAET,SAAKX,IAEH,gBAAAf,EAAC,UAAD;AAAA,IACE,WAAWkB,IAAY,mBAAmBA,CAAA,KAAc;AAAA,IACxD,mBAAiBG;AAAA,IACV,OAAAF;AAAA,IAHT,UAAA,CAKGS,GACD,gBAAA7B,EAAC,cAAD;AAAA,MAAY,IAAIsB;AAAA,MAAW,WAAU;AAAA,MAClC,UAAAN;AAAA,IACS,CAAA,CACN;AAAA,E,KAXWa;AAavB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
export interface InlineProps extends PaddingProps {
|
|
2
|
+
import type { LayoutAttributes, PaddingProps, Space, VisibilityProps } from "../Stack/space.js";
|
|
3
|
+
export interface InlineProps extends PaddingProps, VisibilityProps, LayoutAttributes {
|
|
4
4
|
/** Space token between children. */
|
|
5
5
|
gap?: Space;
|
|
6
6
|
/** Cross-axis alignment of children. They are centred when it is not set. */
|
|
@@ -20,5 +20,5 @@ export interface InlineProps extends PaddingProps {
|
|
|
20
20
|
/** Set on the root element, for tests. */
|
|
21
21
|
"data-testid"?: string;
|
|
22
22
|
}
|
|
23
|
-
/** Horizontal layout with token gaps. */
|
|
23
|
+
/** Horizontal layout with token gaps: a Stack in a row, its children centred unless `align` says otherwise. */
|
|
24
24
|
export declare const Inline: import("react").ForwardRefExoticComponent<InlineProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
ref:
|
|
8
|
-
...
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"data-wrap":
|
|
13
|
-
style: {
|
|
14
|
-
"--_gap": u(i),
|
|
15
|
-
...c({
|
|
16
|
-
padding: r,
|
|
17
|
-
paddingInline: n,
|
|
18
|
-
paddingBlock: t
|
|
19
|
-
}),
|
|
20
|
-
...p
|
|
21
|
-
},
|
|
22
|
-
children: l
|
|
2
|
+
import { Stack as t } from "../Stack/Stack.js";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
5
|
+
var d = a(function({ gap: i = "3", wrap: o = !1, className: r, ...n }, e) {
|
|
6
|
+
return /* @__PURE__ */ f(t, {
|
|
7
|
+
ref: e,
|
|
8
|
+
...n,
|
|
9
|
+
gap: i,
|
|
10
|
+
direction: "row",
|
|
11
|
+
className: `cy-inline${r ? ` ${r}` : ""}`,
|
|
12
|
+
"data-wrap": o ? "" : void 0
|
|
23
13
|
});
|
|
24
14
|
});
|
|
25
15
|
export {
|
|
26
|
-
|
|
16
|
+
d as Inline
|
|
27
17
|
};
|
|
28
18
|
|
|
29
19
|
//# sourceMappingURL=Inline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.js","names":["
|
|
1
|
+
{"version":3,"file":"Inline.js","names":["Stack","forwardRef","jsx","Inline","gap","wrap","className","rest","ref"],"sources":["../../../src/components/Inline/Inline.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\nimport { Stack } from \"../Stack/Stack.js\";\nimport type { LayoutAttributes, PaddingProps, Space, VisibilityProps } from \"../Stack/space.js\";\n\nexport interface InlineProps extends PaddingProps, VisibilityProps, LayoutAttributes {\n /** Space token between children. */\n gap?: Space;\n /** Cross-axis alignment of children. They are centred when it is not set. */\n align?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\n /** How children are spread along the row. */\n justify?: \"start\" | \"center\" | \"end\" | \"between\";\n /** Wrap onto new lines when space runs out. */\n wrap?: boolean;\n /** Neutral layout element to render (never an interactive one). */\n as?: \"div\" | \"section\" | \"ul\" | \"ol\" | \"nav\" | \"aside\" | \"header\" | \"footer\" | \"span\";\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n /** The elements to lay out in a row. */\n children?: ReactNode;\n /** Set on the root element, for tests. */\n \"data-testid\"?: string;\n}\n\n/** Horizontal layout with token gaps: a Stack in a row, its children centred unless `align` says otherwise. */\nexport const Inline = forwardRef<HTMLElement, InlineProps>(function Inline(\n { gap = \"3\", wrap = false, className, ...rest },\n ref,\n) {\n return (\n <Stack\n ref={ref}\n {...rest}\n gap={gap}\n direction=\"row\"\n className={`cy-inline${className ? ` ${className}` : \"\"}`}\n data-wrap={wrap ? \"\" : undefined}\n />\n );\n});\n"],"mappings":";;;;AA0BA,IAAaG,IAASF,EAAqC,SACzD,EAAE,KAAAG,IAAM,KAAK,MAAAC,IAAO,IAAO,WAAAC,GAAW,GAAGC,EAAA,GACzCC,GACA;AACA,SACE,gBAAAN,EAACF,GAAD;AAAA,IACO,KAAAQ;AAAA,IACL,GAAID;AAAA,IACC,KAAAH;AAAA,IACL,WAAU;AAAA,IACV,WAAW,YAAYE,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACrD,aAAWD,IAAO,KAAK;AAAA,EACxB,CAAA;AAEL,CAAC"}
|
|
@@ -10,11 +10,11 @@ import { trash as O } from "../../icons/trash.js";
|
|
|
10
10
|
import { SortableList as P } from "../SortableList/SortableList.js";
|
|
11
11
|
import { TextField as b } from "../TextField/TextField.js";
|
|
12
12
|
import { FileInputBase as _ } from "../../foundations/FileInputBase/FileInputBase.js";
|
|
13
|
-
import { paperclip as
|
|
13
|
+
import { paperclip as N } from "../../icons/paperclip.js";
|
|
14
14
|
import { TextArea as G } from "../TextArea/TextArea.js";
|
|
15
15
|
import { fromBulkText as J, newPairId as Q, pairName as W, toBulkText as X } from "./bulk.js";
|
|
16
16
|
import { useRef as f, useState as Y } from "react";
|
|
17
|
-
import { jsx as
|
|
17
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
18
18
|
var Z = {
|
|
19
19
|
key: "Key",
|
|
20
20
|
value: "Value",
|
|
@@ -27,14 +27,14 @@ var Z = {
|
|
|
27
27
|
bulk: "Edit as text",
|
|
28
28
|
bulkField: (l) => `${l} as text: one key: value per line, # turns a line off`
|
|
29
29
|
};
|
|
30
|
-
function ye({ label: l, pairs:
|
|
30
|
+
function ye({ label: l, pairs: B, defaultPairs: R = [], onChange: A, toggleable: E = !0, bulkEdit: F = !0, allowFiles: $ = !1, accept: I, disabled: o = !1, size: a = "md", labels: L, className: C, style: T }) {
|
|
31
31
|
const r = {
|
|
32
32
|
...Z,
|
|
33
33
|
...L
|
|
34
|
-
}, [c, d] = q(
|
|
34
|
+
}, [c, d] = q(B, R, A), [s, g] = Y(null), S = f(/* @__PURE__ */ new Set()), h = f(null), v = f(null), k = f(null), y = f(null);
|
|
35
35
|
U(() => {
|
|
36
36
|
const e = v.current;
|
|
37
|
-
e !== null && (v.current = null, (e ?
|
|
37
|
+
e !== null && (v.current = null, (e ? h.current?.querySelector(`[data-pair="${CSS.escape(e)}"] .cy-text-field-input`) : h.current?.querySelector(".cy-key-value-editor-add"))?.focus());
|
|
38
38
|
});
|
|
39
39
|
const m = (e, u) => d(c.map((t) => t.id === e ? {
|
|
40
40
|
...t,
|
|
@@ -59,69 +59,70 @@ function ye({ label: l, pairs: N, defaultPairs: R = [], onChange: A, toggleable:
|
|
|
59
59
|
"data-pair": e.id,
|
|
60
60
|
"data-off": e.enabled === !1 ? "" : void 0,
|
|
61
61
|
children: [
|
|
62
|
-
E && /* @__PURE__ */
|
|
63
|
-
label: /* @__PURE__ */
|
|
62
|
+
E && /* @__PURE__ */ n(D, {
|
|
63
|
+
label: /* @__PURE__ */ n("span", {
|
|
64
64
|
className: "cy-visually-hidden",
|
|
65
65
|
children: r.enable(t)
|
|
66
66
|
}),
|
|
67
|
+
className: "cy-key-value-editor-check",
|
|
67
68
|
checked: e.enabled !== !1,
|
|
68
|
-
disabled:
|
|
69
|
+
disabled: o,
|
|
69
70
|
size: a,
|
|
70
71
|
onChange: (i) => m(e.id, { enabled: i })
|
|
71
72
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ n(b, {
|
|
73
74
|
label: `${r.key} (${t})`,
|
|
74
75
|
labelHidden: !0,
|
|
75
76
|
placeholder: r.key,
|
|
76
77
|
value: e.key,
|
|
77
|
-
disabled:
|
|
78
|
+
disabled: o,
|
|
78
79
|
size: a,
|
|
79
80
|
onChange: (i) => m(e.id, { key: i })
|
|
80
81
|
}),
|
|
81
|
-
e.file ? /* @__PURE__ */
|
|
82
|
+
e.file ? /* @__PURE__ */ n(b, {
|
|
82
83
|
label: `${r.value} (${t})`,
|
|
83
84
|
labelHidden: !0,
|
|
84
85
|
readOnly: !0,
|
|
85
|
-
iconStart:
|
|
86
|
+
iconStart: N,
|
|
86
87
|
value: e.file.name,
|
|
87
|
-
disabled:
|
|
88
|
+
disabled: o,
|
|
88
89
|
size: a
|
|
89
|
-
}) : /* @__PURE__ */
|
|
90
|
+
}) : /* @__PURE__ */ n(b, {
|
|
90
91
|
label: `${r.value} (${t})`,
|
|
91
92
|
labelHidden: !0,
|
|
92
93
|
placeholder: r.value,
|
|
93
94
|
type: e.secret ? "password" : "text",
|
|
94
95
|
value: e.value,
|
|
95
|
-
disabled:
|
|
96
|
+
disabled: o,
|
|
96
97
|
size: a,
|
|
97
98
|
onChange: (i) => m(e.id, { value: i })
|
|
98
99
|
}),
|
|
99
|
-
$ && (e.file ? /* @__PURE__ */
|
|
100
|
+
$ && (e.file ? /* @__PURE__ */ n(p, {
|
|
100
101
|
icon: V,
|
|
101
102
|
label: r.detach(t),
|
|
102
103
|
variant: "ghost",
|
|
103
104
|
size: a,
|
|
104
|
-
disabled:
|
|
105
|
+
disabled: o,
|
|
105
106
|
onClick: () => m(e.id, {
|
|
106
107
|
file: void 0,
|
|
107
108
|
value: ""
|
|
108
109
|
})
|
|
109
|
-
}) : /* @__PURE__ */
|
|
110
|
-
icon:
|
|
110
|
+
}) : /* @__PURE__ */ n(p, {
|
|
111
|
+
icon: N,
|
|
111
112
|
label: r.attach(t),
|
|
112
113
|
variant: "ghost",
|
|
113
114
|
size: a,
|
|
114
|
-
disabled:
|
|
115
|
+
disabled: o,
|
|
115
116
|
onClick: () => {
|
|
116
|
-
|
|
117
|
+
k.current = e.id, y.current?.click();
|
|
117
118
|
}
|
|
118
119
|
})),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ n(p, {
|
|
120
121
|
icon: O,
|
|
121
122
|
label: r.remove(t),
|
|
122
123
|
variant: "ghost",
|
|
123
124
|
size: a,
|
|
124
|
-
disabled:
|
|
125
|
+
disabled: o,
|
|
125
126
|
onClick: () => K(e.id)
|
|
126
127
|
})
|
|
127
128
|
]
|
|
@@ -129,36 +130,36 @@ function ye({ label: l, pairs: N, defaultPairs: R = [], onChange: A, toggleable:
|
|
|
129
130
|
};
|
|
130
131
|
});
|
|
131
132
|
return /* @__PURE__ */ x("div", {
|
|
132
|
-
ref:
|
|
133
|
+
ref: h,
|
|
133
134
|
className: C ? `cy-key-value-editor ${C}` : "cy-key-value-editor",
|
|
134
135
|
"data-size": a,
|
|
135
136
|
style: T,
|
|
136
137
|
children: [
|
|
137
|
-
s === null ? c.length > 0 && /* @__PURE__ */
|
|
138
|
+
s === null ? c.length > 0 && /* @__PURE__ */ n(P, {
|
|
138
139
|
label: l,
|
|
139
140
|
items: j,
|
|
140
141
|
onReorder: (e) => d(e.map((u) => c.find((t) => t.id === u.id))),
|
|
141
|
-
disabled:
|
|
142
|
+
disabled: o,
|
|
142
143
|
size: a
|
|
143
|
-
}) : /* @__PURE__ */
|
|
144
|
+
}) : /* @__PURE__ */ n(G, {
|
|
144
145
|
label: r.bulkField(l),
|
|
145
146
|
labelHidden: !0,
|
|
146
147
|
value: s,
|
|
147
148
|
rows: Math.max(4, c.length + 1),
|
|
148
|
-
disabled:
|
|
149
|
+
disabled: o,
|
|
149
150
|
onChange: (e) => {
|
|
150
151
|
g(e), d(J(e, c, S.current));
|
|
151
152
|
}
|
|
152
153
|
}),
|
|
153
|
-
$ && /* @__PURE__ */
|
|
154
|
+
$ && /* @__PURE__ */ n(_, {
|
|
154
155
|
ref: y,
|
|
155
|
-
className: "cy-
|
|
156
|
+
className: "cy-visually-hidden",
|
|
156
157
|
tabIndex: -1,
|
|
157
158
|
"aria-hidden": "true",
|
|
158
159
|
accept: I,
|
|
159
160
|
onFiles: ([e]) => {
|
|
160
|
-
const u =
|
|
161
|
-
|
|
161
|
+
const u = k.current;
|
|
162
|
+
k.current = null, u && e && m(u, {
|
|
162
163
|
file: e,
|
|
163
164
|
value: e.name,
|
|
164
165
|
secret: !1
|
|
@@ -167,19 +168,19 @@ function ye({ label: l, pairs: N, defaultPairs: R = [], onChange: A, toggleable:
|
|
|
167
168
|
}),
|
|
168
169
|
/* @__PURE__ */ x("div", {
|
|
169
170
|
className: "cy-key-value-editor-actions cy-reset",
|
|
170
|
-
children: [s === null && /* @__PURE__ */
|
|
171
|
+
children: [s === null && /* @__PURE__ */ n(w, {
|
|
171
172
|
icon: M,
|
|
172
173
|
variant: "ghost",
|
|
173
174
|
size: a,
|
|
174
|
-
disabled:
|
|
175
|
+
disabled: o,
|
|
175
176
|
className: "cy-key-value-editor-add",
|
|
176
177
|
onClick: H,
|
|
177
178
|
children: r.add
|
|
178
|
-
}), F && /* @__PURE__ */
|
|
179
|
+
}), F && /* @__PURE__ */ n(w, {
|
|
179
180
|
variant: "ghost",
|
|
180
181
|
size: a,
|
|
181
182
|
pressed: s !== null,
|
|
182
|
-
disabled:
|
|
183
|
+
disabled: o,
|
|
183
184
|
onClick: () => {
|
|
184
185
|
S.current = new Set(c.filter((e) => e.secret).map((e) => e.key)), g(s === null ? X(c) : null);
|
|
185
186
|
},
|