@keboola/design 2.0.0 → 2.0.1
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/icons.cjs +8 -0
- package/dist/icons.js +1 -1
- package/dist/index.cjs +240 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +230 -41
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.cjs +39 -16
- package/dist/markdown-editor.cjs.map +1 -1
- package/dist/markdown-editor.js +39 -16
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.cjs +32 -9
- package/dist/mermaid.cjs.map +1 -1
- package/dist/mermaid.js +32 -9
- package/dist/mermaid.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -4
- package/src/blocks/EmptyState/EmptyState.tsx +2 -2
- package/src/blocks/ErrorState/ErrorState.tsx +18 -3
- package/src/blocks/InputOtp/InputOtp.stories.tsx +214 -0
- package/src/blocks/InputOtp/InputOtp.test.tsx +162 -0
- package/src/blocks/InputOtp/InputOtp.tsx +62 -0
- package/src/blocks/InputOtp/InputOtpGroup.tsx +13 -0
- package/src/blocks/InputOtp/InputOtpSeparator.tsx +23 -0
- package/src/blocks/InputOtp/InputOtpSlot.styles.ts +52 -0
- package/src/blocks/InputOtp/InputOtpSlot.tsx +44 -0
- package/src/blocks/InputOtp/context.ts +23 -0
- package/src/blocks/InputOtp/index.ts +23 -0
- package/src/components/Alert/AlertIcon.tsx +1 -1
- package/src/components/Badge/BadgeAddon.tsx +1 -1
- package/src/components/Badge/BadgeButton.tsx +1 -1
- package/src/components/Breadcrumb/BreadcrumbLink.tsx +1 -1
- package/src/components/Breadcrumb/BreadcrumbSeparator.tsx +1 -1
- package/src/components/Button/styles.ts +33 -10
- package/src/components/Combobox/ComboboxItemIndicator.tsx +1 -1
- package/src/components/Command/CommandItem/CommandItem.tsx +1 -1
- package/src/components/DropdownMenu/DropdownMenuItemIndicator.tsx +4 -4
- package/src/components/DropdownMenu/ItemIcon.tsx +1 -1
- package/src/components/Modal/ModalIcon.tsx +1 -1
- package/src/components/Navbar/NavbarMenuItemAdornment.tsx +2 -2
- package/src/components/Pagination/PaginationEllipsis.tsx +1 -1
- package/src/components/Select/SelectContent.tsx +1 -1
- package/src/components/Sidebar/SidebarGroup/SidebarGroupAction.tsx +1 -1
- package/src/components/Sidebar/SidebarMenu/SidebarMenuAction.tsx +1 -1
- package/src/components/Sidebar/SidebarMenu/SidebarMenuIcon.tsx +1 -1
- package/src/components/Timeline/TimelineConnector.tsx +5 -1
- package/src/components/Toast/ToastDismiss.tsx +1 -1
- package/src/components/Toast/ToastRoot.tsx +1 -1
- package/src/components/Toggle/Toggle.tsx +1 -1
- package/src/icons/index.ts +2 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { use } from 'react';
|
|
2
|
+
import { OTPInputContext, type RenderProps } from 'input-otp';
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
REGEXP_ONLY_CHARS,
|
|
6
|
+
REGEXP_ONLY_DIGITS,
|
|
7
|
+
REGEXP_ONLY_DIGITS_AND_CHARS,
|
|
8
|
+
type SlotProps as InputOtpRenderSlotProps,
|
|
9
|
+
} from 'input-otp';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Access the `input-otp` render context (slots, focus, hover) — use this inside a custom
|
|
13
|
+
* child of `<InputOtp>` to render slots yourself. Throws if called outside `<InputOtp>`.
|
|
14
|
+
*/
|
|
15
|
+
export const useInputOtpContext = (): RenderProps => {
|
|
16
|
+
const ctx = use(OTPInputContext);
|
|
17
|
+
if (!ctx.slots) {
|
|
18
|
+
throw new Error('useInputOtpContext must be used inside <InputOtp>.');
|
|
19
|
+
}
|
|
20
|
+
return ctx;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export * from './InputOtp';
|
|
@@ -27,7 +27,7 @@ export const AlertIcon = ({ variant, icon, className, ...rest }: Props) => (
|
|
|
27
27
|
'tw-justify-center',
|
|
28
28
|
'tw-self-start',
|
|
29
29
|
'tw-p-0.5',
|
|
30
|
-
'[&_svg]:tw-size-4',
|
|
30
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
31
31
|
'group-data-[variant=info]/alert:tw-text-secondary-500',
|
|
32
32
|
'group-data-[variant=warning]/alert:tw-text-warning-500',
|
|
33
33
|
'group-data-[variant=error]/alert:tw-text-error-500',
|
|
@@ -31,7 +31,7 @@ export const BadgeButton = ({
|
|
|
31
31
|
// Default sizing for Lucide-icon children (which ship at 24×24); keeps
|
|
32
32
|
// the visual baseline aligned with the previous FA-icon API and other
|
|
33
33
|
// icon-wrapper components (ItemIcon, SidebarMenuIcon).
|
|
34
|
-
'[&_svg]:tw-size-3',
|
|
34
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-3',
|
|
35
35
|
className,
|
|
36
36
|
)}
|
|
37
37
|
>
|
|
@@ -143,16 +143,39 @@ export const variants = cva(
|
|
|
143
143
|
],
|
|
144
144
|
},
|
|
145
145
|
size: {
|
|
146
|
-
medium: [
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
146
|
+
medium: [
|
|
147
|
+
'tw-max-h-10',
|
|
148
|
+
'tw-min-h-10',
|
|
149
|
+
'tw-px-4',
|
|
150
|
+
'tw-py-2.5',
|
|
151
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
152
|
+
],
|
|
153
|
+
small: [
|
|
154
|
+
'tw-max-h-8',
|
|
155
|
+
'tw-min-h-8',
|
|
156
|
+
'tw-px-4',
|
|
157
|
+
'tw-py-1.5',
|
|
158
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
159
|
+
],
|
|
160
|
+
large: [
|
|
161
|
+
'tw-max-h-12',
|
|
162
|
+
'tw-min-h-12',
|
|
163
|
+
'tw-px-4',
|
|
164
|
+
'tw-py-3.5',
|
|
165
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
166
|
+
],
|
|
167
|
+
|
|
168
|
+
'icon-lg': ['tw-size-12', 'tw-p-0', '[&_svg:not([class*="tw-size-"])]:tw-size-6'],
|
|
169
|
+
icon: ['tw-size-10', 'tw-p-0', '[&_svg:not([class*="tw-size-"])]:tw-size-4'],
|
|
170
|
+
'icon-sm': ['tw-size-8', 'tw-p-0', '[&_svg:not([class*="tw-size-"])]:tw-size-4'],
|
|
171
|
+
'icon-xs': ['tw-size-6', 'tw-p-0', '[&_svg:not([class*="tw-size-"])]:tw-size-4'],
|
|
172
|
+
'icon-2xs': [
|
|
173
|
+
'!tw-inline-flex',
|
|
174
|
+
'tw-size-5',
|
|
175
|
+
'tw-max-h-5',
|
|
176
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-3',
|
|
177
|
+
],
|
|
178
|
+
'icon-3xs': ['tw-h-fit', 'tw-w-fit', '[&_svg:not([class*="tw-size-"])]:tw-size-4'],
|
|
156
179
|
},
|
|
157
180
|
},
|
|
158
181
|
},
|
|
@@ -67,7 +67,7 @@ export const ComboboxItemIndicator = ({
|
|
|
67
67
|
'group-data-[variant=default]/combobox-content:tw-right-4',
|
|
68
68
|
// Lucide SVGs default to 24×24 — constrain the rendered child so the
|
|
69
69
|
// 16px indicator slot owns the actual size.
|
|
70
|
-
'[&_svg]:tw-size-4',
|
|
70
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
71
71
|
'group-data-[highlighted]/combobox-item:tw-text-accent-foreground',
|
|
72
72
|
'group-data-[variant=default]/combobox-content:group-data-[highlighted]/combobox-item:tw-text-foreground',
|
|
73
73
|
className,
|
|
@@ -69,7 +69,7 @@ export const CommandItem = ({
|
|
|
69
69
|
>
|
|
70
70
|
<CheckIndicator variant={variant} />
|
|
71
71
|
{icon && (
|
|
72
|
-
<span className="tw-inline-flex tw-size-4 tw-shrink-0 tw-items-center tw-justify-center tw-text-neutral-400 [&_svg]:tw-size-4">
|
|
72
|
+
<span className="tw-inline-flex tw-size-4 tw-shrink-0 tw-items-center tw-justify-center tw-text-neutral-400 [&_svg:not([class*='tw-size-'])]:tw-size-4">
|
|
73
73
|
{icon}
|
|
74
74
|
</span>
|
|
75
75
|
)}
|
|
@@ -31,7 +31,7 @@ const variants = cva(
|
|
|
31
31
|
'tw-rounded-full',
|
|
32
32
|
'tw-bg-white',
|
|
33
33
|
|
|
34
|
-
'[&_svg]:tw-size-2',
|
|
34
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-2',
|
|
35
35
|
'[&_svg]:data-[state=unchecked]:tw-hidden',
|
|
36
36
|
// Lucide Circle is stroke-only — force fill to match the stroke
|
|
37
37
|
// (currentColor) so the indicator reads as a solid dot.
|
|
@@ -39,7 +39,7 @@ const variants = cva(
|
|
|
39
39
|
'group-data-[variant=argo]/dropdown-menu-content:[&_svg]:tw-text-primary',
|
|
40
40
|
'group-data-[variant=default]/dropdown-menu-content:[&_svg]:tw-text-secondary-500',
|
|
41
41
|
],
|
|
42
|
-
check: ['[&_svg]:tw-size-3.5', '[&_svg]:tw-text-primary'],
|
|
42
|
+
check: ['[&_svg:not([class*="tw-size-"])]:tw-size-3.5', '[&_svg]:tw-text-primary'],
|
|
43
43
|
checkbox: [
|
|
44
44
|
'[&_svg]:tw-text-white',
|
|
45
45
|
'tw-border',
|
|
@@ -47,7 +47,7 @@ const variants = cva(
|
|
|
47
47
|
'tw-border-neutral-200',
|
|
48
48
|
'tw-rounded',
|
|
49
49
|
|
|
50
|
-
'[&_svg]:tw-size-3',
|
|
50
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-3',
|
|
51
51
|
'[&_svg]:data-[state=unchecked]:tw-hidden',
|
|
52
52
|
'group-data-[variant=argo]/dropdown-menu-content:data-[state=checked]:tw-border-primary',
|
|
53
53
|
'group-data-[variant=argo]/dropdown-menu-content:data-[state=checked]:tw-bg-primary',
|
|
@@ -58,7 +58,7 @@ const variants = cva(
|
|
|
58
58
|
'tw-size-5',
|
|
59
59
|
// Lucide SVGs default to 24×24 — constrain the rendered ToggleRight
|
|
60
60
|
// to the indicator slot so it doesn't overflow.
|
|
61
|
-
'[&_svg]:tw-size-5',
|
|
61
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-5',
|
|
62
62
|
'tw-text-neutral-400',
|
|
63
63
|
'data-[state=unchecked]:tw-rotate-180',
|
|
64
64
|
'group-data-[variant=default]/dropdown-menu-content:data-[state=checked]:tw-text-secondary-500',
|
|
@@ -17,7 +17,7 @@ export const ItemIcon = ({ className, children, ...props }: Props) => (
|
|
|
17
17
|
// 20px container fits the 16px Lucide glyph plus 2px breathing room
|
|
18
18
|
// each side — the previous tw-size-4 + tw-p-0.5 clipped the 16px child.
|
|
19
19
|
'tw-size-5',
|
|
20
|
-
'[&_svg]:tw-size-4',
|
|
20
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
21
21
|
'group-data-[variant=default]/dropdown-menu-content:tw-text-neutral-400',
|
|
22
22
|
'group-data-[variant=argo]/dropdown-menu-content:tw-text-primary',
|
|
23
23
|
'group-data-[variant=argo]/dropdown-menu-content:group-aria-disabled:tw-text-muted-foreground',
|
|
@@ -96,7 +96,7 @@ export const ModalIcon = (props: Props) => {
|
|
|
96
96
|
'tw-text-white': props.color !== 'violet',
|
|
97
97
|
'tw-text-purple-500': props.color === 'violet',
|
|
98
98
|
},
|
|
99
|
-
'[&_svg]:tw-size-6',
|
|
99
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-6',
|
|
100
100
|
'[&_svg]:tw-aspect-square',
|
|
101
101
|
)}
|
|
102
102
|
>
|
|
@@ -9,7 +9,7 @@ const variants = cva(
|
|
|
9
9
|
'tw-justify-center',
|
|
10
10
|
'tw-items-center',
|
|
11
11
|
|
|
12
|
-
'[&_svg]:tw-size-3',
|
|
12
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-3',
|
|
13
13
|
'[&:not(svg)]:tw-h-5',
|
|
14
14
|
'[&:not(svg)]:tw-min-w-5',
|
|
15
15
|
|
|
@@ -43,7 +43,7 @@ const variants = cva(
|
|
|
43
43
|
'group-data-[accent=orange]/navbar:tw-bg-warning-500',
|
|
44
44
|
'group-data-[accent=green]/navbar:tw-bg-primary-500',
|
|
45
45
|
],
|
|
46
|
-
'icon-button': ['tw-size-4', 'tw-
|
|
46
|
+
'icon-button': ['tw-size-4', '!tw-p-0', '[&_svg:not([class*="tw-size-"])]:tw-size-4'],
|
|
47
47
|
shortcut: ['tw-bg-muted', 'tw-text-sidebar-foreground', 'tw-ml-auto'],
|
|
48
48
|
},
|
|
49
49
|
},
|
|
@@ -74,7 +74,11 @@ const connector = cva(
|
|
|
74
74
|
'tw-text-nowrap',
|
|
75
75
|
'tw-text-xs',
|
|
76
76
|
],
|
|
77
|
-
icon: [
|
|
77
|
+
icon: [
|
|
78
|
+
'tw-bg-white',
|
|
79
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-4',
|
|
80
|
+
'[&_svg]:tw-text-neutral-300',
|
|
81
|
+
],
|
|
78
82
|
line: [
|
|
79
83
|
'tw-min-w-8',
|
|
80
84
|
'tw-overflow-hidden',
|
|
@@ -112,7 +112,7 @@ export const ToastRoot = ({
|
|
|
112
112
|
'tw-aspect-square',
|
|
113
113
|
'tw-size-5',
|
|
114
114
|
'tw-shrink-0',
|
|
115
|
-
'[&_svg]:tw-size-5',
|
|
115
|
+
'[&_svg:not([class*="tw-size-"])]:tw-size-5',
|
|
116
116
|
'tw-text-white',
|
|
117
117
|
'group-data-[variant=default]/toast:tw-text-popover-foreground',
|
|
118
118
|
)}
|
|
@@ -185,7 +185,7 @@ export const Toggle = ({
|
|
|
185
185
|
</span>
|
|
186
186
|
)}
|
|
187
187
|
{icon && (
|
|
188
|
-
<span className="tw-inline-flex tw-size-4 tw-shrink-0 tw-items-center tw-justify-center tw-align-middle [&_svg]:tw-size-4">
|
|
188
|
+
<span className="tw-inline-flex tw-size-4 tw-shrink-0 tw-items-center tw-justify-center tw-align-middle [&_svg:not([class*='tw-size-'])]:tw-size-4">
|
|
189
189
|
{renderLegacyIcon(icon)}
|
|
190
190
|
</span>
|
|
191
191
|
)}
|
package/src/icons/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -81,6 +81,7 @@ export * from './blocks/AutoSaveTextarea';
|
|
|
81
81
|
export * from './blocks/ColorInput';
|
|
82
82
|
export * from './blocks/NumberInput';
|
|
83
83
|
export * from './blocks/PasswordInput';
|
|
84
|
+
export * from './blocks/InputOtp';
|
|
84
85
|
export * from './blocks/Form';
|
|
85
86
|
export { Truncated } from './components/Truncated';
|
|
86
87
|
export * from './components/ZoomableSvg';
|