@clickhouse/click-ui 0.10.0 → 0.11.0-rc1
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/dist/cjs/click-ui.css +67 -10
- package/dist/cjs/components/CodeBlock/CodeBlock.css +35 -2
- package/dist/cjs/components/CodeBlock/index.cjs +27 -22
- package/dist/cjs/components/CodeBlock/index.cjs.map +1 -1
- package/dist/cjs/components/DateDetails/index.cjs +8 -5
- package/dist/cjs/components/DateDetails/index.cjs.map +1 -1
- package/dist/cjs/components/Dropdown/index.cjs +4 -1
- package/dist/cjs/components/Dropdown/index.cjs.map +1 -1
- package/dist/cjs/components/EllipsisContent/index.cjs +3 -2
- package/dist/cjs/components/EllipsisContent/index.cjs.map +1 -1
- package/dist/cjs/components/IconButton/IconButton.css +5 -0
- package/dist/cjs/components/IconButton/index.cjs +12 -2
- package/dist/cjs/components/IconButton/index.cjs.map +1 -1
- package/dist/cjs/components/IconWrapper/index.cjs +6 -5
- package/dist/cjs/components/IconWrapper/index.cjs.map +1 -1
- package/dist/cjs/components/Link/Link.css +0 -1
- package/dist/cjs/components/Link/index.cjs.map +1 -1
- package/dist/cjs/components/Pagination/index.cjs +3 -3
- package/dist/cjs/components/Pagination/index.cjs.map +1 -1
- package/dist/cjs/components/Popover/Popover.css +7 -6
- package/dist/cjs/components/Popover/index.cjs +12 -10
- package/dist/cjs/components/Popover/index.cjs.map +1 -1
- package/dist/cjs/components/ProgressBar/index.cjs +6 -3
- package/dist/cjs/components/ProgressBar/index.cjs.map +1 -1
- package/dist/cjs/components/Text/Text.css +20 -0
- package/dist/cjs/components/Text/Text.module.css.cjs +8 -0
- package/dist/cjs/components/Text/Text.module.css.cjs.map +1 -1
- package/dist/cjs/components/Text/index.cjs +11 -1
- package/dist/cjs/components/Text/index.cjs.map +1 -1
- package/dist/cjs/components/Toast/index.cjs +7 -1
- package/dist/cjs/components/Toast/index.cjs.map +1 -1
- package/dist/esm/click-ui.css +67 -10
- package/dist/esm/components/CodeBlock/CodeBlock.css +35 -2
- package/dist/esm/components/CodeBlock/index.js +27 -22
- package/dist/esm/components/CodeBlock/index.js.map +1 -1
- package/dist/esm/components/DateDetails/index.js +8 -5
- package/dist/esm/components/DateDetails/index.js.map +1 -1
- package/dist/esm/components/Dropdown/index.js +4 -1
- package/dist/esm/components/Dropdown/index.js.map +1 -1
- package/dist/esm/components/EllipsisContent/index.js +3 -2
- package/dist/esm/components/EllipsisContent/index.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.css +5 -0
- package/dist/esm/components/IconButton/index.js +12 -2
- package/dist/esm/components/IconButton/index.js.map +1 -1
- package/dist/esm/components/IconWrapper/index.js +6 -5
- package/dist/esm/components/IconWrapper/index.js.map +1 -1
- package/dist/esm/components/Link/Link.css +0 -1
- package/dist/esm/components/Link/index.js.map +1 -1
- package/dist/esm/components/Pagination/index.js +3 -3
- package/dist/esm/components/Pagination/index.js.map +1 -1
- package/dist/esm/components/Popover/Popover.css +7 -6
- package/dist/esm/components/Popover/index.js +12 -10
- package/dist/esm/components/Popover/index.js.map +1 -1
- package/dist/esm/components/ProgressBar/index.js +6 -3
- package/dist/esm/components/ProgressBar/index.js.map +1 -1
- package/dist/esm/components/Text/Text.css +20 -0
- package/dist/esm/components/Text/Text.module.css.js +7 -1
- package/dist/esm/components/Text/Text.module.css.js.map +1 -1
- package/dist/esm/components/Text/index.js +11 -1
- package/dist/esm/components/Text/index.js.map +1 -1
- package/dist/esm/components/Toast/index.js +7 -1
- package/dist/esm/components/Toast/index.js.map +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.types.d.ts +8 -0
- package/dist/types/components/Dropdown/Dropdown.d.ts +13 -16
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +10 -0
- package/dist/types/components/EllipsisContent/EllipsisContent.d.ts +1 -3
- package/dist/types/components/EllipsisContent/EllipsisContent.types.d.ts +6 -0
- package/dist/types/components/IconWrapper/IconWrapper.d.ts +1 -1
- package/dist/types/components/IconWrapper/IconWrapper.types.d.ts +3 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/types/components/Text/Text.d.ts +3 -0
- package/dist/types/components/Tooltip/index.d.ts +1 -1
- package/dist/types/index.d.ts +3 -1
- package/package.json +17 -19
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
@layer clickui {
|
|
1
|
+
@layer clickui {/* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. iconButton) */
|
|
2
|
+
|
|
3
|
+
.menu-panel__-IeVm {
|
|
2
4
|
display: block;
|
|
3
5
|
padding: var(--click-popover-space-y) var(--click-popover-space-x);
|
|
4
6
|
border: 1px solid var(--click-popover-color-panel-stroke-default);
|
|
@@ -23,11 +25,10 @@
|
|
|
23
25
|
cursor: pointer;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
.close-button__fpjhc {
|
|
28
|
+
.menu-panel__-IeVm .close-button__fpjhc {
|
|
29
|
+
/* Offset by the button's own padding so the cross sits at the panel inset */
|
|
27
30
|
position: absolute;
|
|
28
|
-
top: var(--click-popover-space-y);
|
|
29
|
-
right: var(--click-popover-space-x);
|
|
30
|
-
width: var(--click-popover-icon-size-width);
|
|
31
|
-
height: var(--click-popover-icon-size-height);
|
|
31
|
+
top: calc(var(--click-popover-space-y) - var(--click-button-iconButton-sm-space-y));
|
|
32
|
+
right: calc(var(--click-popover-space-x) - var(--click-button-iconButton-sm-space-x));
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -7,7 +7,7 @@ import { cn } from '../../lib/cva.js';
|
|
|
7
7
|
import Popover_Arrow from '../Assets/Icons/Popover-Arrow.js';
|
|
8
8
|
import { useResolvedPortalContainer } from '../../providers/PortalContext.js';
|
|
9
9
|
import styles from './Popover.module.css.js';
|
|
10
|
-
import {
|
|
10
|
+
import { IconButton } from '../IconButton/index.js';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
12
12
|
|
|
13
13
|
const Popover = ({ children, ...props }) => {
|
|
@@ -76,14 +76,6 @@ const PopoverContent = ({
|
|
|
76
76
|
sideOffset: 4,
|
|
77
77
|
...props,
|
|
78
78
|
children: [
|
|
79
|
-
showClose && /* @__PURE__ */ jsx(
|
|
80
|
-
RadixPopover.Close,
|
|
81
|
-
{
|
|
82
|
-
asChild: true,
|
|
83
|
-
className: styles["close-button"],
|
|
84
|
-
children: /* @__PURE__ */ jsx(SvgImage, { name: "cross" })
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
79
|
showArrow && /* @__PURE__ */ jsx(
|
|
88
80
|
Arrow,
|
|
89
81
|
{
|
|
@@ -94,7 +86,17 @@ const PopoverContent = ({
|
|
|
94
86
|
children: /* @__PURE__ */ jsx(Popover_Arrow, {})
|
|
95
87
|
}
|
|
96
88
|
),
|
|
97
|
-
children
|
|
89
|
+
children,
|
|
90
|
+
showClose && /* @__PURE__ */ jsx(RadixPopover.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
91
|
+
IconButton,
|
|
92
|
+
{
|
|
93
|
+
className: styles["close-button"],
|
|
94
|
+
icon: "cross",
|
|
95
|
+
type: "ghost",
|
|
96
|
+
size: "sm",
|
|
97
|
+
"aria-label": "Close"
|
|
98
|
+
}
|
|
99
|
+
) })
|
|
98
100
|
]
|
|
99
101
|
}
|
|
100
102
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as RadixPopover from '@radix-ui/react-popover';\nimport { Arrow, GenericMenuPanel } from '@/components/GenericMenu';\nimport {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as RadixPopover from '@radix-ui/react-popover';\nimport { Arrow, GenericMenuPanel } from '@/components/GenericMenu';\nimport {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport { IconButton } from '@/components/IconButton';\nimport Popover_Arrow from '@/components/Assets/Icons/Popover-Arrow';\nimport { useResolvedPortalContainer } from '@/providers/PortalContext';\nimport styles from './Popover.module.css';\n\nexport const Popover = ({ children, ...props }: RadixPopover.PopoverProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\n\ninterface TriggerProps extends RadixPopover.PopoverTriggerProps {\n anchor?: ReactNode;\n}\n\nconst PopoverTrigger = ({ anchor, children, ...props }: TriggerProps) => {\n return (\n <>\n <RadixPopover.Trigger\n asChild\n {...props}\n >\n <div className={styles.trigger}>{children}</div>\n </RadixPopover.Trigger>\n {anchor && <RadixPopover.Anchor asChild>{anchor}</RadixPopover.Anchor>}\n </>\n );\n};\nPopoverTrigger.displayName = 'PopoverTrigger';\nPopover.Trigger = PopoverTrigger;\n\ninterface PopoverContentProps extends RadixPopover.PopoverContentProps {\n /** Whether to show an arrow pointing to the trigger element */\n showArrow?: boolean;\n /** Whether to show a close button in the popover */\n showClose?: boolean;\n /** Forces the popover to mount in the DOM even when closed */\n forceMount?: true;\n /** Custom container element for the popover portal */\n container?: HTMLElement | null;\n}\n\nconst menuPanelVariants = cva(styles['menu-panel'], {\n variants: {\n showClose: {\n true: styles['menu-panel_show-close'],\n false: '',\n },\n },\n defaultVariants: {\n showClose: false,\n },\n});\n\ntype MenuPanelComponent = <T extends ElementType = 'div'>(\n props: ComponentProps<typeof GenericMenuPanel<T>> & { showClose?: boolean }\n) => ReactNode;\n\nconst _MenuPanel = <T extends ElementType = 'div'>(\n {\n showClose,\n className,\n ...props\n }: ComponentProps<typeof GenericMenuPanel<T>> & { showClose?: boolean },\n ref: ComponentPropsWithRef<T>['ref']\n) => (\n <GenericMenuPanel\n ref={ref}\n {...(props as ComponentProps<typeof GenericMenuPanel>)}\n className={cn(menuPanelVariants({ showClose }), className)}\n />\n);\n\nconst MenuPanel: MenuPanelComponent = forwardRef(_MenuPanel);\n\nconst PopoverContent = ({\n children,\n showArrow,\n showClose,\n forceMount,\n container,\n ...props\n}: PopoverContentProps) => {\n const portalContainer = useResolvedPortalContainer(container);\n\n return (\n <RadixPopover.Portal\n forceMount={forceMount}\n container={portalContainer}\n >\n <MenuPanel\n as={RadixPopover.Content}\n type=\"popover\"\n showClose={showClose}\n showArrow={showArrow}\n sideOffset={4}\n {...props}\n >\n {showArrow && (\n <Arrow\n asChild\n as={RadixPopover.Arrow}\n width={20}\n height={10}\n >\n <Popover_Arrow />\n </Arrow>\n )}\n {children}\n {/* Rendered last so it takes focus after the panel's interactive elements */}\n {showClose && (\n <RadixPopover.Close asChild>\n <IconButton\n className={styles['close-button']}\n icon=\"cross\"\n type=\"ghost\"\n size=\"sm\"\n aria-label=\"Close\"\n />\n </RadixPopover.Close>\n )}\n </MenuPanel>\n </RadixPopover.Portal>\n );\n};\nPopoverContent.displayName = 'PopoverContent';\nPopover.Content = PopoverContent;\n"],"names":[],"mappings":";;;;;;;;;;;AAeO,MAAM,UAAU,CAAC,EAAE,QAAA,EAAU,GAAG,OAAM,KAAiC;AAC5E,EAAA,2BAAQ,YAAA,CAAa,IAAA,EAAb,EAAmB,GAAG,OAAQ,QAAA,EAAS,CAAA;AACjD;AAMA,MAAM,iBAAiB,CAAC,EAAE,QAAQ,QAAA,EAAU,GAAG,OAAM,KAAoB;AACvE,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,YAAA,CAAa,OAAA;AAAA,MAAb;AAAA,QACC,OAAA,EAAO,IAAA;AAAA,QACN,GAAG,KAAA;AAAA,QAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SAAU,QAAA,EAAS;AAAA;AAAA,KAC5C;AAAA,IACC,0BAAU,GA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AAA,UACA,SAAA;AAAA,UACA,UAAA,EAAY,CAAA;AAAA,UACX,GAAG,KAAA;AAAA,UAEH,QAAA,EAAA;AAAA,YAAA,SAAA,oBACC,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAO,IAAA;AAAA,gBACP,IAAI,YAAA,CAAa,KAAA;AAAA,gBACjB,KAAA,EAAO,EAAA;AAAA,gBACP,MAAA,EAAQ,EAAA;AAAA,gBAER,8BAAC,aAAA,EAAA,EAAc;AAAA;AAAA,aACjB;AAAA,YAED,QAAA;AAAA,YAEA,6BACC,GAAA,CAAC,YAAA,CAAa,KAAA,EAAb,EAAmB,SAAO,IAAA,EACzB,QAAA,kBAAA,GAAA;AAAA,cAAC,UAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,OAAO,cAAc,CAAA;AAAA,gBAChC,IAAA,EAAK,OAAA;AAAA,gBACL,IAAA,EAAK,OAAA;AAAA,gBACL,IAAA,EAAK,IAAA;AAAA,gBACL,YAAA,EAAW;AAAA;AAAA,aACb,EACF;AAAA;AAAA;AAAA;AAEJ;AAAA,GACF;AAEJ,CAAA;AACA,cAAA,CAAe,WAAA,GAAc,gBAAA;AAC7B,OAAA,CAAQ,OAAA,GAAU,cAAA;;;;"}
|
|
@@ -45,15 +45,18 @@ const ProgressBar = ({
|
|
|
45
45
|
orientation = "horizontal",
|
|
46
46
|
dir = "start",
|
|
47
47
|
className,
|
|
48
|
+
style,
|
|
48
49
|
...props
|
|
49
50
|
}) => {
|
|
50
51
|
const completed = progress === 100;
|
|
52
|
+
const mergedStyle = {
|
|
53
|
+
"--progress": `${progress}%`,
|
|
54
|
+
...style
|
|
55
|
+
};
|
|
51
56
|
return /* @__PURE__ */ jsx(
|
|
52
57
|
"div",
|
|
53
58
|
{
|
|
54
|
-
style:
|
|
55
|
-
"--progress": `${progress}%`
|
|
56
|
-
},
|
|
59
|
+
style: mergedStyle,
|
|
57
60
|
...props,
|
|
58
61
|
className: cn(
|
|
59
62
|
progressBarVariants({ type, orientation, dir, completed }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { ProgressBarProps } from './ProgressBar.types';\nimport { IconButton } from '@/components/IconButton';\nimport { cn, cva } from '@/lib/cva';\nimport styles from './ProgressBar.module.css';\n\nconst progressBarVariants = cva(styles.progressbar, {\n variants: {\n type: {\n default: styles['progressbar_type_default'],\n small: styles['progressbar_type_small'],\n },\n orientation: {\n horizontal: styles['progressbar_orientation_horizontal'],\n vertical: styles['progressbar_orientation_vertical'],\n },\n dir: {\n start: styles['progressbar_dir_start'],\n end: styles['progressbar_dir_end'],\n },\n completed: {\n true: styles['progressbar_completed'],\n },\n },\n defaultVariants: {\n type: 'default',\n orientation: 'horizontal',\n dir: 'start',\n },\n});\n\nconst closeButtonVariants = cva(styles.progressclosebutton, {\n variants: {\n dismissable: {\n true: styles['progressclosebutton_dismissable'],\n },\n },\n});\n\nexport const ProgressBar = ({\n progress,\n type = 'default',\n dismissable = false,\n onCancel,\n successMessage,\n orientation = 'horizontal',\n dir = 'start',\n className,\n ...props\n}: ProgressBarProps) => {\n const completed = progress === 100;\n\n return (\n <div\n // Using a CSS variable avoids generating a new class per progress value.\n style={
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { ProgressBarProps } from './ProgressBar.types';\nimport { IconButton } from '@/components/IconButton';\nimport { cn, cva } from '@/lib/cva';\nimport styles from './ProgressBar.module.css';\n\nconst progressBarVariants = cva(styles.progressbar, {\n variants: {\n type: {\n default: styles['progressbar_type_default'],\n small: styles['progressbar_type_small'],\n },\n orientation: {\n horizontal: styles['progressbar_orientation_horizontal'],\n vertical: styles['progressbar_orientation_vertical'],\n },\n dir: {\n start: styles['progressbar_dir_start'],\n end: styles['progressbar_dir_end'],\n },\n completed: {\n true: styles['progressbar_completed'],\n },\n },\n defaultVariants: {\n type: 'default',\n orientation: 'horizontal',\n dir: 'start',\n },\n});\n\nconst closeButtonVariants = cva(styles.progressclosebutton, {\n variants: {\n dismissable: {\n true: styles['progressclosebutton_dismissable'],\n },\n },\n});\n\nexport const ProgressBar = ({\n progress,\n type = 'default',\n dismissable = false,\n onCancel,\n successMessage,\n orientation = 'horizontal',\n dir = 'start',\n className,\n style,\n ...props\n}: ProgressBarProps) => {\n const completed = progress === 100;\n const mergedStyle = {\n '--progress': `${progress}%`,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n // Using a CSS variable avoids generating a new class per progress value.\n style={mergedStyle}\n {...props}\n className={cn(\n progressBarVariants({ type, orientation, dir, completed }),\n className\n )}\n >\n {type === 'default' && (\n <>\n <span className={styles.progresstext}>\n {successMessage && completed ? successMessage : `${progress}%`}\n </span>\n <IconButton\n size=\"sm\"\n type=\"ghost\"\n icon=\"cross\"\n onClick={onCancel}\n data-testid=\"progressbar-close\"\n className={closeButtonVariants({ dismissable })}\n />\n </>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,mBAAA,GAAsB,GAAA,CAAI,MAAA,CAAO,WAAA,EAAa;AAAA,EAClD,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,OAAO,0BAA0B,CAAA;AAAA,MAC1C,KAAA,EAAO,OAAO,wBAAwB;AAAA,KACxC;AAAA,IACA,WAAA,EAAa;AAAA,MACX,UAAA,EAAY,OAAO,oCAAoC,CAAA;AAAA,MACvD,QAAA,EAAU,OAAO,kCAAkC;AAAA,KACrD;AAAA,IACA,GAAA,EAAK;AAAA,MACH,KAAA,EAAO,OAAO,uBAAuB,CAAA;AAAA,MACrC,GAAA,EAAK,OAAO,qBAAqB;AAAA,KACnC;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,OAAO,uBAAuB;AAAA;AACtC,GACF;A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AA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,IAAA;AAAA,YACL,IAAA,EAAK,OAAA;AAAA,YACL,IAAA,EAAK,OAAA;AAAA,YACL,OAAA,EAAS,QAAA;AAAA,YACT,aAAA,EAAY,mBAAA;AAAA,YACZ,SAAA,EAAW,mBAAA,CAAoB,EAAE,WAAA,EAAa;AAAA;AAAA;AAChD,OAAA,EACF;AAAA;AAAA,GAEJ;AAEJ;;;;"}
|
|
@@ -9,6 +9,26 @@
|
|
|
9
9
|
width: 100%;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.text_wrap_wrap__RR--m {
|
|
13
|
+
white-space: normal;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text_wrap_nowrap__DCK82 {
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.text_wrap_break-word__Oc5qD {
|
|
21
|
+
white-space: normal;
|
|
22
|
+
/* `anywhere` rather than `break-word` so long words also shrink the
|
|
23
|
+
min-content width, which is what flex and table layouts measure. */
|
|
24
|
+
overflow-wrap: anywhere;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.text_wrap_break-all__EdYJs {
|
|
28
|
+
white-space: normal;
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
}
|
|
31
|
+
|
|
12
32
|
/* font shorthand depends on both size and weight; one class per pairing
|
|
13
33
|
emits a single `font:` declaration. */
|
|
14
34
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const text = "text__78lq0";
|
|
2
|
+
const text_wrap_wrap = "text_wrap_wrap__RR--m";
|
|
3
|
+
const text_wrap_nowrap = "text_wrap_nowrap__DCK82";
|
|
2
4
|
const text_color_default = "text_color_default__225Wd";
|
|
3
5
|
const text_color_muted = "text_color_muted__DpcbG";
|
|
4
6
|
const text_color_danger = "text_color_danger__hphaQ";
|
|
@@ -10,6 +12,10 @@ const text_align_right = "text_align_right__azLA3";
|
|
|
10
12
|
const styles = {
|
|
11
13
|
text: text,
|
|
12
14
|
"text_fill-width": "text_fill-width__zRuxC",
|
|
15
|
+
text_wrap_wrap: text_wrap_wrap,
|
|
16
|
+
text_wrap_nowrap: text_wrap_nowrap,
|
|
17
|
+
"text_wrap_break-word": "text_wrap_break-word__Oc5qD",
|
|
18
|
+
"text_wrap_break-all": "text_wrap_break-all__EdYJs",
|
|
13
19
|
"text_font_normal-xs": "text_font_normal-xs__78uM-",
|
|
14
20
|
"text_font_normal-sm": "text_font_normal-sm__nFGGC",
|
|
15
21
|
"text_font_normal-md": "text_font_normal-md__In-T2",
|
|
@@ -40,5 +46,5 @@ const styles = {
|
|
|
40
46
|
text_align_right: text_align_right
|
|
41
47
|
};
|
|
42
48
|
|
|
43
|
-
export { styles as default, text, text_align_center, text_align_left, text_align_right, text_color_danger, text_color_default, text_color_disabled, text_color_muted, text_color_warning };
|
|
49
|
+
export { styles as default, text, text_align_center, text_align_left, text_align_right, text_color_danger, text_color_default, text_color_disabled, text_color_muted, text_color_warning, text_wrap_nowrap, text_wrap_wrap };
|
|
44
50
|
//# sourceMappingURL=Text.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -22,6 +22,12 @@ const textVariants = cva(styles.text, {
|
|
|
22
22
|
fillWidth: {
|
|
23
23
|
true: styles["text_fill-width"]
|
|
24
24
|
},
|
|
25
|
+
wrap: {
|
|
26
|
+
wrap: styles["text_wrap_wrap"],
|
|
27
|
+
nowrap: styles["text_wrap_nowrap"],
|
|
28
|
+
"break-word": styles["text_wrap_break-word"],
|
|
29
|
+
"break-all": styles["text_wrap_break-all"]
|
|
30
|
+
},
|
|
25
31
|
size: {
|
|
26
32
|
xs: "",
|
|
27
33
|
sm: "",
|
|
@@ -74,6 +80,7 @@ const _Text = ({
|
|
|
74
80
|
children,
|
|
75
81
|
component,
|
|
76
82
|
fillWidth,
|
|
83
|
+
wrap,
|
|
77
84
|
...props
|
|
78
85
|
}, ref) => {
|
|
79
86
|
const Component = component ?? "p";
|
|
@@ -82,7 +89,10 @@ const _Text = ({
|
|
|
82
89
|
{
|
|
83
90
|
ref,
|
|
84
91
|
...props,
|
|
85
|
-
className: cn(
|
|
92
|
+
className: cn(
|
|
93
|
+
textVariants({ color, align, size, weight, fillWidth, wrap }),
|
|
94
|
+
className
|
|
95
|
+
),
|
|
86
96
|
children
|
|
87
97
|
}
|
|
88
98
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport styles from './Text.module.css';\n\nexport type TextSize = 'xs' | 'sm' | 'md' | 'lg';\nexport type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold' | 'mono';\nexport type TextAlignment = 'left' | 'center' | 'right';\nexport type TextColor = 'default' | 'muted' | 'danger' | 'disabled' | 'warning';\n\nexport interface TextProps<T extends ElementType = 'p'> {\n /** The text content to display */\n children: ReactNode;\n /** The text alignment */\n align?: TextAlignment;\n /** The text color variant */\n color?: TextColor;\n /** The font size of the text */\n size?: TextSize;\n /** The font weight of the text */\n weight?: TextWeight;\n /** Additional CSS class name */\n className?: string;\n /** Custom component to render as */\n component?: T;\n /** Whether the text should fill the full width of its container */\n fillWidth?: boolean;\n}\n\ntype TextPolymorphicComponent = <T extends ElementType = 'p'>(\n props: Omit<ComponentProps<T>, keyof TextProps<T>> & TextProps<T>\n) => ReactNode;\n\nconst textVariants = cva(styles.text, {\n variants: {\n color: {\n default: styles['text_color_default'],\n muted: styles['text_color_muted'],\n danger: styles['text_color_danger'],\n disabled: styles['text_color_disabled'],\n warning: styles['text_color_warning'],\n },\n align: {\n left: styles['text_align_left'],\n center: styles['text_align_center'],\n right: styles['text_align_right'],\n },\n fillWidth: {\n true: styles['text_fill-width'],\n },\n size: {\n xs: '',\n sm: '',\n md: '',\n lg: '',\n },\n weight: {\n normal: '',\n medium: '',\n semibold: '',\n bold: '',\n mono: '',\n },\n },\n compoundVariants: [\n { weight: 'normal', size: 'xs', class: styles['text_font_normal-xs'] },\n { weight: 'normal', size: 'sm', class: styles['text_font_normal-sm'] },\n { weight: 'normal', size: 'md', class: styles['text_font_normal-md'] },\n { weight: 'normal', size: 'lg', class: styles['text_font_normal-lg'] },\n { weight: 'medium', size: 'xs', class: styles['text_font_medium-xs'] },\n { weight: 'medium', size: 'sm', class: styles['text_font_medium-sm'] },\n { weight: 'medium', size: 'md', class: styles['text_font_medium-md'] },\n { weight: 'medium', size: 'lg', class: styles['text_font_medium-lg'] },\n { weight: 'semibold', size: 'xs', class: styles['text_font_semibold-xs'] },\n { weight: 'semibold', size: 'sm', class: styles['text_font_semibold-sm'] },\n { weight: 'semibold', size: 'md', class: styles['text_font_semibold-md'] },\n { weight: 'semibold', size: 'lg', class: styles['text_font_semibold-lg'] },\n { weight: 'bold', size: 'xs', class: styles['text_font_bold-xs'] },\n { weight: 'bold', size: 'sm', class: styles['text_font_bold-sm'] },\n { weight: 'bold', size: 'md', class: styles['text_font_bold-md'] },\n { weight: 'bold', size: 'lg', class: styles['text_font_bold-lg'] },\n { weight: 'mono', size: 'xs', class: styles['text_font_mono-xs'] },\n { weight: 'mono', size: 'sm', class: styles['text_font_mono-sm'] },\n { weight: 'mono', size: 'md', class: styles['text_font_mono-md'] },\n { weight: 'mono', size: 'lg', class: styles['text_font_mono-lg'] },\n ],\n defaultVariants: {\n color: 'default',\n align: 'left',\n size: 'md',\n weight: 'normal',\n },\n});\n\nconst _Text = <T extends ElementType = 'p'>(\n {\n align,\n color,\n size,\n weight,\n className,\n children,\n component,\n fillWidth,\n ...props\n }: Omit<ComponentProps<T>, keyof TextProps<T>> & TextProps<T>,\n ref: ComponentPropsWithRef<T>['ref']\n) => {\n const Component = component ?? 'p';\n return (\n <Component\n ref={ref}\n {...props}\n className={cn(textVariants({ color, align, size, weight, fillWidth })
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport styles from './Text.module.css';\n\nexport type TextSize = 'xs' | 'sm' | 'md' | 'lg';\nexport type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold' | 'mono';\nexport type TextAlignment = 'left' | 'center' | 'right';\nexport type TextColor = 'default' | 'muted' | 'danger' | 'disabled' | 'warning';\nexport type TextWrap = 'wrap' | 'nowrap' | 'break-word' | 'break-all';\n\nexport interface TextProps<T extends ElementType = 'p'> {\n /** The text content to display */\n children: ReactNode;\n /** The text alignment */\n align?: TextAlignment;\n /** The text color variant */\n color?: TextColor;\n /** The font size of the text */\n size?: TextSize;\n /** The font weight of the text */\n weight?: TextWeight;\n /** Additional CSS class name */\n className?: string;\n /** Custom component to render as */\n component?: T;\n /** Whether the text should fill the full width of its container */\n fillWidth?: boolean;\n /** Text wrapping, unset by default - inherits from parent */\n wrap?: TextWrap;\n}\n\ntype TextPolymorphicComponent = <T extends ElementType = 'p'>(\n props: Omit<ComponentProps<T>, keyof TextProps<T>> & TextProps<T>\n) => ReactNode;\n\nconst textVariants = cva(styles.text, {\n variants: {\n color: {\n default: styles['text_color_default'],\n muted: styles['text_color_muted'],\n danger: styles['text_color_danger'],\n disabled: styles['text_color_disabled'],\n warning: styles['text_color_warning'],\n },\n align: {\n left: styles['text_align_left'],\n center: styles['text_align_center'],\n right: styles['text_align_right'],\n },\n fillWidth: {\n true: styles['text_fill-width'],\n },\n wrap: {\n wrap: styles['text_wrap_wrap'],\n nowrap: styles['text_wrap_nowrap'],\n 'break-word': styles['text_wrap_break-word'],\n 'break-all': styles['text_wrap_break-all'],\n },\n size: {\n xs: '',\n sm: '',\n md: '',\n lg: '',\n },\n weight: {\n normal: '',\n medium: '',\n semibold: '',\n bold: '',\n mono: '',\n },\n },\n compoundVariants: [\n { weight: 'normal', size: 'xs', class: styles['text_font_normal-xs'] },\n { weight: 'normal', size: 'sm', class: styles['text_font_normal-sm'] },\n { weight: 'normal', size: 'md', class: styles['text_font_normal-md'] },\n { weight: 'normal', size: 'lg', class: styles['text_font_normal-lg'] },\n { weight: 'medium', size: 'xs', class: styles['text_font_medium-xs'] },\n { weight: 'medium', size: 'sm', class: styles['text_font_medium-sm'] },\n { weight: 'medium', size: 'md', class: styles['text_font_medium-md'] },\n { weight: 'medium', size: 'lg', class: styles['text_font_medium-lg'] },\n { weight: 'semibold', size: 'xs', class: styles['text_font_semibold-xs'] },\n { weight: 'semibold', size: 'sm', class: styles['text_font_semibold-sm'] },\n { weight: 'semibold', size: 'md', class: styles['text_font_semibold-md'] },\n { weight: 'semibold', size: 'lg', class: styles['text_font_semibold-lg'] },\n { weight: 'bold', size: 'xs', class: styles['text_font_bold-xs'] },\n { weight: 'bold', size: 'sm', class: styles['text_font_bold-sm'] },\n { weight: 'bold', size: 'md', class: styles['text_font_bold-md'] },\n { weight: 'bold', size: 'lg', class: styles['text_font_bold-lg'] },\n { weight: 'mono', size: 'xs', class: styles['text_font_mono-xs'] },\n { weight: 'mono', size: 'sm', class: styles['text_font_mono-sm'] },\n { weight: 'mono', size: 'md', class: styles['text_font_mono-md'] },\n { weight: 'mono', size: 'lg', class: styles['text_font_mono-lg'] },\n ],\n defaultVariants: {\n color: 'default',\n align: 'left',\n size: 'md',\n weight: 'normal',\n },\n});\n\nconst _Text = <T extends ElementType = 'p'>(\n {\n align,\n color,\n size,\n weight,\n className,\n children,\n component,\n fillWidth,\n wrap,\n ...props\n }: Omit<ComponentProps<T>, keyof TextProps<T>> & TextProps<T>,\n ref: ComponentPropsWithRef<T>['ref']\n) => {\n const Component = component ?? 'p';\n return (\n <Component\n ref={ref}\n {...props}\n className={cn(\n textVariants({ color, align, size, weight, fillWidth, wrap }),\n className\n )}\n >\n {children}\n </Component>\n );\n};\n\n_Text.displayName = 'Text';\n\nexport const Text: TextPolymorphicComponent = forwardRef(_Text);\n"],"names":[],"mappings":";;;;;;AAyCA,MAAM,YAAA,GAAe,GAAA,CAAI,MAAA,CAAO,IAAA,EAAM;AAAA,EACpC,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,MACL,OAAA,EAAS,OAAO,oBAAoB,CAAA;AAAA,MACpC,KAAA,EAAO,OAAO,kBAAkB,CAAA;AAAA,MAChC,MAAA,EAAQ,OAAO,mBAAmB,CAAA;AAAA,MAClC,QAAA,EAAU,OAAO,qBAAqB,CAAA;AAAA,MACtC,OAAA,EAAS,OAAO,oBAAoB;AAAA,KACtC;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,OAAO,iBAAiB,CAAA;AAAA,MAC9B,MAAA,EAAQ,OAAO,mBAAmB,CAAA;AAAA,MAClC,KAAA,EAAO,OAAO,kBAAkB;AAAA,KAClC;AAAA,IACA,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,OAAO,iBAAiB;AAAA,KAChC;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,OAAO,gBAAgB,CAAA;AAAA,MAC7B,MAAA,EAAQ,OAAO,kBAAkB,CAAA;AAAA,MACjC,YAAA,EAAc,OAAO,sBAAsB,CAAA;AAAA,MAC3C,WAAA,EAAa,OAAO,qBAAqB;AAAA,KAC3C;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,EAAA;AAAA,MACJ,EAAA,EAAI,EAAA;AAAA,MACJ,EAAA,EAAI,EAAA;AAAA,MACJ,EAAA,EAAI;AAAA,KACN;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,MAAA,EAAQ,EAAA;AAAA,MACR,MAAA,EAAQ,E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EACA,IAAA;AAAA,EACA,GAAG;AACL,CAAA,EACA,GAAA,KACG;AACH,EAAA,MAAM,YAAY,SAAA,IAAa,GAAA;AAC/B,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACC,GAAG,KAAA;AAAA,MACJ,SAAA,EAAW,EAAA;AAAA,QACT,YAAA,CAAa,EAAE,KAAA,EAAO,KAAA,EAAO,MAAM,MAAA,EAAQ,SAAA,EAAW,MAAM,CAAA;AAAA,QAC5D;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAA;AAEA,KAAA,CAAM,WAAA,GAAc,MAAA;AAEb,MAAM,IAAA,GAAiC,WAAW,KAAK;;;;"}
|
|
@@ -171,7 +171,13 @@ const ToastProvider = ({
|
|
|
171
171
|
id
|
|
172
172
|
))
|
|
173
173
|
] }),
|
|
174
|
-
/* @__PURE__ */ jsx(
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
RadixUIToast.Viewport,
|
|
176
|
+
{
|
|
177
|
+
"aria-live": "off",
|
|
178
|
+
className: cn(viewportVariants({ align }))
|
|
179
|
+
}
|
|
180
|
+
)
|
|
175
181
|
]
|
|
176
182
|
},
|
|
177
183
|
`toast-provider-${align}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { createContext, useEffect, useState } from 'react';\nimport * as RadixUIToast from '@radix-ui/react-toast';\nimport { cn, cva } from '@/lib/cva';\nimport { toastsEventEmitter } from './toastEmitter';\nimport { Icon, type IconName, type IconProps } from '@/components/Icon';\nimport { IconButton } from '@/components/IconButton';\nimport { Button } from '@/components/Button';\nimport { ToastContextProps, ToastProps, ToastAlignment, ToastType } from './Toast.types';\nimport styles from './Toast.module.css';\n\nexport const ToastContext = createContext<ToastContextProps>({\n createToast: () => null,\n});\n\nconst toastIconVariants = cva(styles.toast__icon, {\n variants: {\n type: {\n default: styles['toast__icon_type_default'],\n success: styles['toast__icon_type_success'],\n warning: styles['toast__icon_type_warning'],\n danger: styles['toast__icon_type_danger'],\n },\n },\n defaultVariants: {\n type: 'default',\n },\n});\n\n// Lazy wrapper to avoid circular dependency issues at module load time\nconst ToastIcon = ({\n $type = 'default',\n className,\n ...props\n}: IconProps & { $type?: ToastType }) => (\n <Icon\n {...props}\n className={cn(toastIconVariants({ type: $type }), className)}\n />\n);\n\nconst viewportVariants = cva(styles['toast-viewport'], {\n variants: {\n align: {\n start: styles['toast-viewport_align_start'],\n end: styles['toast-viewport_align_end'],\n },\n },\n defaultVariants: {\n align: 'end',\n },\n});\n\nexport const Toast = ({\n type,\n toastType = 'foreground',\n title,\n description,\n actions = [],\n duration,\n onClose,\n className,\n ...props\n}: ToastProps & { onClose: (open: boolean) => void }) => {\n let iconName = '';\n if (type === 'default') {\n iconName = 'info-in-circle';\n } else if (type === 'success') {\n iconName = 'check';\n } else if (type && ['danger', 'warning'].includes(type)) {\n iconName = 'warning';\n }\n return (\n <RadixUIToast.Root\n onOpenChange={onClose}\n duration={duration}\n type={toastType}\n {...props}\n className={cn(styles.toast, className)}\n >\n <RadixUIToast.Title className={styles.toast__header}>\n {iconName.length > 0 && (\n <ToastIcon\n name={iconName as IconName}\n $type={type}\n />\n )}\n <div className={styles.toast__title}>{title}</div>\n <RadixUIToast.Close asChild>\n <IconButton\n icon=\"cross\"\n type=\"ghost\"\n />\n </RadixUIToast.Close>\n </RadixUIToast.Title>\n {(description || actions.length > 0) && (\n <div className={styles['toast__description-container']}>\n <RadixUIToast.Description className={styles['toast__description-content']}>\n {description}\n </RadixUIToast.Description>\n {actions.length > 0 && (\n <div className={styles['toast__description-content']}>\n {actions.map(({ altText, ...btnProps }) => (\n <RadixUIToast.Action\n altText={altText}\n asChild\n key={altText}\n >\n <div>\n <Button {...btnProps} />\n </div>\n </RadixUIToast.Action>\n ))}\n </div>\n )}\n </div>\n )}\n </RadixUIToast.Root>\n );\n};\n\nexport interface ToastProviderProps extends RadixUIToast.ToastProviderProps {\n align?: ToastAlignment;\n}\n\nexport const ToastProvider = ({\n children,\n align = 'end',\n ...props\n}: ToastProviderProps) => {\n const [toasts, setToasts] = useState<Record<ToastAlignment, Map<string, ToastProps>>>({\n start: new Map(),\n end: new Map(),\n });\n\n useEffect(() => {\n const listener = (toast: ToastProps) => {\n setToasts(currentToasts => {\n const alignment = toast.align ?? 'end';\n const newToasts = { ...currentToasts };\n const map = new Map(newToasts[alignment]);\n map.set(toast?.id ?? String(Date.now()), toast);\n newToasts[alignment] = map;\n return newToasts;\n });\n };\n\n toastsEventEmitter.on(listener);\n\n return () => toastsEventEmitter.off(listener);\n }, []);\n\n const onClose = (id: string) => (open: boolean) => {\n if (!open) {\n setToasts(currentToasts => {\n const newToasts = { ...currentToasts };\n const map = new Map(newToasts[align]);\n map.delete(id);\n newToasts[align] = map;\n return newToasts;\n });\n }\n };\n\n const value = {\n createToast: (toast: ToastProps, toastAlign: ToastAlignment = align) => {\n setToasts(currentToasts => {\n const newToasts = { ...currentToasts };\n const map = new Map(newToasts[toastAlign]);\n map.set(toast?.id ?? String(Date.now()), toast);\n newToasts[toastAlign] = map;\n return newToasts;\n });\n },\n };\n\n return (\n <RadixUIToast.Provider\n swipeDirection={align === 'start' ? 'left' : 'right'}\n key={`toast-provider-${align}`}\n {...props}\n >\n <ToastContext.Provider value={value}>\n {children}\n {Array.from(toasts[align]).map(([id, toast]) => (\n <Toast\n key={id}\n {...toast}\n onClose={onClose(id)}\n />\n ))}\n </ToastContext.Provider>\n <RadixUIToast.Viewport className={cn(viewportVariants({ align }))} />\n </RadixUIToast.Provider>\n );\n};\n"],"names":["Icon"],"mappings":";;;;;;;;;;;AAUO,MAAM,eAAe,aAAA,CAAiC;AAAA,EAC3D,aAAa,MAAM;AACrB,CAAC;AAED,MAAM,iBAAA,GAAoB,GAAA,CAAI,MAAA,CAAO,WAAA,EAAa;AAAA,EAChD,QAAA,EAAU;AAAA,IACR,I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,OAAA;AAAA,MAE5C,GAAG,KAAA;AAAA,MAEJ,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,YAAA,CAAa,QAAA,EAAb,EAAsB,KAAA,EACpB,QAAA,EAAA;AAAA,UAAA,QAAA;AAAA,UACA,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,KAAK,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,EAAA,EAAI,KAAK,CAAA,qBACxC,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cAEE,GAAG,KAAA;AAAA,cACJ,OAAA,EAAS,QAAQ,EAAE;AAAA,aAAA;AAAA,YAFd;AAAA,WAIR;AAAA,SAAA,EACH,CAAA;AAAA,wBACA,GAAA,CAAC,YAAA,CAAa,QAAA,EAAb,EAAsB,SAAA,EAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,KAAA,EAAO,CAAC,CAAA,EAAG;AAAA;AAAA,KAAA;AAAA,IAb9D,kBAAkB,KAAK,CAAA;AAAA,GAc9B;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { createContext, useEffect, useState } from 'react';\nimport * as RadixUIToast from '@radix-ui/react-toast';\nimport { cn, cva } from '@/lib/cva';\nimport { toastsEventEmitter } from './toastEmitter';\nimport { Icon, type IconName, type IconProps } from '@/components/Icon';\nimport { IconButton } from '@/components/IconButton';\nimport { Button } from '@/components/Button';\nimport { ToastContextProps, ToastProps, ToastAlignment, ToastType } from './Toast.types';\nimport styles from './Toast.module.css';\n\nexport const ToastContext = createContext<ToastContextProps>({\n createToast: () => null,\n});\n\nconst toastIconVariants = cva(styles.toast__icon, {\n variants: {\n type: {\n default: styles['toast__icon_type_default'],\n success: styles['toast__icon_type_success'],\n warning: styles['toast__icon_type_warning'],\n danger: styles['toast__icon_type_danger'],\n },\n },\n defaultVariants: {\n type: 'default',\n },\n});\n\n// Lazy wrapper to avoid circular dependency issues at module load time\nconst ToastIcon = ({\n $type = 'default',\n className,\n ...props\n}: IconProps & { $type?: ToastType }) => (\n <Icon\n {...props}\n className={cn(toastIconVariants({ type: $type }), className)}\n />\n);\n\nconst viewportVariants = cva(styles['toast-viewport'], {\n variants: {\n align: {\n start: styles['toast-viewport_align_start'],\n end: styles['toast-viewport_align_end'],\n },\n },\n defaultVariants: {\n align: 'end',\n },\n});\n\nexport const Toast = ({\n type,\n toastType = 'foreground',\n title,\n description,\n actions = [],\n duration,\n onClose,\n className,\n ...props\n}: ToastProps & { onClose: (open: boolean) => void }) => {\n let iconName = '';\n if (type === 'default') {\n iconName = 'info-in-circle';\n } else if (type === 'success') {\n iconName = 'check';\n } else if (type && ['danger', 'warning'].includes(type)) {\n iconName = 'warning';\n }\n return (\n <RadixUIToast.Root\n onOpenChange={onClose}\n duration={duration}\n type={toastType}\n {...props}\n className={cn(styles.toast, className)}\n >\n <RadixUIToast.Title className={styles.toast__header}>\n {iconName.length > 0 && (\n <ToastIcon\n name={iconName as IconName}\n $type={type}\n />\n )}\n <div className={styles.toast__title}>{title}</div>\n <RadixUIToast.Close asChild>\n <IconButton\n icon=\"cross\"\n type=\"ghost\"\n />\n </RadixUIToast.Close>\n </RadixUIToast.Title>\n {(description || actions.length > 0) && (\n <div className={styles['toast__description-container']}>\n <RadixUIToast.Description className={styles['toast__description-content']}>\n {description}\n </RadixUIToast.Description>\n {actions.length > 0 && (\n <div className={styles['toast__description-content']}>\n {actions.map(({ altText, ...btnProps }) => (\n <RadixUIToast.Action\n altText={altText}\n asChild\n key={altText}\n >\n <div>\n <Button {...btnProps} />\n </div>\n </RadixUIToast.Action>\n ))}\n </div>\n )}\n </div>\n )}\n </RadixUIToast.Root>\n );\n};\n\nexport interface ToastProviderProps extends RadixUIToast.ToastProviderProps {\n align?: ToastAlignment;\n}\n\nexport const ToastProvider = ({\n children,\n align = 'end',\n ...props\n}: ToastProviderProps) => {\n const [toasts, setToasts] = useState<Record<ToastAlignment, Map<string, ToastProps>>>({\n start: new Map(),\n end: new Map(),\n });\n\n useEffect(() => {\n const listener = (toast: ToastProps) => {\n setToasts(currentToasts => {\n const alignment = toast.align ?? 'end';\n const newToasts = { ...currentToasts };\n const map = new Map(newToasts[alignment]);\n map.set(toast?.id ?? String(Date.now()), toast);\n newToasts[alignment] = map;\n return newToasts;\n });\n };\n\n toastsEventEmitter.on(listener);\n\n return () => toastsEventEmitter.off(listener);\n }, []);\n\n const onClose = (id: string) => (open: boolean) => {\n if (!open) {\n setToasts(currentToasts => {\n const newToasts = { ...currentToasts };\n const map = new Map(newToasts[align]);\n map.delete(id);\n newToasts[align] = map;\n return newToasts;\n });\n }\n };\n\n const value = {\n createToast: (toast: ToastProps, toastAlign: ToastAlignment = align) => {\n setToasts(currentToasts => {\n const newToasts = { ...currentToasts };\n const map = new Map(newToasts[toastAlign]);\n map.set(toast?.id ?? String(Date.now()), toast);\n newToasts[toastAlign] = map;\n return newToasts;\n });\n },\n };\n\n return (\n <RadixUIToast.Provider\n swipeDirection={align === 'start' ? 'left' : 'right'}\n key={`toast-provider-${align}`}\n {...props}\n >\n <ToastContext.Provider value={value}>\n {children}\n {Array.from(toasts[align]).map(([id, toast]) => (\n <Toast\n key={id}\n {...toast}\n onClose={onClose(id)}\n />\n ))}\n </ToastContext.Provider>\n {/* aria-live exempts the viewport from the aria-hidden sweep modal layers\n run, keeping toasts over a Dialog or Select in the accessibility tree. */}\n <RadixUIToast.Viewport\n aria-live=\"off\"\n className={cn(viewportVariants({ align }))}\n />\n </RadixUIToast.Provider>\n );\n};\n"],"names":["Icon"],"mappings":";;;;;;;;;;;AAUO,MAAM,eAAe,aAAA,CAAiC;AAAA,EAC3D,aAAa,MAAM;AACrB,CAAC;AAED,MAAM,iBAAA,GAAoB,GAAA,CAAI,MAAA,CAAO,WAAA,EAAa;AAAA,EAChD,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,OAAO,0BAA0B,CAAA;AAAA,MAC1C,OAAA,E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,CAAC,YAAA,CAAa,QAAA,EAAb,EAAsB,KAAA,EACpB,QAAA,EAAA;AAAA,UAAA,QAAA;AAAA,UACA,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,KAAK,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,EAAA,EAAI,KAAK,CAAA,qBACxC,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cAEE,GAAG,KAAA;AAAA,cACJ,OAAA,EAAS,QAAQ,EAAE;AAAA,aAAA;AAAA,YAFd;AAAA,WAIR;AAAA,SAAA,EACH,CAAA;AAAA,wBAGA,GAAA;AAAA,UAAC,YAAA,CAAa,QAAA;AAAA,UAAb;AAAA,YACC,WAAA,EAAU,KAAA;AAAA,YACV,WAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,KAAA,EAAO,CAAC;AAAA;AAAA;AAC3C;AAAA,KAAA;AAAA,IAlBK,kBAAkB,KAAK,CAAA;AAAA,GAmB9B;AAEJ;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CodeBlockProps } from './CodeBlock.types';
|
|
2
|
-
export declare const CodeBlock: ({ children, language, theme, showLineNumbers, showWrapButton, wrapLines, onCopy, onCopyError, className, style, ...props }: CodeBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const CodeBlock: ({ children, language, theme, showLineNumbers, showWrapButton, wrapLines, ariaLabel, onCopy, onCopyError, className, style, ...props }: CodeBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,14 @@ export interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ch
|
|
|
7
7
|
showLineNumbers?: boolean;
|
|
8
8
|
showWrapButton?: boolean;
|
|
9
9
|
wrapLines?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Accessible name for the scrollable code region. The region is a keyboard
|
|
12
|
+
* tab stop (so overflowing code can be scrolled), and a tab stop must be
|
|
13
|
+
* announced. Defaults to the `language` plus "code block", or "Code block"
|
|
14
|
+
* when no language is set. Override to localise it or to say which code this
|
|
15
|
+
* is when a page has several blocks.
|
|
16
|
+
*/
|
|
17
|
+
ariaLabel?: string;
|
|
10
18
|
onCopy?: (value: string) => void | Promise<void>;
|
|
11
19
|
onCopyError?: (error: string) => void | Promise<void>;
|
|
12
20
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { IconWrapperProps } from '../IconWrapper';
|
|
2
3
|
import { IconName } from '../Icon';
|
|
3
4
|
import { HorizontalDirection } from '../../types';
|
|
5
|
+
import { ArrowProps, DropdownItemProps } from './Dropdown.types';
|
|
4
6
|
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
5
7
|
export declare const Dropdown: {
|
|
6
8
|
(props: DropdownMenu.DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,23 +23,27 @@ export declare const Dropdown: {
|
|
|
21
23
|
displayName: string;
|
|
22
24
|
};
|
|
23
25
|
Item: {
|
|
24
|
-
({ icon, iconDir, type, children, ...props }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
({ icon, iconDir, type, tooltipProps, children, ...props }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
displayName: string;
|
|
26
28
|
};
|
|
27
29
|
};
|
|
28
|
-
interface
|
|
30
|
+
interface SubDiscriminant {
|
|
29
31
|
sub?: true;
|
|
32
|
+
}
|
|
33
|
+
interface SubTriggerFields {
|
|
30
34
|
icon?: IconName;
|
|
31
35
|
iconDir?: HorizontalDirection;
|
|
36
|
+
/**
|
|
37
|
+
* Positions the tooltip shown when the label is truncated. Defaults to
|
|
38
|
+
* `side: 'right'` so the tooltip does not cover the items above it.
|
|
39
|
+
*/
|
|
40
|
+
tooltipProps?: IconWrapperProps['tooltipProps'];
|
|
32
41
|
}
|
|
33
42
|
interface MainDropdownProps {
|
|
34
43
|
sub?: never;
|
|
35
44
|
}
|
|
36
|
-
type DropdownSubTriggerProps = DropdownMenu.DropdownMenuSubTriggerProps &
|
|
45
|
+
type DropdownSubTriggerProps = DropdownMenu.DropdownMenuSubTriggerProps & SubDiscriminant & SubTriggerFields;
|
|
37
46
|
type DropdownTriggerProps = DropdownMenu.DropdownMenuTriggerProps & MainDropdownProps;
|
|
38
|
-
export type ArrowProps = {
|
|
39
|
-
showArrow?: boolean;
|
|
40
|
-
};
|
|
41
47
|
interface StyledDropdownContentProps extends DropdownMenu.DropdownMenuContentProps {
|
|
42
48
|
children?: ReactNode;
|
|
43
49
|
container?: HTMLElement | null;
|
|
@@ -48,15 +54,6 @@ interface StyledDropdownSubContentProps extends DropdownMenu.DropdownMenuSubCont
|
|
|
48
54
|
container?: HTMLElement | null;
|
|
49
55
|
responsivePositioning?: boolean;
|
|
50
56
|
}
|
|
51
|
-
type DropdownContentProps = StyledDropdownContentProps &
|
|
57
|
+
type DropdownContentProps = StyledDropdownContentProps & SubDiscriminant & ArrowProps;
|
|
52
58
|
type DropdownSubContentProps = StyledDropdownSubContentProps & MainDropdownProps & ArrowProps;
|
|
53
|
-
interface DropdownItemProps extends DropdownMenu.DropdownMenuItemProps {
|
|
54
|
-
/** Icon to display in the menu item */
|
|
55
|
-
icon?: IconName;
|
|
56
|
-
/** The direction of the icon relative to the label */
|
|
57
|
-
iconDir?: HorizontalDirection;
|
|
58
|
-
/** The type of the menu item */
|
|
59
|
-
type?: 'default' | 'danger';
|
|
60
|
-
}
|
|
61
|
-
export type { DropdownItemProps };
|
|
62
59
|
export default Dropdown;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { HorizontalDirection } from '../../types';
|
|
2
2
|
import { IconName } from '../Icon/Icon.types';
|
|
3
|
+
import { IconWrapperProps } from '../IconWrapper/IconWrapper.types';
|
|
3
4
|
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
4
5
|
export interface ArrowProps {
|
|
5
6
|
showArrow?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface DropdownItemProps extends DropdownMenu.DropdownMenuItemProps {
|
|
9
|
+
/** Icon to display in the menu item */
|
|
8
10
|
icon?: IconName;
|
|
11
|
+
/** The direction of the icon relative to the label */
|
|
9
12
|
iconDir?: HorizontalDirection;
|
|
13
|
+
/** The type of the menu item */
|
|
14
|
+
type?: 'default' | 'danger';
|
|
15
|
+
/**
|
|
16
|
+
* Positions the tooltip shown when the label is truncated. Defaults to
|
|
17
|
+
* `side: 'right'` so the tooltip does not cover the items above it.
|
|
18
|
+
*/
|
|
19
|
+
tooltipProps?: IconWrapperProps['tooltipProps'];
|
|
10
20
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
component?: T;
|
|
4
|
-
}
|
|
2
|
+
import { EllipsisContentProps } from './EllipsisContent.types';
|
|
5
3
|
type EllipsisPolymorphicComponent = <T extends ElementType = 'div'>(props: Omit<ComponentProps<T>, keyof EllipsisContentProps<T>> & EllipsisContentProps<T>) => ReactNode;
|
|
6
4
|
export declare const EllipsisContent: EllipsisPolymorphicComponent;
|
|
7
5
|
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
+
import { TooltipContentProps } from '../Tooltip/Tooltip.types';
|
|
2
3
|
export interface EllipsisContentProps<T extends ElementType = 'div'> {
|
|
3
4
|
component?: T;
|
|
5
|
+
/**
|
|
6
|
+
* Positions the tooltip shown when the content is truncated, e.g.
|
|
7
|
+
* `{ side: 'right' }` to keep it clear of the content above it.
|
|
8
|
+
*/
|
|
9
|
+
tooltipProps?: Pick<TooltipContentProps, 'side' | 'align' | 'sideOffset'>;
|
|
4
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IconWrapperProps } from './IconWrapper.types';
|
|
2
|
-
export declare const IconWrapper: ({ icon, iconDir, size, width, height, children, ellipsisContent, gap, isResponsive, ...props }: IconWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const IconWrapper: ({ icon, iconDir, size, width, height, children, ellipsisContent, tooltipProps, gap, isResponsive, ...props }: IconWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { HorizontalDirection, AssetSize } from '../../types';
|
|
3
|
+
import { EllipsisContentProps } from '../EllipsisContent/EllipsisContent.types';
|
|
3
4
|
import { ImageName } from '../Icon/Icon.types';
|
|
4
5
|
import { GapOptions } from '../Container';
|
|
5
6
|
export interface IconWrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -10,6 +11,8 @@ export interface IconWrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
10
11
|
height?: number | string;
|
|
11
12
|
children: ReactNode;
|
|
12
13
|
ellipsisContent?: boolean;
|
|
14
|
+
/** Positions the truncation tooltip. Ignored when `ellipsisContent` is `false`. */
|
|
15
|
+
tooltipProps?: EllipsisContentProps['tooltipProps'];
|
|
13
16
|
gap?: GapOptions;
|
|
14
17
|
isResponsive?: boolean;
|
|
15
18
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ProgressBarProps } from './ProgressBar.types';
|
|
2
|
-
export declare const ProgressBar: ({ progress, type, dismissable, onCancel, successMessage, orientation, dir, className, ...props }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ProgressBar: ({ progress, type, dismissable, onCancel, successMessage, orientation, dir, className, style, ...props }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,7 @@ export type TextSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
3
3
|
export type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold' | 'mono';
|
|
4
4
|
export type TextAlignment = 'left' | 'center' | 'right';
|
|
5
5
|
export type TextColor = 'default' | 'muted' | 'danger' | 'disabled' | 'warning';
|
|
6
|
+
export type TextWrap = 'wrap' | 'nowrap' | 'break-word' | 'break-all';
|
|
6
7
|
export interface TextProps<T extends ElementType = 'p'> {
|
|
7
8
|
/** The text content to display */
|
|
8
9
|
children: ReactNode;
|
|
@@ -20,6 +21,8 @@ export interface TextProps<T extends ElementType = 'p'> {
|
|
|
20
21
|
component?: T;
|
|
21
22
|
/** Whether the text should fill the full width of its container */
|
|
22
23
|
fillWidth?: boolean;
|
|
24
|
+
/** Text wrapping, unset by default - inherits from parent */
|
|
25
|
+
wrap?: TextWrap;
|
|
23
26
|
}
|
|
24
27
|
type TextPolymorphicComponent = <T extends ElementType = 'p'>(props: Omit<ComponentProps<T>, keyof TextProps<T>> & TextProps<T>) => ReactNode;
|
|
25
28
|
export declare const Text: TextPolymorphicComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Tooltip } from './Tooltip';
|
|
2
|
-
export type { TooltipProps } from './Tooltip.types';
|
|
2
|
+
export type { TooltipContentProps, TooltipProps } from './Tooltip.types';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -55,7 +55,9 @@ export type { DateRange, Timezone } from './components/DatePicker/utils';
|
|
|
55
55
|
export { Dialog } from './components/Dialog';
|
|
56
56
|
export type { DialogContentProps, DialogProps, DialogTriggerProps, } from './components/Dialog';
|
|
57
57
|
export { Dropdown } from './components/Dropdown';
|
|
58
|
+
export type { DropdownItemProps } from './components/Dropdown';
|
|
58
59
|
export { EllipsisContent } from './components/EllipsisContent';
|
|
60
|
+
export type { EllipsisContentProps } from './components/EllipsisContent';
|
|
59
61
|
export { FileMultiUpload, FileUpload } from './components/FileUpload';
|
|
60
62
|
export { FileTabs, FileTabElement } from './components/FileTabs';
|
|
61
63
|
export type { FileTabStatusType } from './components/FileTabs';
|
|
@@ -124,7 +126,7 @@ export type { ToastProps } from './components/Toast';
|
|
|
124
126
|
export { useInitialTheme, useToast, useCUITheme } from './hooks';
|
|
125
127
|
export type { CUIThemeType, UseThemeParams } from './hooks';
|
|
126
128
|
export { Tooltip } from './components/Tooltip/Tooltip';
|
|
127
|
-
export type { TooltipProps } from './components/Tooltip';
|
|
129
|
+
export type { TooltipContentProps, TooltipProps } from './components/Tooltip';
|
|
128
130
|
export { Text } from './components/Text';
|
|
129
131
|
export type { TextProps } from './components/Text';
|
|
130
132
|
export { Title } from './components/Title';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickhouse/click-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "0.11.0-rc1",
|
|
4
4
|
"description": "Official ClickHouse design system react library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
"storybook:build": "storybook build -o .storybook/out",
|
|
391
391
|
"storybook:serve": "yarn dlx http-server .storybook/out",
|
|
392
392
|
"test": "vitest",
|
|
393
|
-
"test:chromatic": "yarn
|
|
393
|
+
"test:chromatic": "yarn chromatic",
|
|
394
394
|
"test:visual": ".scripts/bash/playwright-docker",
|
|
395
395
|
"test:visual:report": ".scripts/bash/playwright-docker report",
|
|
396
396
|
"test:visual:ui": ".scripts/bash/playwright-docker ui",
|
|
@@ -400,22 +400,20 @@
|
|
|
400
400
|
},
|
|
401
401
|
"dependencies": {
|
|
402
402
|
"@h6s/calendar": "2.2.0",
|
|
403
|
-
"@radix-ui/react-accordion": "1.2.
|
|
404
|
-
"@radix-ui/react-avatar": "1.
|
|
405
|
-
"@radix-ui/react-checkbox": "1.
|
|
406
|
-
"@radix-ui/react-context-menu": "2.
|
|
407
|
-
"@radix-ui/react-dialog": "1.1.
|
|
408
|
-
"@radix-ui/react-
|
|
409
|
-
"@radix-ui/react-
|
|
410
|
-
"@radix-ui/react-
|
|
411
|
-
"@radix-ui/react-
|
|
412
|
-
"@radix-ui/react-
|
|
413
|
-
"@radix-ui/react-
|
|
414
|
-
"@radix-ui/react-
|
|
415
|
-
"@radix-ui/react-
|
|
416
|
-
"@radix-ui/react-
|
|
417
|
-
"@radix-ui/react-toast": "1.2.2",
|
|
418
|
-
"@radix-ui/react-tooltip": "1.1.2",
|
|
403
|
+
"@radix-ui/react-accordion": "1.2.20",
|
|
404
|
+
"@radix-ui/react-avatar": "1.2.6",
|
|
405
|
+
"@radix-ui/react-checkbox": "1.3.11",
|
|
406
|
+
"@radix-ui/react-context-menu": "2.3.7",
|
|
407
|
+
"@radix-ui/react-dialog": "1.1.23",
|
|
408
|
+
"@radix-ui/react-dropdown-menu": "2.1.24",
|
|
409
|
+
"@radix-ui/react-hover-card": "1.1.23",
|
|
410
|
+
"@radix-ui/react-popover": "1.1.23",
|
|
411
|
+
"@radix-ui/react-radio-group": "1.4.7",
|
|
412
|
+
"@radix-ui/react-separator": "1.1.15",
|
|
413
|
+
"@radix-ui/react-switch": "1.3.7",
|
|
414
|
+
"@radix-ui/react-tabs": "1.1.21",
|
|
415
|
+
"@radix-ui/react-toast": "1.2.23",
|
|
416
|
+
"@radix-ui/react-tooltip": "1.2.16",
|
|
419
417
|
"class-variance-authority": "^0.7.1",
|
|
420
418
|
"clsx": "^2.1.1",
|
|
421
419
|
"dayjs": "^1.11.19",
|
|
@@ -449,7 +447,7 @@
|
|
|
449
447
|
"@types/react-window": "^1.8.8",
|
|
450
448
|
"@types/sortablejs": "^1.15.2",
|
|
451
449
|
"@vitejs/plugin-react": "^5.1.2",
|
|
452
|
-
"chromatic": "^
|
|
450
|
+
"chromatic": "^18.6.0",
|
|
453
451
|
"eslint": "^9",
|
|
454
452
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
455
453
|
"eslint-plugin-import": "^2.32.0",
|