@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.
Files changed (50) hide show
  1. package/dist/icons.cjs +8 -0
  2. package/dist/icons.js +1 -1
  3. package/dist/index.cjs +240 -38
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.js +230 -41
  6. package/dist/index.js.map +1 -1
  7. package/dist/markdown-editor.cjs +39 -16
  8. package/dist/markdown-editor.cjs.map +1 -1
  9. package/dist/markdown-editor.js +39 -16
  10. package/dist/markdown-editor.js.map +1 -1
  11. package/dist/mermaid.cjs +32 -9
  12. package/dist/mermaid.cjs.map +1 -1
  13. package/dist/mermaid.js +32 -9
  14. package/dist/mermaid.js.map +1 -1
  15. package/dist/styles.css +1 -1
  16. package/package.json +5 -4
  17. package/src/blocks/EmptyState/EmptyState.tsx +2 -2
  18. package/src/blocks/ErrorState/ErrorState.tsx +18 -3
  19. package/src/blocks/InputOtp/InputOtp.stories.tsx +214 -0
  20. package/src/blocks/InputOtp/InputOtp.test.tsx +162 -0
  21. package/src/blocks/InputOtp/InputOtp.tsx +62 -0
  22. package/src/blocks/InputOtp/InputOtpGroup.tsx +13 -0
  23. package/src/blocks/InputOtp/InputOtpSeparator.tsx +23 -0
  24. package/src/blocks/InputOtp/InputOtpSlot.styles.ts +52 -0
  25. package/src/blocks/InputOtp/InputOtpSlot.tsx +44 -0
  26. package/src/blocks/InputOtp/context.ts +23 -0
  27. package/src/blocks/InputOtp/index.ts +23 -0
  28. package/src/components/Alert/AlertIcon.tsx +1 -1
  29. package/src/components/Badge/BadgeAddon.tsx +1 -1
  30. package/src/components/Badge/BadgeButton.tsx +1 -1
  31. package/src/components/Breadcrumb/BreadcrumbLink.tsx +1 -1
  32. package/src/components/Breadcrumb/BreadcrumbSeparator.tsx +1 -1
  33. package/src/components/Button/styles.ts +33 -10
  34. package/src/components/Combobox/ComboboxItemIndicator.tsx +1 -1
  35. package/src/components/Command/CommandItem/CommandItem.tsx +1 -1
  36. package/src/components/DropdownMenu/DropdownMenuItemIndicator.tsx +4 -4
  37. package/src/components/DropdownMenu/ItemIcon.tsx +1 -1
  38. package/src/components/Modal/ModalIcon.tsx +1 -1
  39. package/src/components/Navbar/NavbarMenuItemAdornment.tsx +2 -2
  40. package/src/components/Pagination/PaginationEllipsis.tsx +1 -1
  41. package/src/components/Select/SelectContent.tsx +1 -1
  42. package/src/components/Sidebar/SidebarGroup/SidebarGroupAction.tsx +1 -1
  43. package/src/components/Sidebar/SidebarMenu/SidebarMenuAction.tsx +1 -1
  44. package/src/components/Sidebar/SidebarMenu/SidebarMenuIcon.tsx +1 -1
  45. package/src/components/Timeline/TimelineConnector.tsx +5 -1
  46. package/src/components/Toast/ToastDismiss.tsx +1 -1
  47. package/src/components/Toast/ToastRoot.tsx +1 -1
  48. package/src/components/Toggle/Toggle.tsx +1 -1
  49. package/src/icons/index.ts +2 -0
  50. 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',
@@ -12,7 +12,7 @@ const addonVariants = cva(
12
12
  'tw-self-stretch',
13
13
  'tw-px-1',
14
14
  'has-[button]:tw-px-0',
15
- '[&_svg]:tw-size-3',
15
+ '[&_svg:not([class*="tw-size-"])]:tw-size-3',
16
16
  ],
