@sybilion/uilib 1.6.0 → 1.7.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/README.md +2 -1
- package/assets/base.css +3 -4
- package/assets/globals.css +1 -1
- package/dist/esm/src/components/ui/AnalysesSelector/AnalysesSelector.styl.js +1 -1
- package/dist/esm/src/components/ui/AppHeader/AppHeader.styl.js +1 -1
- package/dist/esm/src/components/ui/Breadcrumb/Breadcrumb.styl.js +1 -1
- package/dist/esm/src/components/ui/Button/Button.js +2 -2
- package/dist/esm/src/components/ui/Button/Button.styl.js +2 -2
- package/dist/esm/src/components/ui/Checkbox/Checkbox.styl.js +1 -1
- package/dist/esm/src/components/ui/Chip/Chip.styl.js +1 -1
- package/dist/esm/src/components/ui/DatePicker/DatePicker.styl.js +1 -1
- package/dist/esm/src/components/ui/Dialog/Dialog.styl.js +1 -1
- package/dist/esm/src/components/ui/DropdownMenu/DropdownMenu.styl.js +1 -1
- package/dist/esm/src/components/ui/FileChip/FileChip.styl.js +1 -1
- package/dist/esm/src/components/ui/Input/Input.js +3 -3
- package/dist/esm/src/components/ui/Input/Input.styl.js +2 -2
- package/dist/esm/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.styl.js +1 -1
- package/dist/esm/src/components/ui/Notifications/Notifications.styl.js +1 -1
- package/dist/esm/src/components/ui/RadioGroup/RadioGroup.styl.js +1 -1
- package/dist/esm/src/components/ui/Select/Select.js +5 -5
- package/dist/esm/src/components/ui/Select/Select.styl.js +2 -2
- package/dist/esm/src/components/ui/Sheet/Sheet.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarGroupAction/SidebarGroupAction.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuAction/SidebarMenuAction.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuButton/SidebarMenuButton.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarMenuSubButton/SidebarMenuSubButton.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarRail/SidebarRail.styl.js +1 -1
- package/dist/esm/src/components/ui/Sidebar/SidebarResizeHandle/SidebarResizeHandle.styl.js +1 -1
- package/dist/esm/src/components/ui/Slider/Slider.styl.js +1 -1
- package/dist/esm/src/components/ui/SupplyChainMap/SupplyChainMap.styl.js +1 -1
- package/dist/esm/src/components/ui/SupplyChainMap/use-map-base-renderer.js +2 -2
- package/dist/esm/src/components/ui/Switch/Switch.styl.js +1 -1
- package/dist/esm/src/components/ui/Tabs/Tabs.styl.js +1 -1
- package/dist/esm/src/components/ui/Toggle/Toggle.styl.js +1 -1
- package/dist/esm/src/components/ui/ToggleGroup/ToggleGroup.styl.js +1 -1
- package/dist/esm/src/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.styl.js +1 -1
- package/dist/esm/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.js +1 -1
- package/dist/esm/types/src/components/ui/Button/Button.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Button/Button.types.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Input/Input.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Input/Input.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Select/Select.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +2 -0
- package/dist/esm/types/src/docs/config/vite.config.d.ts +2 -0
- package/dist/esm/types/tests/buttonStyles.test.d.ts +1 -0
- package/dist/esm/types/tests/focusOutline.test.d.ts +1 -0
- package/package.json +28 -37
- package/src/components/ui/Button/Button.styl +122 -104
- package/src/components/ui/Button/Button.styl.d.ts +1 -0
- package/src/components/ui/Button/Button.tsx +2 -0
- package/src/components/ui/Button/Button.types.ts +2 -0
- package/src/components/ui/Input/Input.styl +4 -0
- package/src/components/ui/Input/Input.styl.d.ts +1 -0
- package/src/components/ui/Input/Input.tsx +34 -20
- package/src/components/ui/Input/Input.types.ts +4 -0
- package/src/components/ui/Select/Select.styl +4 -0
- package/src/components/ui/Select/Select.styl.d.ts +1 -0
- package/src/components/ui/Select/Select.tsx +5 -0
- package/src/components/ui/Select/Select.types.ts +2 -0
- package/src/components/ui/SupplyChainMap/use-map-base-renderer.ts +2 -1
- package/src/docs/config/vite.config.ts +253 -0
- package/src/docs/pages/ButtonPage.tsx +33 -1
- package/src/docs/pages/InputPage.tsx +31 -1
- package/src/docs/pages/SelectPage.tsx +34 -1
- package/src/lib/theme.styl +3 -1
- package/assets/index.html +0 -18
- package/src/docs/config/webpack.config.js +0 -275
|
@@ -1,129 +1,147 @@
|
|
|
1
1
|
@import 'lib/theme.styl'
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
border 0
|
|
20
|
-
focus-outline()
|
|
21
|
-
|
|
22
|
-
&:active
|
|
23
|
-
opacity 0.8
|
|
24
|
-
|
|
25
|
-
&:disabled
|
|
26
|
-
pointer-events none
|
|
27
|
-
opacity 0.5
|
|
28
|
-
|
|
29
|
-
&[aria-invalid="true"]
|
|
30
|
-
border-color var(--destructive)
|
|
31
|
-
ring 3px var(--destructive-200)
|
|
32
|
-
|
|
33
|
-
// SVG icon styles
|
|
34
|
-
svg
|
|
35
|
-
pointer-events none
|
|
3
|
+
// Component styles live in a CSS cascade layer, so an app's own unlayered rules
|
|
4
|
+
// win over them without specificity tricks (`[data-slot="button"].x`, !important).
|
|
5
|
+
// The order is declared here too, so `components` sits above base.css's `base`
|
|
6
|
+
// layer even when this stylesheet is the first of the two to load.
|
|
7
|
+
@css {
|
|
8
|
+
@layer base, components;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@layer components
|
|
12
|
+
|
|
13
|
+
// Base button styles
|
|
14
|
+
.root
|
|
15
|
+
display inline-flex
|
|
16
|
+
align-items center
|
|
17
|
+
justify-content center
|
|
18
|
+
gap var(--p-2)
|
|
36
19
|
flex-shrink 0
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
20
|
+
white-space nowrap
|
|
21
|
+
border-radius var(--radius-button)
|
|
22
|
+
font-family var(--font-family-body, 'Manrope', sans-serif)
|
|
23
|
+
font-size 15px
|
|
24
|
+
font-weight 500
|
|
25
|
+
line-height 1
|
|
26
|
+
outline none
|
|
27
|
+
cursor pointer
|
|
28
|
+
transition all var(--dur-base) var(--ease-standard)
|
|
29
|
+
border 0
|
|
30
|
+
focus-outline()
|
|
31
|
+
|
|
32
|
+
&:active:where(:not(:disabled))
|
|
33
|
+
opacity 0.8
|
|
34
|
+
|
|
35
|
+
// Not pointer-events none: a disabled button must still receive hover so its
|
|
36
|
+
// `title` can say why. Hover and active styles are guarded instead, inside
|
|
37
|
+
// :where() so the guard adds no specificity (an app override that beat
|
|
38
|
+
// `.root:hover` must keep beating it).
|
|
39
|
+
&:disabled
|
|
40
|
+
cursor not-allowed
|
|
41
|
+
opacity 0.5
|
|
42
|
+
|
|
43
|
+
&[aria-invalid="true"]
|
|
44
|
+
border-color var(--destructive)
|
|
45
|
+
ring 3px var(--destructive-200)
|
|
46
|
+
|
|
47
|
+
// SVG icon styles
|
|
48
|
+
svg
|
|
49
|
+
pointer-events none
|
|
50
|
+
flex-shrink 0
|
|
51
|
+
// width 16px
|
|
52
|
+
// height 16px
|
|
53
|
+
|
|
54
|
+
// Variant styles
|
|
55
|
+
.default
|
|
56
|
+
background-color var(--primary)
|
|
57
|
+
color var(--primary-foreground)
|
|
58
|
+
|
|
59
|
+
&:hover:where(:not(:disabled))
|
|
60
|
+
background-color var(--sb-gray-800)
|
|
50
61
|
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
color white
|
|
62
|
+
:global(.dark) &
|
|
63
|
+
background-color var(--sb-gray-600)
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
background-color var(--destructive-
|
|
65
|
+
.destructive
|
|
66
|
+
background-color var(--destructive-900)
|
|
67
|
+
color white
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
background-color var(--background)
|
|
69
|
+
&:hover:where(:not(:disabled))
|
|
70
|
+
background-color var(--destructive-600)
|
|
61
71
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
.outline
|
|
73
|
+
border 1px solid var(--border)
|
|
74
|
+
background-color var(--background)
|
|
65
75
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
&:hover:where(:not(:disabled))
|
|
77
|
+
background-color var(--sb-gray-50)
|
|
78
|
+
border-color var(--border)
|
|
69
79
|
|
|
70
|
-
|
|
71
|
-
background-color var(--sb-gray-
|
|
80
|
+
:global(.dark) &
|
|
81
|
+
background-color var(--sb-gray-900)
|
|
82
|
+
border-color var(--border)
|
|
72
83
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
color var(--secondary-foreground)
|
|
84
|
+
&:hover:where(:not(:disabled))
|
|
85
|
+
background-color var(--sb-gray-800)
|
|
76
86
|
|
|
77
|
-
|
|
78
|
-
background-color var(--secondary
|
|
87
|
+
.secondary
|
|
88
|
+
background-color var(--secondary)
|
|
89
|
+
color var(--secondary-foreground)
|
|
79
90
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
background-color var(--sb-gray-100)
|
|
83
|
-
color var(--foreground)
|
|
91
|
+
&:hover:where(:not(:disabled))
|
|
92
|
+
background-color var(--secondary-800)
|
|
84
93
|
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
.ghost
|
|
95
|
+
&:hover:where(:not(:disabled))
|
|
96
|
+
background-color var(--sb-gray-100)
|
|
97
|
+
color var(--foreground)
|
|
87
98
|
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
text-decoration underline
|
|
91
|
-
text-underline-offset 4px
|
|
99
|
+
:global(.dark) &
|
|
100
|
+
background-color var(--sb-gray-900)
|
|
92
101
|
|
|
93
|
-
|
|
102
|
+
.link
|
|
103
|
+
color var(--primary)
|
|
94
104
|
text-decoration underline
|
|
105
|
+
text-underline-offset 4px
|
|
95
106
|
|
|
96
|
-
|
|
107
|
+
&:hover:where(:not(:disabled))
|
|
108
|
+
text-decoration underline
|
|
97
109
|
|
|
98
|
-
|
|
99
|
-
height 30px
|
|
100
|
-
padding 0 14px
|
|
101
|
-
font-size var(--text-sm)
|
|
102
|
-
border-radius var(--p-5)
|
|
110
|
+
// Size styles
|
|
103
111
|
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
.sizeSm
|
|
113
|
+
height 30px
|
|
114
|
+
padding 0 14px
|
|
115
|
+
font-size var(--text-sm)
|
|
116
|
+
border-radius var(--p-5)
|
|
108
117
|
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
border-radius var(--p-4)
|
|
118
|
+
.sizeMd
|
|
119
|
+
height 44px
|
|
120
|
+
padding 0 var(--p-4)
|
|
121
|
+
border-radius var(--p-4)
|
|
114
122
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
.sizeLg
|
|
124
|
+
height 48px
|
|
125
|
+
padding 0 var(--p-6)
|
|
126
|
+
font-size var(--text-base)
|
|
127
|
+
border-radius var(--p-4)
|
|
118
128
|
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
// Icon buttons: square, sized per size variant, same radius as the size variant
|
|
130
|
+
.sizeIcon
|
|
121
131
|
padding 0
|
|
122
132
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
&.sizeSm
|
|
134
|
+
width 30px
|
|
135
|
+
padding 0
|
|
126
136
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
&.sizeMd
|
|
138
|
+
width 44px
|
|
139
|
+
padding 0
|
|
140
|
+
|
|
141
|
+
&.sizeLg
|
|
142
|
+
width 48px
|
|
143
|
+
padding 0
|
|
144
|
+
|
|
145
|
+
// Pill corners; after the size rules so it overrides their radius
|
|
146
|
+
.round
|
|
147
|
+
border-radius 100px
|
|
@@ -13,6 +13,7 @@ function Button({
|
|
|
13
13
|
variant = 'default',
|
|
14
14
|
size = 'md',
|
|
15
15
|
icon = false,
|
|
16
|
+
round = false,
|
|
16
17
|
asChild = false,
|
|
17
18
|
...props
|
|
18
19
|
}: ButtonProps) {
|
|
@@ -26,6 +27,7 @@ function Button({
|
|
|
26
27
|
S[variant],
|
|
27
28
|
sizeClass(size),
|
|
28
29
|
icon && S.sizeIcon,
|
|
30
|
+
round && S.round,
|
|
29
31
|
className,
|
|
30
32
|
)}
|
|
31
33
|
{...props}
|
|
@@ -11,5 +11,7 @@ export interface ButtonProps extends React.ComponentProps<'button'> {
|
|
|
11
11
|
size?: 'sm' | 'md' | 'lg';
|
|
12
12
|
/** Square icon-only button (fixed width/height); use with `size` ignored for dimensions. */
|
|
13
13
|
icon?: boolean;
|
|
14
|
+
/** Fully rounded (pill) corners: `border-radius: 100px`. */
|
|
15
|
+
round?: boolean;
|
|
14
16
|
asChild?: boolean;
|
|
15
17
|
}
|
|
@@ -7,35 +7,49 @@ import type { InputProps } from './Input.types';
|
|
|
7
7
|
const Input = React.forwardRef<
|
|
8
8
|
HTMLInputElement | HTMLTextAreaElement,
|
|
9
9
|
InputProps
|
|
10
|
-
>(
|
|
11
|
-
|
|
10
|
+
>(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
className,
|
|
14
|
+
type,
|
|
15
|
+
size = 'md',
|
|
16
|
+
variant = 'default',
|
|
17
|
+
round = false,
|
|
18
|
+
...props
|
|
19
|
+
},
|
|
20
|
+
ref,
|
|
21
|
+
) => {
|
|
22
|
+
if (type === 'textarea') {
|
|
23
|
+
return (
|
|
24
|
+
<textarea
|
|
25
|
+
ref={ref as React.ForwardedRef<HTMLTextAreaElement>}
|
|
26
|
+
className={cn(
|
|
27
|
+
S.root,
|
|
28
|
+
S[`size-${size}`],
|
|
29
|
+
S[`variant-${variant}`],
|
|
30
|
+
round && S.round,
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...(props as React.ComponentProps<'textarea'>)}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
12
37
|
return (
|
|
13
|
-
<
|
|
14
|
-
ref={ref as React.ForwardedRef<
|
|
38
|
+
<input
|
|
39
|
+
ref={ref as React.ForwardedRef<HTMLInputElement>}
|
|
15
40
|
className={cn(
|
|
16
41
|
S.root,
|
|
17
42
|
S[`size-${size}`],
|
|
18
43
|
S[`variant-${variant}`],
|
|
44
|
+
round && S.round,
|
|
19
45
|
className,
|
|
20
46
|
)}
|
|
21
|
-
{
|
|
47
|
+
type={type}
|
|
48
|
+
{...(props as React.ComponentProps<'input'>)}
|
|
22
49
|
/>
|
|
23
50
|
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
<input
|
|
27
|
-
ref={ref as React.ForwardedRef<HTMLInputElement>}
|
|
28
|
-
className={cn(
|
|
29
|
-
S.root,
|
|
30
|
-
S[`size-${size}`],
|
|
31
|
-
S[`variant-${variant}`],
|
|
32
|
-
className,
|
|
33
|
-
)}
|
|
34
|
-
type={type}
|
|
35
|
-
{...(props as React.ComponentProps<'input'>)}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
});
|
|
51
|
+
},
|
|
52
|
+
);
|
|
39
53
|
|
|
40
54
|
Input.displayName = 'Input';
|
|
41
55
|
|
|
@@ -3,9 +3,13 @@ export type InputProps =
|
|
|
3
3
|
type?: React.ComponentProps<'input'>['type'];
|
|
4
4
|
size?: 'sm' | 'md' | 'lg';
|
|
5
5
|
variant?: 'default' | 'clean';
|
|
6
|
+
/** Fully rounded (pill) corners: `border-radius: 100px`. */
|
|
7
|
+
round?: boolean;
|
|
6
8
|
})
|
|
7
9
|
| (Omit<React.ComponentProps<'textarea'>, 'type' | 'size'> & {
|
|
8
10
|
type: 'textarea';
|
|
9
11
|
size?: 'sm' | 'md' | 'lg';
|
|
10
12
|
variant?: 'default' | 'clean';
|
|
13
|
+
/** Fully rounded (pill) corners: `border-radius: 100px`. */
|
|
14
|
+
round?: boolean;
|
|
11
15
|
});
|
|
@@ -257,6 +257,7 @@ function SearchableTrigger({
|
|
|
257
257
|
size = 'md',
|
|
258
258
|
variant = 'default',
|
|
259
259
|
darker = false,
|
|
260
|
+
round = false,
|
|
260
261
|
hideChevron = false,
|
|
261
262
|
disabled: disabledProp,
|
|
262
263
|
style,
|
|
@@ -303,6 +304,7 @@ function SearchableTrigger({
|
|
|
303
304
|
S.selectTrigger,
|
|
304
305
|
S.searchable,
|
|
305
306
|
darker && S.darker,
|
|
307
|
+
round && S.round,
|
|
306
308
|
variant === 'clear' && S.clear,
|
|
307
309
|
className,
|
|
308
310
|
)}
|
|
@@ -390,6 +392,7 @@ function SelectTrigger({
|
|
|
390
392
|
size = 'md',
|
|
391
393
|
variant = 'default',
|
|
392
394
|
darker = false,
|
|
395
|
+
round = false,
|
|
393
396
|
children,
|
|
394
397
|
hideChevron = false,
|
|
395
398
|
asChild = false,
|
|
@@ -405,6 +408,7 @@ function SelectTrigger({
|
|
|
405
408
|
size={size}
|
|
406
409
|
variant={variant}
|
|
407
410
|
darker={darker}
|
|
411
|
+
round={round}
|
|
408
412
|
hideChevron={hideChevron}
|
|
409
413
|
{...props}
|
|
410
414
|
/>
|
|
@@ -420,6 +424,7 @@ function SelectTrigger({
|
|
|
420
424
|
className={cn(
|
|
421
425
|
!asChild && S.selectTrigger,
|
|
422
426
|
!asChild && darker && S.darker,
|
|
427
|
+
!asChild && round && S.round,
|
|
423
428
|
!asChild && variant === 'clear' && S.clear,
|
|
424
429
|
className,
|
|
425
430
|
)}
|
|
@@ -6,6 +6,8 @@ export interface SelectTriggerProps extends React.ComponentProps<
|
|
|
6
6
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
7
7
|
variant?: 'default' | 'clear';
|
|
8
8
|
darker?: boolean;
|
|
9
|
+
/** Fully rounded (pill) corners: `border-radius: 100px`. */
|
|
10
|
+
round?: boolean;
|
|
9
11
|
className?: string;
|
|
10
12
|
children?: React.ReactNode;
|
|
11
13
|
hideChevron?: boolean;
|
|
@@ -65,11 +65,12 @@ export function useMapBaseRenderer(
|
|
|
65
65
|
|
|
66
66
|
let worker: Worker;
|
|
67
67
|
try {
|
|
68
|
-
// Bundlers (
|
|
68
|
+
// Bundlers (Vite docs, webpack, Next) resolve this worker entry.
|
|
69
69
|
// Published Rollup output may keep a .ts URL — paint then falls back
|
|
70
70
|
// to the main-thread path below.
|
|
71
71
|
worker = new Worker(
|
|
72
72
|
new URL('./SupplyChainMap.render.worker.ts', import.meta.url),
|
|
73
|
+
{ type: 'module' },
|
|
73
74
|
);
|
|
74
75
|
} catch {
|
|
75
76
|
forceMainRef.current = true;
|