@infonomic/uikit 5.41.0 → 5.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/@types/shared.d.ts +52 -0
- package/dist/components/@types/shared.d.ts.map +1 -1
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.module.css +1 -2
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.module.css +6 -7
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.module.css +6 -7
- package/dist/components/button/@types/button.d.ts +31 -1
- package/dist/components/button/@types/button.d.ts.map +1 -1
- package/dist/components/button/button-group.module.css +1 -3
- package/dist/components/button/button.module.css +48 -31
- package/dist/components/button/combo-button.d.ts.map +1 -1
- package/dist/components/button/combo-button.module.css +3 -3
- package/dist/components/button/control-buttons.module.css +1 -2
- package/dist/components/button/copy-button.d.ts.map +1 -1
- package/dist/components/button/copy-button.module.css +6 -7
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.module.css +6 -10
- package/dist/components/chips/@types/chip.d.ts +20 -0
- package/dist/components/chips/@types/chip.d.ts.map +1 -1
- package/dist/components/chips/chip.d.ts.map +1 -1
- package/dist/components/chips/chip.module.css +30 -19
- package/dist/components/container/container.d.ts.map +1 -1
- package/dist/components/container/container.module.css +6 -10
- package/dist/components/dropdown/dropdown.module.css +6 -7
- package/dist/components/forms/@types/checkbox.d.ts +28 -1
- package/dist/components/forms/@types/checkbox.d.ts.map +1 -1
- package/dist/components/forms/@types/input.d.ts +29 -1
- package/dist/components/forms/@types/input.d.ts.map +1 -1
- package/dist/components/forms/calendar.module.css +14 -14
- package/dist/components/forms/checkbox-group.d.ts.map +1 -1
- package/dist/components/forms/checkbox.d.ts.map +1 -1
- package/dist/components/forms/checkbox.module.css +12 -17
- package/dist/components/forms/checkbox.module.js +0 -1
- package/dist/components/forms/checkbox_module.css +3 -13
- package/dist/components/forms/error-text.module.css +6 -7
- package/dist/components/forms/help-text.d.ts.map +1 -1
- package/dist/components/forms/help-text.module.css +6 -7
- package/dist/components/forms/input-adornment.module.css +6 -7
- package/dist/components/forms/input-password.d.ts.map +1 -1
- package/dist/components/forms/input.d.ts.map +1 -1
- package/dist/components/forms/input.module.css +6 -7
- package/dist/components/forms/label.module.css +6 -7
- package/dist/components/forms/radio-group.module.css +6 -7
- package/dist/components/forms/select.d.ts.map +1 -1
- package/dist/components/forms/select.js +1 -1
- package/dist/components/forms/select.module.css +74 -3
- package/dist/components/forms/select.module.js +10 -0
- package/dist/components/forms/select_module.css +63 -3
- package/dist/components/forms/text-area.module.css +10 -9
- package/dist/components/notifications/@types/alert.d.ts +16 -1
- package/dist/components/notifications/@types/alert.d.ts.map +1 -1
- package/dist/components/notifications/@types/toast.d.ts +36 -1
- package/dist/components/notifications/@types/toast.d.ts.map +1 -1
- package/dist/components/notifications/alert.d.ts.map +1 -1
- package/dist/components/notifications/alert.module.css +6 -7
- package/dist/components/notifications/toast.module.css +6 -8
- package/dist/components/overlay/overlay.module.css +6 -4
- package/dist/components/pager/@types/index.d.ts +12 -0
- package/dist/components/pager/@types/index.d.ts.map +1 -1
- package/dist/components/pager/pagination.module.css +6 -8
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.module.css +6 -7
- package/dist/components/scroll-to-top/scroll-to-top.module.css +5 -7
- package/dist/components/section/section.d.ts.map +1 -1
- package/dist/components/section/section.module.css +6 -7
- package/dist/components/shimmer/shimmer.module.css +6 -8
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.module.css +6 -8
- package/dist/components/tabs/tabs.module.css +6 -7
- package/dist/components/tooltip/tooltip.module.css +6 -7
- package/dist/icons/eye-closed-icon.d.ts.map +1 -1
- package/dist/icons/eye-open-icon.d.ts.map +1 -1
- package/dist/icons/icons.module.css +1 -1
- package/dist/widgets/datepicker/datepicker.d.ts.map +1 -1
- package/dist/widgets/datepicker/datepicker.module.css +1 -2
- package/dist/widgets/drawer/drawer-container.d.ts.map +1 -1
- package/dist/widgets/drawer/drawer-content.d.ts.map +1 -1
- package/dist/widgets/drawer/drawer.module.css +1 -3
- package/dist/widgets/modal/modal-actions.d.ts.map +1 -1
- package/dist/widgets/modal/modal-container.d.ts.map +1 -1
- package/dist/widgets/modal/modal-content.d.ts.map +1 -1
- package/dist/widgets/modal/modal.module.css +1 -3
- package/dist/widgets/timeline/timeline.module.css +6 -8
- package/package.json +1 -1
- package/src/components/@types/shared.ts +55 -0
- package/src/components/accordion/accordion.module.css +1 -2
- package/src/components/accordion/accordion.stories.tsx +1 -2
- package/src/components/accordion/accordion.tsx +25 -5
- package/src/components/avatar/avatar.module.css +6 -7
- package/src/components/avatar/avatar.tsx +9 -2
- package/src/components/badge/badge.module.css +6 -7
- package/src/components/badge/badge.tsx +7 -1
- package/src/components/button/@types/button.ts +36 -1
- package/src/components/button/button-group.module.css +1 -3
- package/src/components/button/button.module.css +48 -31
- package/src/components/button/button.tsx +1 -1
- package/src/components/button/combo-button.module.css +3 -3
- package/src/components/button/combo-button.tsx +17 -5
- package/src/components/button/combo-buttons.stories.tsx +6 -3
- package/src/components/button/control-buttons.module.css +1 -2
- package/src/components/button/copy-button.module.css +6 -7
- package/src/components/button/copy-button.tsx +12 -3
- package/src/components/card/card.module.css +6 -10
- package/src/components/card/card.tsx +20 -4
- package/src/components/chips/@types/chip.ts +22 -0
- package/src/components/chips/chip.module.css +30 -19
- package/src/components/chips/chip.tsx +10 -5
- package/src/components/container/container.module.css +6 -10
- package/src/components/container/container.tsx +1 -1
- package/src/components/dropdown/dropdown.module.css +6 -7
- package/src/components/forms/@types/checkbox.ts +31 -1
- package/src/components/forms/@types/input.ts +32 -1
- package/src/components/forms/calendar.module.css +14 -14
- package/src/components/forms/checkbox-group.tsx +1 -1
- package/src/components/forms/checkbox.module.css +12 -17
- package/src/components/forms/checkbox.tsx +4 -1
- package/src/components/forms/error-text.module.css +6 -7
- package/src/components/forms/help-text.module.css +6 -7
- package/src/components/forms/help-text.tsx +5 -1
- package/src/components/forms/input-adornment.module.css +6 -7
- package/src/components/forms/input-password.tsx +7 -1
- package/src/components/forms/input.module.css +6 -7
- package/src/components/forms/input.tsx +18 -2
- package/src/components/forms/label.module.css +6 -7
- package/src/components/forms/radio-group.module.css +6 -7
- package/src/components/forms/select.module.css +74 -3
- package/src/components/forms/select.stories.tsx +47 -9
- package/src/components/forms/select.tsx +4 -2
- package/src/components/forms/text-area.module.css +10 -9
- package/src/components/notifications/@types/alert.ts +17 -1
- package/src/components/notifications/@types/toast.ts +40 -1
- package/src/components/notifications/alert.module.css +6 -7
- package/src/components/notifications/alert.tsx +10 -3
- package/src/components/notifications/toast.module.css +6 -8
- package/src/components/overlay/overlay.module.css +6 -4
- package/src/components/pager/@types/index.ts +13 -0
- package/src/components/pager/pagination.module.css +6 -8
- package/src/components/pager/pagination.tsx +6 -1
- package/src/components/scroll-area/scroll-area.module.css +6 -7
- package/src/components/scroll-area/scroll-area.tsx +13 -4
- package/src/components/scroll-to-top/scroll-to-top.module.css +5 -7
- package/src/components/section/section.module.css +6 -7
- package/src/components/section/section.tsx +1 -1
- package/src/components/shimmer/shimmer.module.css +6 -8
- package/src/components/table/table.module.css +6 -8
- package/src/components/table/table.tsx +6 -1
- package/src/components/tabs/tabs.module.css +6 -7
- package/src/components/tooltip/tooltip.module.css +6 -7
- package/src/icons/ai-icon.tsx +1 -1
- package/src/icons/eye-closed-icon.tsx +2 -1
- package/src/icons/eye-open-icon.tsx +1 -5
- package/src/icons/icons.module.css +1 -1
- package/src/styles/base/base.css +1 -1
- package/src/styles/base/colors.css +1 -2
- package/src/styles/components/loaders.css +1 -1
- package/src/styles/functional/colors.css +201 -56
- package/src/styles/functional/surfaces.css +1 -2
- package/src/styles/functional/typography.css +1 -1
- package/src/widgets/datepicker/datepicker.module.css +1 -2
- package/src/widgets/datepicker/datepicker.tsx +44 -16
- package/src/widgets/drawer/drawer-container.tsx +6 -1
- package/src/widgets/drawer/drawer-content.tsx +5 -1
- package/src/widgets/drawer/drawer.module.css +1 -3
- package/src/widgets/modal/modal-actions.tsx +5 -1
- package/src/widgets/modal/modal-container.tsx +5 -1
- package/src/widgets/modal/modal-content.tsx +5 -1
- package/src/widgets/modal/modal.module.css +1 -3
- package/src/widgets/timeline/timeline.module.css +6 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAMnC,KAAK,0BAA0B,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACpE,MAAM,WAAW,iBAAkB,SAAQ,0BAA0B;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,GAAyB,uCAK/C,iBAAiB,GAAG;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CACtC,
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../../../src/widgets/modal/modal-content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAMnC,KAAK,0BAA0B,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACpE,MAAM,WAAW,iBAAkB,SAAQ,0BAA0B;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,GAAyB,uCAK/C,iBAAiB,GAAG;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CACtC,sBAUA,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
-
|
|
5
4
|
.modal-wrapper,
|
|
6
5
|
:global(.infonomic-modal-open) {
|
|
7
6
|
position: fixed;
|
|
@@ -36,7 +35,6 @@
|
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
@media screen and (min-width: 40rem) {
|
|
39
|
-
|
|
40
38
|
.modal-container,
|
|
41
39
|
:global(.infonomic-modal-container) {
|
|
42
40
|
max-height: calc(100vh - 24px);
|
|
@@ -88,4 +86,4 @@
|
|
|
88
86
|
padding-left: var(--spacing-16);
|
|
89
87
|
padding-right: var(--spacing-16);
|
|
90
88
|
}
|
|
91
|
-
}
|
|
89
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
.timeline,
|
|
11
10
|
:global(.infonomic-timeline) {
|
|
12
11
|
margin-left: var(--spacing-8);
|
|
@@ -95,10 +94,9 @@ infonomic-components;
|
|
|
95
94
|
*/
|
|
96
95
|
:global(.dark),
|
|
97
96
|
:global([data-theme="dark"]) {
|
|
98
|
-
|
|
99
97
|
:global(.infonomic-timeline-icon),
|
|
100
98
|
.timeline-icon {
|
|
101
99
|
border-color: var(--canvas-600);
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
|
-
}
|
|
102
|
+
}
|
package/package.json
CHANGED
|
@@ -2,9 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// Arrays make available an iterator for easy storybook layout
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Available size tokens, ordered from smallest to largest.
|
|
7
|
+
* Most components default to `'md'`.
|
|
8
|
+
*/
|
|
5
9
|
export const size = ['xs', 'sm', 'md', 'lg', 'xl'] as const
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Visual size of a component.
|
|
13
|
+
*
|
|
14
|
+
* - `xs` — extra-small, compact inline use
|
|
15
|
+
* - `sm` — small, tight layouts
|
|
16
|
+
* - `md` — standard size (default for most components)
|
|
17
|
+
* - `lg` — large, prominent elements
|
|
18
|
+
* - `xl` — extra-large, hero or display use
|
|
19
|
+
*
|
|
20
|
+
* @default 'md'
|
|
21
|
+
*/
|
|
6
22
|
export type Size = (typeof size)[number]
|
|
7
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Available semantic color intents.
|
|
26
|
+
* Controls the visual meaning (color, icon) of a component.
|
|
27
|
+
*/
|
|
8
28
|
export const intent = [
|
|
9
29
|
'primary',
|
|
10
30
|
'secondary',
|
|
@@ -15,10 +35,45 @@ export const intent = [
|
|
|
15
35
|
'danger',
|
|
16
36
|
] as const
|
|
17
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Semantic color intent applied to a component.
|
|
40
|
+
*
|
|
41
|
+
* - `primary` — brand/main action (blue by default)
|
|
42
|
+
* - `secondary` — alternate/supporting action
|
|
43
|
+
* - `noeffect` — neutral, no color emphasis (gray)
|
|
44
|
+
* - `success` — positive outcome or confirmation (green)
|
|
45
|
+
* - `info` — informational, non-critical (cyan/blue)
|
|
46
|
+
* - `warning` — caution, needs attention (yellow/amber)
|
|
47
|
+
* - `danger` — destructive action or error state (red)
|
|
48
|
+
*
|
|
49
|
+
* @default 'primary'
|
|
50
|
+
*/
|
|
18
51
|
export type Intent = (typeof intent)[number]
|
|
19
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Status icon variants used inside notification components.
|
|
55
|
+
*/
|
|
20
56
|
export const icons = ['success', 'info', 'success', 'warning', 'danger'] as const
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Icon variant shown inside a notification (e.g. Toast, Alert).
|
|
60
|
+
* Maps to the corresponding status icon.
|
|
61
|
+
*/
|
|
21
62
|
export type Icons = (typeof icons)[number]
|
|
22
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Screen corner positions for floating elements.
|
|
66
|
+
*/
|
|
23
67
|
export const position = ['top-left', 'top-right', 'bottom-left', 'bottom-right'] as const
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Corner position for floating/overlay elements such as toasts and popovers.
|
|
71
|
+
*
|
|
72
|
+
* - `top-left` — top-left corner of the viewport
|
|
73
|
+
* - `top-right` — top-right corner of the viewport (default for toasts)
|
|
74
|
+
* - `bottom-left` — bottom-left corner of the viewport
|
|
75
|
+
* - `bottom-right` — bottom-right corner of the viewport
|
|
76
|
+
*
|
|
77
|
+
* @default 'top-right'
|
|
78
|
+
*/
|
|
24
79
|
export type Position = (typeof position)[number]
|
|
@@ -16,11 +16,10 @@ export default meta
|
|
|
16
16
|
|
|
17
17
|
type Story = StoryObj<typeof AccordionComponent.Root>
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
/**
|
|
21
20
|
* NOTE: Accordions are very much context specific in terms of styling
|
|
22
21
|
* and so we apply very little styling to the default accordion component.
|
|
23
|
-
* Below is an example of a custom (albeit basic) styled accordion for demo
|
|
22
|
+
* Below is an example of a custom (albeit basic) styled accordion for demo
|
|
24
23
|
* purposes.
|
|
25
24
|
*/
|
|
26
25
|
export const Accordion: Story = {
|
|
@@ -26,7 +26,11 @@ const Root = ({
|
|
|
26
26
|
ref?: React.RefObject<AccordionRootElement>
|
|
27
27
|
} & (AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps)) => {
|
|
28
28
|
return (
|
|
29
|
-
<AccordionPrimitive.Root
|
|
29
|
+
<AccordionPrimitive.Root
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={cx('infonomic-accordion-root', className)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
30
34
|
{children}
|
|
31
35
|
</AccordionPrimitive.Root>
|
|
32
36
|
)
|
|
@@ -42,7 +46,11 @@ const Item = function AccordionItem({
|
|
|
42
46
|
ref?: React.RefObject<AccordionItemElement>
|
|
43
47
|
}) {
|
|
44
48
|
return (
|
|
45
|
-
<AccordionPrimitive.Item
|
|
49
|
+
<AccordionPrimitive.Item
|
|
50
|
+
className={cx('infonomic-accordion-item', className)}
|
|
51
|
+
{...props}
|
|
52
|
+
ref={ref}
|
|
53
|
+
>
|
|
46
54
|
{children}
|
|
47
55
|
</AccordionPrimitive.Item>
|
|
48
56
|
)
|
|
@@ -58,7 +66,11 @@ const Header = function AccordionHeader({
|
|
|
58
66
|
ref?: React.RefObject<AccordionHeaderElement>
|
|
59
67
|
}) {
|
|
60
68
|
return (
|
|
61
|
-
<AccordionPrimitive.Header
|
|
69
|
+
<AccordionPrimitive.Header
|
|
70
|
+
className={cx('infonomic-accordion-header', className)}
|
|
71
|
+
{...props}
|
|
72
|
+
ref={ref}
|
|
73
|
+
>
|
|
62
74
|
{children}
|
|
63
75
|
</AccordionPrimitive.Header>
|
|
64
76
|
)
|
|
@@ -74,7 +86,11 @@ const Trigger = function AccordionTrigger({
|
|
|
74
86
|
ref?: React.RefObject<AccordionTriggerElement>
|
|
75
87
|
}) {
|
|
76
88
|
return (
|
|
77
|
-
<AccordionPrimitive.Trigger
|
|
89
|
+
<AccordionPrimitive.Trigger
|
|
90
|
+
ref={ref}
|
|
91
|
+
className={cx('infonomic-accordion-trigger', styles.trigger, className)}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
78
94
|
{children}
|
|
79
95
|
</AccordionPrimitive.Trigger>
|
|
80
96
|
)
|
|
@@ -90,7 +106,11 @@ const Content = function AccordionContent({
|
|
|
90
106
|
ref?: React.RefObject<AccordionContentElement>
|
|
91
107
|
}) {
|
|
92
108
|
return (
|
|
93
|
-
<AccordionPrimitive.Content
|
|
109
|
+
<AccordionPrimitive.Content
|
|
110
|
+
className={cx('infonomic-accordion-content', styles.content, className)}
|
|
111
|
+
{...props}
|
|
112
|
+
ref={ref}
|
|
113
|
+
>
|
|
94
114
|
{children}
|
|
95
115
|
</AccordionPrimitive.Content>
|
|
96
116
|
)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
/* relative inline-flex h-10 w-10 rounded-full */
|
|
11
10
|
.avatar-root,
|
|
12
11
|
:global(.infonomic-avatar-root) {
|
|
@@ -60,4 +59,4 @@ infonomic-components;
|
|
|
60
59
|
color: var(--gray-400);
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
}
|
|
62
|
+
}
|
|
@@ -12,8 +12,15 @@ const url = 'https://picsum.photos/150'
|
|
|
12
12
|
export const Avatar = ({ initials }: { initials: string }): React.JSX.Element => {
|
|
13
13
|
return (
|
|
14
14
|
<AvatarPrimitive.Root className={cx('infonomic-avatar-root', styles['avatar-root'])}>
|
|
15
|
-
<AvatarPrimitive.Image
|
|
16
|
-
|
|
15
|
+
<AvatarPrimitive.Image
|
|
16
|
+
src={url}
|
|
17
|
+
alt="Avatar"
|
|
18
|
+
className={cx('infonomic-avatar-image', styles['avatar-image'])}
|
|
19
|
+
/>
|
|
20
|
+
<AvatarPrimitive.Fallback
|
|
21
|
+
className={cx('infonomic-avatar-fallback', styles['avatar-fallback'])}
|
|
22
|
+
delayMs={600}
|
|
23
|
+
>
|
|
17
24
|
<span className={cx('infonomic-avatar-text', styles['avatar-text'])}>{initials}</span>
|
|
18
25
|
</AvatarPrimitive.Fallback>
|
|
19
26
|
</AvatarPrimitive.Root>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
.badge,
|
|
11
10
|
:global(.infonomic-badge) {
|
|
12
11
|
display: inline-block;
|
|
@@ -64,4 +63,4 @@ infonomic-components;
|
|
|
64
63
|
|
|
65
64
|
/* Dark mode - All intents now handled by semantic tokens in theme layer */
|
|
66
65
|
/* No overrides needed! Tokens automatically switch in .dark and respect .not-dark */
|
|
67
|
-
}
|
|
66
|
+
}
|
|
@@ -34,7 +34,13 @@ export const Badge = <C extends React.ElementType = 'div'>({
|
|
|
34
34
|
return (
|
|
35
35
|
<Comp
|
|
36
36
|
ref={ref}
|
|
37
|
-
className={cx(
|
|
37
|
+
className={cx(
|
|
38
|
+
'infonomic-badge',
|
|
39
|
+
`infonomic-badge-${intent}`,
|
|
40
|
+
styles.badge,
|
|
41
|
+
styles[intent],
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
38
44
|
{...rest}
|
|
39
45
|
>
|
|
40
46
|
{children}
|
|
@@ -2,14 +2,49 @@
|
|
|
2
2
|
import type { Size as s, Intent as t } from '../../@types/shared.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* This file contains the types and prop-types for Button and IconButton
|
|
5
|
+
* This file contains the types and prop-types for the Button and IconButton components.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
// typescript types
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Available visual style variants for Button and IconButton.
|
|
12
|
+
*/
|
|
9
13
|
export const variant = ['filled', 'filled-weak', 'outlined', 'gradient', 'text'] as const
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Visual style variant of the button.
|
|
17
|
+
*
|
|
18
|
+
* - `filled` — solid background fill using the intent color (default)
|
|
19
|
+
* - `filled-weak` — lightly tinted background, lower visual weight than `filled`
|
|
20
|
+
* - `outlined` — transparent background with an intent-colored border
|
|
21
|
+
* - `gradient` — gradient background from intent start to end color
|
|
22
|
+
* - `text` — no background or border, label only (like a hyperlink)
|
|
23
|
+
*
|
|
24
|
+
* @default 'filled'
|
|
25
|
+
*/
|
|
10
26
|
export type Variant = (typeof variant)[number]
|
|
11
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Size of the button. Inherits from the shared `Size` type.
|
|
30
|
+
* @default 'md'
|
|
31
|
+
*/
|
|
12
32
|
export type Size = 'md' | s
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Semantic color intent of the button. Inherits from the shared `Intent` type.
|
|
36
|
+
* @default 'primary'
|
|
37
|
+
*/
|
|
13
38
|
export type Intent = 'primary' | t
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* When `true`, the button expands to fill 100% of its container width.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
14
44
|
export type FullWidth = boolean
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* When `true`, enables a Material-style ripple animation on click/tap.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
15
50
|
export type EnableRipple = boolean
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
-
|
|
5
4
|
.button-group,
|
|
6
5
|
:global(.infonomic-button-group) {
|
|
7
6
|
display: flex;
|
|
@@ -12,10 +11,9 @@
|
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
@media screen and (min-width: 40rem) {
|
|
15
|
-
|
|
16
14
|
.button-group,
|
|
17
15
|
:global(.infonomic-button-group) {
|
|
18
16
|
flex-direction: row;
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
}
|
|
19
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
.button,
|
|
11
10
|
:global(.infonomic-button) {
|
|
12
11
|
border: none;
|
|
@@ -117,10 +116,14 @@ infonomic-components;
|
|
|
117
116
|
.filled[disabled],
|
|
118
117
|
:global(.infonomic-button-filled):disabled,
|
|
119
118
|
:global(.infonomic-button-filled)[disabled] {
|
|
120
|
-
background-color: var(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
background-color: var(
|
|
120
|
+
--button-variant-filled-disabled,
|
|
121
|
+
oklch(from var(--button-variant-filled) calc(l * 1.1) calc(c * 0.85) h)
|
|
122
|
+
);
|
|
123
|
+
color: var(
|
|
124
|
+
--button-variant-filled-foreground-disabled,
|
|
125
|
+
oklch(from var(--button-variant-filled-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
126
|
+
);
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
/* -------------------------------------------------------- */
|
|
@@ -148,10 +151,14 @@ infonomic-components;
|
|
|
148
151
|
.filled-weak[disabled],
|
|
149
152
|
:global(.infonomic-button-filled-weak):disabled,
|
|
150
153
|
:global(.infonomic-button-filled-weak)[disabled] {
|
|
151
|
-
background-color: var(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
background-color: var(
|
|
155
|
+
--button-variant-filled-weak-disabled,
|
|
156
|
+
oklch(from var(--button-variant-filled-weak) calc(l * 1.1) calc(c * 0.85) h)
|
|
157
|
+
);
|
|
158
|
+
color: var(
|
|
159
|
+
--button-variant-filled-weak-foreground-disabled,
|
|
160
|
+
oklch(from var(--button-variant-filled-weak-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
161
|
+
);
|
|
155
162
|
}
|
|
156
163
|
|
|
157
164
|
.outlined,
|
|
@@ -165,10 +172,14 @@ infonomic-components;
|
|
|
165
172
|
.outlined[disabled],
|
|
166
173
|
:global(.infonomic-button-outlined):disabled,
|
|
167
174
|
:global(.infonomic-button-outlined)[disabled] {
|
|
168
|
-
border-color: var(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
border-color: var(
|
|
176
|
+
--button-variant-outlined-border-disabled,
|
|
177
|
+
oklch(from var(--button-variant-outlined-border) calc(l * 1.5) calc(c * 0.8) h)
|
|
178
|
+
);
|
|
179
|
+
color: var(
|
|
180
|
+
--button-variant-outlined-foreground-disabled,
|
|
181
|
+
oklch(from var(--button-variant-outlined-foreground) calc(l * 1.1) calc(c * 0.7) h)
|
|
182
|
+
);
|
|
172
183
|
}
|
|
173
184
|
|
|
174
185
|
.outlined:hover,
|
|
@@ -186,9 +197,11 @@ infonomic-components;
|
|
|
186
197
|
.gradient,
|
|
187
198
|
:global(.infonomic-button-gradient) {
|
|
188
199
|
color: var(--button-variant-gradient-foreground);
|
|
189
|
-
background: linear-gradient(
|
|
190
|
-
|
|
191
|
-
|
|
200
|
+
background: linear-gradient(
|
|
201
|
+
45deg,
|
|
202
|
+
var(--button-variant-gradient-start),
|
|
203
|
+
var(--button-variant-gradient-end)
|
|
204
|
+
);
|
|
192
205
|
}
|
|
193
206
|
|
|
194
207
|
.gradient:disabled,
|
|
@@ -196,18 +209,24 @@ infonomic-components;
|
|
|
196
209
|
:global(.infonomic-button-gradient):disabled,
|
|
197
210
|
:global(.infonomic-button-gradient)[disabled] {
|
|
198
211
|
background: unset;
|
|
199
|
-
background-color: var(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
212
|
+
background-color: var(
|
|
213
|
+
--button-variant-gradient-disabled,
|
|
214
|
+
oklch(from var(--button-variant-gradient-end) calc(l * 1.2) calc(c * 0.85) h)
|
|
215
|
+
);
|
|
216
|
+
color: var(
|
|
217
|
+
--button-variant-gradient-foreground-disabled,
|
|
218
|
+
oklch(from var(--button-variant-gradient-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
219
|
+
);
|
|
203
220
|
}
|
|
204
221
|
|
|
205
222
|
.gradient:hover,
|
|
206
223
|
:global(.infonomic-button-gradient):hover {
|
|
207
224
|
color: var(--button-variant-gradient-foreground);
|
|
208
|
-
background: linear-gradient(
|
|
209
|
-
|
|
210
|
-
|
|
225
|
+
background: linear-gradient(
|
|
226
|
+
45deg,
|
|
227
|
+
var(--button-variant-gradient-start),
|
|
228
|
+
var(--button-variant-gradient-end)
|
|
229
|
+
);
|
|
211
230
|
}
|
|
212
231
|
|
|
213
232
|
.gradient:focus,
|
|
@@ -274,7 +293,6 @@ infonomic-components;
|
|
|
274
293
|
--button-variant-text-hover: var(--fill-primary-text-hover);
|
|
275
294
|
--button-variant-text-foreground: var(--text-primary);
|
|
276
295
|
|
|
277
|
-
|
|
278
296
|
/* Gradient */
|
|
279
297
|
--button-variant-gradient-start: var(--gradient-primary-start);
|
|
280
298
|
--button-variant-gradient-end: var(--gradient-primary-end);
|
|
@@ -340,7 +358,6 @@ infonomic-components;
|
|
|
340
358
|
--button-variant-filled-weak-foreground: var(--text-on-noeffect-weak);
|
|
341
359
|
--button-variant-filled-weak-foreground-disabled: var(--text-on-noeffect-weak-disabled);
|
|
342
360
|
|
|
343
|
-
|
|
344
361
|
/* Outlined */
|
|
345
362
|
--button-variant-outlined: var(--fill-noeffect-outlined);
|
|
346
363
|
--button-variant-outlined-hover: var(--fill-noeffect-outlined-hover);
|
|
@@ -525,4 +542,4 @@ infonomic-components;
|
|
|
525
542
|
width: 100%;
|
|
526
543
|
display: flex;
|
|
527
544
|
}
|
|
528
|
-
}
|
|
545
|
+
}
|
|
@@ -51,7 +51,7 @@ export const Button = <C extends React.ElementType = 'button'>({
|
|
|
51
51
|
const rippleEffect = new Ripple()
|
|
52
52
|
onMouseDown = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
53
53
|
if (rest.onMouseDown) {
|
|
54
|
-
;
|
|
54
|
+
;(rest.onMouseDown as React.MouseEventHandler<HTMLButtonElement>)(e)
|
|
55
55
|
}
|
|
56
56
|
rippleEffect.create(e, variant === 'filled' || variant === 'gradient' ? 'light' : 'dark')
|
|
57
57
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
-
|
|
5
4
|
.combo-button-wrapper,
|
|
6
5
|
:global(.infonomic-combo-button-wrapper) {
|
|
7
6
|
display: flex;
|
|
@@ -39,5 +38,6 @@
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
.combo-button-options-item,
|
|
42
|
-
:global(.infonomic-combo-button-options-item) {
|
|
43
|
-
}
|
|
41
|
+
:global(.infonomic-combo-button-options-item) {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -15,13 +15,12 @@ export type ComboButtonProps = ButtonProps & {
|
|
|
15
15
|
children?: React.ReactNode
|
|
16
16
|
align?: 'start' | 'center' | 'end'
|
|
17
17
|
dataSide?: 'top' | 'bottom' | 'left' | 'right'
|
|
18
|
-
sideOffset?: number
|
|
18
|
+
sideOffset?: number
|
|
19
19
|
className?: string
|
|
20
20
|
buttonClassName?: string
|
|
21
21
|
triggerClassName?: string
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
export const ComboButton = ({
|
|
26
25
|
options,
|
|
27
26
|
onButtonClick,
|
|
@@ -40,12 +39,21 @@ export const ComboButton = ({
|
|
|
40
39
|
}: ComboButtonProps) => {
|
|
41
40
|
return (
|
|
42
41
|
<div className={cx('combo-button-wrapper', styles['combo-button-wrapper'], className)}>
|
|
43
|
-
<Button
|
|
42
|
+
<Button
|
|
43
|
+
className={cx('combo-button-button', styles['combo-button-button'], buttonClassName)}
|
|
44
|
+
disabled={disabled || buttonDisabled}
|
|
45
|
+
{...rest}
|
|
46
|
+
onClick={onButtonClick}
|
|
47
|
+
>
|
|
44
48
|
{children}
|
|
45
49
|
</Button>
|
|
46
50
|
<DropdownComponent.Root>
|
|
47
51
|
<DropdownComponent.Trigger asChild>
|
|
48
|
-
<Button
|
|
52
|
+
<Button
|
|
53
|
+
className={cx('combo-button-trigger', styles['combo-button-trigger'], triggerClassName)}
|
|
54
|
+
disabled={disabled || optionsDisabled}
|
|
55
|
+
{...rest}
|
|
56
|
+
>
|
|
49
57
|
<ChevronDownIcon width="16px" height="16px" />
|
|
50
58
|
</Button>
|
|
51
59
|
</DropdownComponent.Trigger>
|
|
@@ -63,7 +71,11 @@ export const ComboButton = ({
|
|
|
63
71
|
key={option.value}
|
|
64
72
|
onSelect={() => onOptionSelect?.(option.value)}
|
|
65
73
|
>
|
|
66
|
-
<div
|
|
74
|
+
<div
|
|
75
|
+
className={cx('combo-button-options-item', styles['combo-button-options-item'])}
|
|
76
|
+
>
|
|
77
|
+
{option.label}
|
|
78
|
+
</div>
|
|
67
79
|
</DropdownComponent.Item>
|
|
68
80
|
))}
|
|
69
81
|
</DropdownComponent.Content>
|
|
@@ -28,7 +28,8 @@ const ComboButtonDemo = (): React.JSX.Element => {
|
|
|
28
28
|
size="sm"
|
|
29
29
|
options={options}
|
|
30
30
|
onButtonClick={handleButtonClick}
|
|
31
|
-
onOptionSelect={handleOptionSelect}
|
|
31
|
+
onOptionSelect={handleOptionSelect}
|
|
32
|
+
>
|
|
32
33
|
Combo Button
|
|
33
34
|
</ComboButton>
|
|
34
35
|
</div>
|
|
@@ -40,7 +41,8 @@ const ComboButtonDemo = (): React.JSX.Element => {
|
|
|
40
41
|
size="sm"
|
|
41
42
|
options={[]}
|
|
42
43
|
onButtonClick={handleButtonClick}
|
|
43
|
-
onOptionSelect={handleOptionSelect}
|
|
44
|
+
onOptionSelect={handleOptionSelect}
|
|
45
|
+
>
|
|
44
46
|
Combo Button
|
|
45
47
|
</ComboButton>
|
|
46
48
|
</div>
|
|
@@ -54,7 +56,8 @@ const ComboButtonDemo = (): React.JSX.Element => {
|
|
|
54
56
|
options={options}
|
|
55
57
|
onButtonClick={handleButtonClick}
|
|
56
58
|
onOptionSelect={handleOptionSelect}
|
|
57
|
-
disabled={true}
|
|
59
|
+
disabled={true}
|
|
60
|
+
>
|
|
58
61
|
Combo Button
|
|
59
62
|
</ComboButton>
|
|
60
63
|
</div>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
-
|
|
5
4
|
.stop-button,
|
|
6
5
|
.play-button,
|
|
7
6
|
.directional-button,
|
|
@@ -132,4 +131,4 @@
|
|
|
132
131
|
/* No dark theme overrides needed!
|
|
133
132
|
* Tokens automatically switch in .dark and respect .not-dark
|
|
134
133
|
*/
|
|
135
|
-
}
|
|
134
|
+
}
|