17
17
  {
18
18
  defaultVariants: {
@@ -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
  >
@@ -36,7 +36,7 @@ export const BreadcrumbLink = ({
36
36
  'focus-visible:tw-rounded-sm',
37
37
 
38
38
  // Icon
39
- '[&_svg]:tw-size-3.5',
39
+ '[&_svg:not([class*="tw-size-"])]:tw-size-3.5',
40
40
 
41
41
  // transition
42
42
  'tw-transition-colors',
@@ -17,7 +17,7 @@ export const BreadcrumbSeparator = ({ children, className, ...props }: Props) =>
17
17
 
18
18
  'tw-aspect-square',
19
19
  'tw-size-[15px]',
20
- '[&_svg]:tw-size-2.5',
20
+ '[&_svg:not([class*="tw-size-"])]:tw-size-2.5',
21
21
  'tw-text-muted-foreground',
22
22
  className,
23
23
  )}
@@ -143,16 +143,39 @@ export const variants = cva(
143
143
  ],
144
144
  },
145
145
  size: {
146
- medium: ['tw-max-h-10', 'tw-min-h-10', 'tw-px-4', 'tw-py-2.5', '[&_svg]:tw-size-4'],
147
- small: ['tw-max-h-8', 'tw-min-h-8', 'tw-px-4', 'tw-py-1.5', '[&_svg]:tw-size-4'],
148
- large: ['tw-max-h-12', 'tw-min-h-12', 'tw-px-4', 'tw-py-3.5', '[&_svg]:tw-size-4'],
149
-
150
- 'icon-lg': ['tw-size-12', 'tw-p-0', '[&_svg]:tw-size-6'],
151
- icon: ['tw-size-10', 'tw-p-0', '[&_svg]:tw-size-4'],
152
- 'icon-sm': ['tw-size-8', 'tw-p-0', '[&_svg]:tw-size-4'],
153
- 'icon-xs': ['tw-size-6', 'tw-p-0', '[&_svg]:tw-size-4'],
154
- 'icon-2xs': ['!tw-inline-flex', 'tw-size-5', 'tw-max-h-5', '[&_svg]:tw-size-3'],
155
- 'icon-3xs': ['tw-h-fit', 'tw-w-fit', '[&_svg]:tw-size-4'],
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-max-h-9', 'tw-leading-9', 'tw-p-0'],
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
  },
@@ -16,7 +16,7 @@ export const PaginationEllipsis = ({ className, ...props }: Props) => (
16
16
  'tw-justify-center',
17
17
 
18
18
  'tw-text-foreground',
19
- '[&_svg]:tw-size-4',
19
+ '[&_svg:not([class*="tw-size-"])]:tw-size-4',
20
20
  className,
21
21
  )}
22
22
  {...props}
@@ -10,7 +10,7 @@ const scrollButtonStyles = cn(
10
10
  'tw-justify-center',
11
11
  'tw-rounded-sm',
12
12
  'tw-p-1',
13
- '[&_svg]:tw-size-5',
13
+ '[&_svg:not([class*="tw-size-"])]:tw-size-5',
14
14
  );
15
15
 
16
16
  type Variant = 'default' | 'argo';
@@ -34,7 +34,7 @@ export const SidebarGroupAction = ({
34
34
  'tw-rounded-full',
35
35
 
36
36
  // svg defaults: size + colour
37
- '[&_svg]:tw-size-3',
37
+ '[&_svg:not([class*="tw-size-"])]:tw-size-3',
38
38
  '[&_svg]:tw-text-neutral-400',
39
39
  'hover:[&_svg]:tw-text-secondary-600',
40
40
 
@@ -51,7 +51,7 @@ export const SidebarMenuAction = ({
51
51
 
52
52
  // icon styling
53
53
  '[&_svg]:tw-shrink-0',
54
- '[&_svg]:tw-size-3.5',
54
+ '[&_svg:not([class*="tw-size-"])]:tw-size-3.5',
55
55
  '[&_svg]:tw-text-sidebar-accent-foreground',
56
56
 
57
57
  // focus visible
@@ -21,7 +21,7 @@ export const SidebarMenuIcon = ({
21
21
  'tw-shrink-0',
22
22
  'tw-p-0.5',
23
23
  'tw-text-sidebar-primary',
24
- '[&_svg]:tw-size-4',
24
+ '[&_svg:not([class*="tw-size-"])]:tw-size-4',
25
25
  className,
26
26
  )}
27
27
  >
@@ -74,7 +74,11 @@ const connector = cva(
74
74
  'tw-text-nowrap',
75
75
  'tw-text-xs',
76
76
  ],
77
- icon: ['tw-bg-white', '[&_svg]:tw-size-4', '[&_svg]:tw-text-neutral-300'],
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',
@@ -20,7 +20,7 @@ export const ToastDismiss = ({
20
20
  'tw-row-start-1',
21
21
  'tailwindcss-preflight',
22
22
  '[&_svg]:tw-aspect-square',
23
- '[&_svg]:tw-size-4',
23
+ '[&_svg:not([class*="tw-size-"])]:tw-size-4',
24
24
  '[&_svg]:tw-m-1',
25
25
 
26
26
  'tw-text-white',
@@ -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
  )}
@@ -21,6 +21,7 @@ export {
21
21
  BellRing,
22
22
  Bold,
23
23
  BookOpen,
24
+ Box,
24
25
  Braces,
25
26
  Bug,
26
27
  Calendar,
@@ -161,6 +162,7 @@ export {
161
162
  StickyNote,
162
163
  Strikethrough,
163
164
  Table,
165
+ TableProperties,
164
166
  ThumbsDown,
165
167
  ThumbsUp,
166
168
  ToggleRight,
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';