@mindlogic-ai/logician-ui 3.0.0 → 3.1.0-alpha.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/Avatar/Avatar.js +1 -1
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.mjs +1 -1
- package/dist/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/components/Badge/Badge.styles.js +5 -3
- package/dist/components/Badge/Badge.styles.js.map +1 -1
- package/dist/components/Badge/Badge.styles.mjs +5 -3
- package/dist/components/Badge/Badge.styles.mjs.map +1 -1
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +39 -33
- package/dist/components/Button/Button.styles.js.map +1 -1
- package/dist/components/Button/Button.styles.mjs +39 -33
- package/dist/components/Button/Button.styles.mjs.map +1 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.mjs +1 -1
- package/dist/components/Card/Card.mjs.map +1 -1
- package/dist/components/Checkbox/CheckboxControl.d.ts.map +1 -1
- package/dist/components/Checkbox/CheckboxControl.js +9 -3
- package/dist/components/Checkbox/CheckboxControl.js.map +1 -1
- package/dist/components/Checkbox/CheckboxControl.mjs +9 -3
- package/dist/components/Checkbox/CheckboxControl.mjs.map +1 -1
- package/dist/components/Chip/Chip.styles.d.ts.map +1 -1
- package/dist/components/Chip/Chip.styles.js +14 -11
- package/dist/components/Chip/Chip.styles.js.map +1 -1
- package/dist/components/Chip/Chip.styles.mjs +14 -11
- package/dist/components/Chip/Chip.styles.mjs.map +1 -1
- package/dist/components/Code/Code.js +4 -4
- package/dist/components/Code/Code.js.map +1 -1
- package/dist/components/Code/Code.mjs +4 -4
- package/dist/components/Code/Code.mjs.map +1 -1
- package/dist/components/CodeTabs/CopyButton.js +1 -1
- package/dist/components/CodeTabs/CopyButton.mjs +1 -1
- package/dist/components/Collapsible/CollapsibleRoot.js +1 -1
- package/dist/components/Collapsible/CollapsibleRoot.js.map +1 -1
- package/dist/components/Collapsible/CollapsibleRoot.mjs +1 -1
- package/dist/components/Collapsible/CollapsibleRoot.mjs.map +1 -1
- package/dist/components/Collapsible/CollapsibleTrigger.js +1 -1
- package/dist/components/Collapsible/CollapsibleTrigger.js.map +1 -1
- package/dist/components/Collapsible/CollapsibleTrigger.mjs +1 -1
- package/dist/components/Collapsible/CollapsibleTrigger.mjs.map +1 -1
- package/dist/components/ColorMode/ColorModeProvider.d.ts +39 -0
- package/dist/components/ColorMode/ColorModeProvider.d.ts.map +1 -0
- package/dist/components/ColorMode/ColorModeProvider.js +39 -0
- package/dist/components/ColorMode/ColorModeProvider.js.map +1 -0
- package/dist/components/ColorMode/ColorModeProvider.mjs +37 -0
- package/dist/components/ColorMode/ColorModeProvider.mjs.map +1 -0
- package/dist/components/ColorMode/ColorModeToggle.d.ts +18 -0
- package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -0
- package/dist/components/ColorMode/ColorModeToggle.js +34 -0
- package/dist/components/ColorMode/ColorModeToggle.js.map +1 -0
- package/dist/components/ColorMode/ColorModeToggle.mjs +32 -0
- package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -0
- package/dist/components/ColorMode/index.d.ts +7 -0
- package/dist/components/ColorMode/index.d.ts.map +1 -0
- package/dist/components/ColorMode/useColorMode.d.ts +41 -0
- package/dist/components/ColorMode/useColorMode.d.ts.map +1 -0
- package/dist/components/ColorMode/useColorMode.js +55 -0
- package/dist/components/ColorMode/useColorMode.js.map +1 -0
- package/dist/components/ColorMode/useColorMode.mjs +52 -0
- package/dist/components/ColorMode/useColorMode.mjs.map +1 -0
- package/dist/components/DatePicker/RangeDatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.js +8 -5
- package/dist/components/DatePicker/RangeDatePicker.js.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.mjs +8 -5
- package/dist/components/DatePicker/RangeDatePicker.mjs.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.js +3 -3
- package/dist/components/DatePicker/SingleDatePicker.js.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.mjs +3 -3
- package/dist/components/DatePicker/SingleDatePicker.mjs.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.js +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.js.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.mjs +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.mjs.map +1 -1
- package/dist/components/FileInput/FileInput.js +1 -1
- package/dist/components/FileInput/FileInput.js.map +1 -1
- package/dist/components/FileInput/FileInput.mjs +1 -1
- package/dist/components/FileInput/FileInput.mjs.map +1 -1
- package/dist/components/FileItem/FileItem.js +2 -2
- package/dist/components/FileItem/FileItem.js.map +1 -1
- package/dist/components/FileItem/FileItem.mjs +2 -2
- package/dist/components/FileItem/FileItem.mjs.map +1 -1
- package/dist/components/FileList/FileList.js +3 -3
- package/dist/components/FileList/FileList.js.map +1 -1
- package/dist/components/FileList/FileList.mjs +3 -3
- package/dist/components/FileList/FileList.mjs.map +1 -1
- package/dist/components/FormLabel/FormLabel.js +1 -1
- package/dist/components/FormLabel/FormLabel.js.map +1 -1
- package/dist/components/FormLabel/FormLabel.mjs +1 -1
- package/dist/components/FormLabel/FormLabel.mjs.map +1 -1
- package/dist/components/IconButton/IconButton.styles.js +1 -1
- package/dist/components/IconButton/IconButton.styles.js.map +1 -1
- package/dist/components/IconButton/IconButton.styles.mjs +1 -1
- package/dist/components/IconButton/IconButton.styles.mjs.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +6 -6
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.mjs +6 -6
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
- package/dist/components/LineGraph/LineGraph.js +9 -5
- package/dist/components/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/LineGraph/LineGraph.mjs +9 -5
- package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
- package/dist/components/Loaders/PageLoader.js +1 -1
- package/dist/components/Loaders/PageLoader.js.map +1 -1
- package/dist/components/Loaders/PageLoader.mjs +1 -1
- package/dist/components/Loaders/PageLoader.mjs.map +1 -1
- package/dist/components/Loaders/SectionLoader.js +1 -1
- package/dist/components/Loaders/SectionLoader.js.map +1 -1
- package/dist/components/Loaders/SectionLoader.mjs +1 -1
- package/dist/components/Loaders/SectionLoader.mjs.map +1 -1
- package/dist/components/LogicianProvider/LogicianProvider.d.ts +20 -0
- package/dist/components/LogicianProvider/LogicianProvider.d.ts.map +1 -1
- package/dist/components/LogicianProvider/LogicianProvider.js +9 -2
- package/dist/components/LogicianProvider/LogicianProvider.js.map +1 -1
- package/dist/components/LogicianProvider/LogicianProvider.mjs +9 -2
- package/dist/components/LogicianProvider/LogicianProvider.mjs.map +1 -1
- package/dist/components/MDXEditor/MDXEditor.d.ts.map +1 -1
- package/dist/components/MDXEditor/MDXEditor.js +8 -16
- package/dist/components/MDXEditor/MDXEditor.js.map +1 -1
- package/dist/components/MDXEditor/MDXEditor.mjs +8 -16
- package/dist/components/MDXEditor/MDXEditor.mjs.map +1 -1
- package/dist/components/Markdown/Markdown.module.css.js +1 -1
- package/dist/components/Markdown/Markdown.module.css.mjs +1 -1
- package/dist/components/MaxLengthIndicator/MaxLengthIndicator.js +1 -1
- package/dist/components/MaxLengthIndicator/MaxLengthIndicator.js.map +1 -1
- package/dist/components/MaxLengthIndicator/MaxLengthIndicator.mjs +1 -1
- package/dist/components/MaxLengthIndicator/MaxLengthIndicator.mjs.map +1 -1
- package/dist/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.js +7 -3
- package/dist/components/Menu/MenuItem.js.map +1 -1
- package/dist/components/Menu/MenuItem.mjs +7 -3
- package/dist/components/Menu/MenuItem.mjs.map +1 -1
- package/dist/components/Menu/MenuList.d.ts.map +1 -1
- package/dist/components/Menu/MenuList.js +7 -1
- package/dist/components/Menu/MenuList.js.map +1 -1
- package/dist/components/Menu/MenuList.mjs +7 -1
- package/dist/components/Menu/MenuList.mjs.map +1 -1
- package/dist/components/Modal/ModalFooter/ModalFooter.js +1 -1
- package/dist/components/Modal/ModalFooter/ModalFooter.js.map +1 -1
- package/dist/components/Modal/ModalFooter/ModalFooter.mjs +1 -1
- package/dist/components/Modal/ModalFooter/ModalFooter.mjs.map +1 -1
- package/dist/components/MonthPicker/MonthPicker.js +1 -1
- package/dist/components/MonthPicker/MonthPicker.mjs +1 -1
- package/dist/components/Popover/PopoverArrowTip.js +1 -1
- package/dist/components/Popover/PopoverArrowTip.js.map +1 -1
- package/dist/components/Popover/PopoverArrowTip.mjs +1 -1
- package/dist/components/Popover/PopoverArrowTip.mjs.map +1 -1
- package/dist/components/Popover/PopoverContent.js +1 -1
- package/dist/components/Popover/PopoverContent.js.map +1 -1
- package/dist/components/Popover/PopoverContent.mjs +1 -1
- package/dist/components/Popover/PopoverContent.mjs.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.js +1 -1
- package/dist/components/RadialProgress/RadialProgress.js.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.mjs +1 -1
- package/dist/components/RadialProgress/RadialProgress.mjs.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.js +2 -2
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.js.map +1 -1
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.mjs +2 -2
- package/dist/components/SeeMoreButton/SeeMoreButton.styles.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +7 -3
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +7 -3
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/Select/Select.styles.d.ts +18 -4
- package/dist/components/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.js +11 -10
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Select/Select.styles.mjs +11 -10
- package/dist/components/Select/Select.styles.mjs.map +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.js +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.js.map +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.mjs +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.mjs.map +1 -1
- package/dist/components/Table/Table.styles.js +1 -1
- package/dist/components/Table/Table.styles.js.map +1 -1
- package/dist/components/Table/Table.styles.mjs +1 -1
- package/dist/components/Table/Table.styles.mjs.map +1 -1
- package/dist/components/Table/TableContainer.js +1 -1
- package/dist/components/Table/TableContainer.js.map +1 -1
- package/dist/components/Table/TableContainer.mjs +1 -1
- package/dist/components/Table/TableContainer.mjs.map +1 -1
- package/dist/components/Table/Tbody.js +1 -1
- package/dist/components/Table/Tbody.js.map +1 -1
- package/dist/components/Table/Tbody.mjs +1 -1
- package/dist/components/Table/Tbody.mjs.map +1 -1
- package/dist/components/Table/Thead.js +1 -1
- package/dist/components/Table/Thead.mjs +1 -1
- package/dist/components/Tabs/Tab/Tab.js +1 -1
- package/dist/components/Tabs/Tab/Tab.mjs +1 -1
- package/dist/components/Tabs/TabList/TabList.js +1 -1
- package/dist/components/Tabs/TabList/TabList.js.map +1 -1
- package/dist/components/Tabs/TabList/TabList.mjs +1 -1
- package/dist/components/Tabs/TabList/TabList.mjs.map +1 -1
- package/dist/components/Tag/Tag.styles.d.ts.map +1 -1
- package/dist/components/Tag/Tag.styles.js +19 -16
- package/dist/components/Tag/Tag.styles.js.map +1 -1
- package/dist/components/Tag/Tag.styles.mjs +19 -16
- package/dist/components/Tag/Tag.styles.mjs.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +7 -7
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.mjs +7 -7
- package/dist/components/Textarea/Textarea.mjs.map +1 -1
- package/dist/components/Typography/H3.js +1 -1
- package/dist/components/Typography/H3.js.map +1 -1
- package/dist/components/Typography/H3.mjs +1 -1
- package/dist/components/Typography/H3.mjs.map +1 -1
- package/dist/components/Typography/Subtext.js +1 -1
- package/dist/components/Typography/Subtext.js.map +1 -1
- package/dist/components/Typography/Subtext.mjs +1 -1
- package/dist/components/Typography/Subtext.mjs.map +1 -1
- package/dist/components/Typography/Subtitle.js +1 -1
- package/dist/components/Typography/Subtitle.js.map +1 -1
- package/dist/components/Typography/Subtitle.mjs +1 -1
- package/dist/components/Typography/Subtitle.mjs.map +1 -1
- package/dist/components/Typography/Text.js +1 -1
- package/dist/components/Typography/Text.js.map +1 -1
- package/dist/components/Typography/Text.mjs +1 -1
- package/dist/components/Typography/Text.mjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/theme/colors.d.ts +276 -40
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +197 -40
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +197 -40
- package/dist/theme/colors.mjs.map +1 -1
- package/dist/theme/global.d.ts.map +1 -1
- package/dist/theme/global.js +11 -1
- package/dist/theme/global.js.map +1 -1
- package/dist/theme/global.mjs +11 -1
- package/dist/theme/global.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Badge/Badge.styles.ts +5 -3
- package/src/components/Button/Button.styles.ts +39 -33
- package/src/components/Card/Card.tsx +3 -3
- package/src/components/Checkbox/CheckboxControl.tsx +8 -3
- package/src/components/Chip/Chip.styles.ts +14 -11
- package/src/components/Code/Code.tsx +5 -5
- package/src/components/CodeTabs/CopyButton.tsx +1 -1
- package/src/components/Collapsible/CollapsibleRoot.tsx +1 -1
- package/src/components/Collapsible/CollapsibleTrigger.tsx +1 -1
- package/src/components/ColorMode/ColorModeProvider.tsx +63 -0
- package/src/components/ColorMode/ColorModeToggle.tsx +45 -0
- package/src/components/ColorMode/index.ts +6 -0
- package/src/components/ColorMode/useColorMode.ts +74 -0
- package/src/components/DatePicker/RangeDatePicker.tsx +8 -5
- package/src/components/DatePicker/SingleDatePicker.tsx +3 -3
- package/src/components/ErrorFallback/ErrorFallback.tsx +3 -3
- package/src/components/FileInput/FileInput.tsx +1 -1
- package/src/components/FileItem/FileItem.tsx +5 -5
- package/src/components/FileList/FileList.tsx +4 -4
- package/src/components/FormLabel/FormLabel.tsx +1 -1
- package/src/components/IconButton/IconButton.styles.ts +1 -1
- package/src/components/Input/Input.tsx +10 -7
- package/src/components/LineGraph/LineGraph.tsx +8 -5
- package/src/components/Loaders/PageLoader.tsx +1 -1
- package/src/components/Loaders/SectionLoader.tsx +1 -1
- package/src/components/LogicianProvider/LogicianProvider.tsx +41 -1
- package/src/components/MDXEditor/MDXEditor.tsx +8 -18
- package/src/components/Markdown/Markdown.module.css +1 -1
- package/src/components/MaxLengthIndicator/MaxLengthIndicator.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +6 -3
- package/src/components/Menu/MenuList.tsx +7 -2
- package/src/components/Modal/ModalFooter/ModalFooter.tsx +1 -1
- package/src/components/MonthPicker/MonthPicker.tsx +1 -1
- package/src/components/Popover/PopoverArrowTip.tsx +1 -1
- package/src/components/Popover/PopoverContent.tsx +1 -1
- package/src/components/RadialProgress/RadialProgress.stories.tsx +1 -1
- package/src/components/RadialProgress/RadialProgress.tsx +2 -2
- package/src/components/SeeMoreButton/SeeMoreButton.styles.ts +2 -2
- package/src/components/SegmentedControl/SegmentedControl.tsx +6 -3
- package/src/components/Select/Select.styles.ts +11 -10
- package/src/components/Slider/SliderThumb/SliderThumb.tsx +1 -1
- package/src/components/Table/Table.styles.ts +1 -1
- package/src/components/Table/TableContainer.tsx +1 -1
- package/src/components/Table/Tbody.tsx +1 -1
- package/src/components/Table/Thead.tsx +1 -1
- package/src/components/Tabs/Tab/Tab.tsx +1 -1
- package/src/components/Tabs/TabList/TabList.tsx +1 -1
- package/src/components/Tag/Tag.styles.ts +19 -16
- package/src/components/Textarea/Textarea.tsx +10 -7
- package/src/components/Typography/H3.tsx +1 -1
- package/src/components/Typography/Subtext.tsx +1 -1
- package/src/components/Typography/Subtitle.tsx +1 -1
- package/src/components/Typography/Text.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/theme/Palette.stories.tsx +114 -88
- package/src/theme/colors.ts +225 -40
- package/src/theme/global.ts +12 -1
|
@@ -66,7 +66,10 @@ export const SegmentedControl = forwardRef<
|
|
|
66
66
|
}
|
|
67
67
|
}}
|
|
68
68
|
size={size}
|
|
69
|
-
|
|
69
|
+
// Track + selected-indicator flip with the mode (light values preserved:
|
|
70
|
+
// bg.subtle → gray.50, bg.surface → white/gray.0). The indicator's md
|
|
71
|
+
// shadow carries the raised affordance in both modes.
|
|
72
|
+
bg="bg.subtle"
|
|
70
73
|
p="1"
|
|
71
74
|
borderRadius={borderRadius}
|
|
72
75
|
boxShadow="none"
|
|
@@ -74,7 +77,7 @@ export const SegmentedControl = forwardRef<
|
|
|
74
77
|
{...rest}
|
|
75
78
|
css={mergeCss(
|
|
76
79
|
{
|
|
77
|
-
'--segment-indicator-bg': `var(--chakra-colors-
|
|
80
|
+
'--segment-indicator-bg': `var(--chakra-colors-bg-surface)`,
|
|
78
81
|
'--segment-indicator-shadow': `var(--chakra-shadows-md)`,
|
|
79
82
|
},
|
|
80
83
|
css
|
|
@@ -93,7 +96,7 @@ export const SegmentedControl = forwardRef<
|
|
|
93
96
|
>
|
|
94
97
|
<SegmentGroup.ItemText
|
|
95
98
|
data-text={typeof item.label === 'string' ? item.label : undefined}
|
|
96
|
-
color="
|
|
99
|
+
color="fg.muted"
|
|
97
100
|
fontWeight="500"
|
|
98
101
|
fontSize={fontSize}
|
|
99
102
|
whiteSpace="nowrap"
|
|
@@ -15,8 +15,9 @@ const focusVars = {
|
|
|
15
15
|
|
|
16
16
|
const fieldBase = {
|
|
17
17
|
...focusVars,
|
|
18
|
-
bg: '
|
|
19
|
-
|
|
18
|
+
bg: 'bg.surface',
|
|
19
|
+
color: 'fg.default',
|
|
20
|
+
borderColor: { base: 'gray.400', _dark: 'gray.1100' },
|
|
20
21
|
_hover: { borderColor: 'primary.lighter' },
|
|
21
22
|
_focus: { borderColor: 'primary.main' },
|
|
22
23
|
_invalid: {
|
|
@@ -27,8 +28,8 @@ const fieldBase = {
|
|
|
27
28
|
_disabled: {
|
|
28
29
|
opacity: 1,
|
|
29
30
|
cursor: 'not-allowed',
|
|
30
|
-
bg: '
|
|
31
|
-
color: 'gray.1000',
|
|
31
|
+
bg: 'bg.subtle',
|
|
32
|
+
color: { base: 'gray.1000', _dark: 'gray.400' },
|
|
32
33
|
fontWeight: 'semibold',
|
|
33
34
|
},
|
|
34
35
|
};
|
|
@@ -47,8 +48,8 @@ export const inputStyles = {
|
|
|
47
48
|
|
|
48
49
|
/** Dropdown panel for both Select and Combobox. */
|
|
49
50
|
export const contentStyles = {
|
|
50
|
-
bg: '
|
|
51
|
-
borderColor: '
|
|
51
|
+
bg: 'bg.surface',
|
|
52
|
+
borderColor: 'border.default',
|
|
52
53
|
borderWidth: '1px',
|
|
53
54
|
borderRadius: '8px',
|
|
54
55
|
boxShadow: '0px 5px 20px 0px rgba(0, 0, 0, 0.10)',
|
|
@@ -59,17 +60,17 @@ export const contentStyles = {
|
|
|
59
60
|
export const itemStyles = {
|
|
60
61
|
borderRadius: '4px',
|
|
61
62
|
cursor: 'pointer',
|
|
62
|
-
color: '
|
|
63
|
-
_highlighted: { bg: '
|
|
63
|
+
color: 'fg.default',
|
|
64
|
+
_highlighted: { bg: 'bg.subtle' },
|
|
64
65
|
_checked: {
|
|
65
66
|
bg: 'primary.extralight',
|
|
66
67
|
color: 'primary.dark',
|
|
67
68
|
fontWeight: 'bold',
|
|
68
69
|
},
|
|
69
|
-
_disabled: { color: '
|
|
70
|
+
_disabled: { color: 'fg.subtle', cursor: 'not-allowed' },
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
/** Dropdown chevron — softened so it doesn't outweigh adjacent icons. */
|
|
73
74
|
export const indicatorStyles = {
|
|
74
|
-
color: '
|
|
75
|
+
color: 'fg.muted',
|
|
75
76
|
};
|
|
@@ -20,8 +20,8 @@ export const tagColorPaletteStyles: Record<
|
|
|
20
20
|
color: 'primary.dark',
|
|
21
21
|
},
|
|
22
22
|
solid: {
|
|
23
|
-
bgColor: '
|
|
24
|
-
borderColor: '
|
|
23
|
+
bgColor: 'blue.500',
|
|
24
|
+
borderColor: 'blue.500',
|
|
25
25
|
color: 'white',
|
|
26
26
|
},
|
|
27
27
|
outline: {
|
|
@@ -37,8 +37,8 @@ export const tagColorPaletteStyles: Record<
|
|
|
37
37
|
color: 'secondary.dark',
|
|
38
38
|
},
|
|
39
39
|
solid: {
|
|
40
|
-
bgColor: '
|
|
41
|
-
borderColor: '
|
|
40
|
+
bgColor: 'violet.500',
|
|
41
|
+
borderColor: 'violet.500',
|
|
42
42
|
color: 'white',
|
|
43
43
|
},
|
|
44
44
|
outline: {
|
|
@@ -54,8 +54,8 @@ export const tagColorPaletteStyles: Record<
|
|
|
54
54
|
color: 'danger.dark',
|
|
55
55
|
},
|
|
56
56
|
solid: {
|
|
57
|
-
bgColor: '
|
|
58
|
-
borderColor: '
|
|
57
|
+
bgColor: 'rose.500',
|
|
58
|
+
borderColor: 'rose.500',
|
|
59
59
|
color: 'white',
|
|
60
60
|
},
|
|
61
61
|
outline: {
|
|
@@ -71,8 +71,8 @@ export const tagColorPaletteStyles: Record<
|
|
|
71
71
|
color: 'success.dark',
|
|
72
72
|
},
|
|
73
73
|
solid: {
|
|
74
|
-
bgColor: '
|
|
75
|
-
borderColor: '
|
|
74
|
+
bgColor: 'green.600',
|
|
75
|
+
borderColor: 'green.600',
|
|
76
76
|
color: 'white',
|
|
77
77
|
},
|
|
78
78
|
outline: {
|
|
@@ -88,9 +88,9 @@ export const tagColorPaletteStyles: Record<
|
|
|
88
88
|
color: 'warning.dark',
|
|
89
89
|
},
|
|
90
90
|
solid: {
|
|
91
|
-
bgColor: '
|
|
92
|
-
borderColor: '
|
|
93
|
-
color: '
|
|
91
|
+
bgColor: 'gold.500',
|
|
92
|
+
borderColor: 'gold.500',
|
|
93
|
+
color: 'gold.900', // dark text: white/gold.500 was 2.39:1; gold.900 = 6.73:1
|
|
94
94
|
},
|
|
95
95
|
outline: {
|
|
96
96
|
bgColor: 'transparent',
|
|
@@ -100,9 +100,12 @@ export const tagColorPaletteStyles: Record<
|
|
|
100
100
|
},
|
|
101
101
|
neutral: {
|
|
102
102
|
soft: {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
// Flip surface + border with the mode so the fg.muted text stays legible
|
|
104
|
+
// in dark. Light values preserved (bg.muted → gray.100, border.default →
|
|
105
|
+
// gray.300).
|
|
106
|
+
bgColor: 'bg.muted',
|
|
107
|
+
borderColor: 'border.default',
|
|
108
|
+
color: 'fg.muted',
|
|
106
109
|
},
|
|
107
110
|
solid: {
|
|
108
111
|
bgColor: 'gray.800',
|
|
@@ -111,8 +114,8 @@ export const tagColorPaletteStyles: Record<
|
|
|
111
114
|
},
|
|
112
115
|
outline: {
|
|
113
116
|
bgColor: 'transparent',
|
|
114
|
-
borderColor: 'gray.500
|
|
115
|
-
color: '
|
|
117
|
+
borderColor: 'border.strong', // gray.500 / gray.900 (_dark)
|
|
118
|
+
color: 'fg.subtle',
|
|
116
119
|
},
|
|
117
120
|
},
|
|
118
121
|
};
|
|
@@ -48,14 +48,17 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
48
48
|
readOnly={readOnly}
|
|
49
49
|
data-invalid={invalid || undefined}
|
|
50
50
|
resize="none"
|
|
51
|
-
bg="
|
|
51
|
+
bg="bg.surface"
|
|
52
|
+
color="fg.default"
|
|
52
53
|
// Chakra v3 `Input` outline variant declares
|
|
53
54
|
// `focusRingColor: var(--focus-color)`, but the matching
|
|
54
55
|
// `Textarea` recipe does not — so the focus ring defaults to
|
|
55
56
|
// `colorPalette.focusRing` (gray.400) and ends up visibly
|
|
56
57
|
// different from Input/Select. Mirror Input's chain explicitly.
|
|
57
58
|
focusRingColor={invalid ? 'danger.main' : 'primary.main'}
|
|
58
|
-
borderColor={
|
|
59
|
+
borderColor={
|
|
60
|
+
invalid ? 'danger.main' : { base: 'gray.400', _dark: 'gray.1100' }
|
|
61
|
+
}
|
|
59
62
|
_hover={{
|
|
60
63
|
borderColor: invalid ? 'danger.main' : 'primary.lighter',
|
|
61
64
|
..._hover,
|
|
@@ -76,15 +79,15 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
76
79
|
_readOnly={{
|
|
77
80
|
opacity: 1,
|
|
78
81
|
cursor: 'not-allowed',
|
|
79
|
-
bg: '
|
|
80
|
-
color: '
|
|
81
|
-
borderColor: '
|
|
82
|
+
bg: 'bg.subtle',
|
|
83
|
+
color: 'fg.muted',
|
|
84
|
+
borderColor: 'border.subtle',
|
|
82
85
|
}}
|
|
83
86
|
_disabled={{
|
|
84
87
|
opacity: 1,
|
|
85
88
|
cursor: 'not-allowed',
|
|
86
|
-
bg: '
|
|
87
|
-
color: 'gray.1000',
|
|
89
|
+
bg: 'bg.subtle',
|
|
90
|
+
color: { base: 'gray.1000', _dark: 'gray.400' },
|
|
88
91
|
fontWeight: 'semibold',
|
|
89
92
|
}}
|
|
90
93
|
{...props}
|
|
@@ -13,7 +13,7 @@ export const Text = forwardRef<HTMLParagraphElement, TextProps>(
|
|
|
13
13
|
// If fontSize is provided, disable textStyle to allow fontSize override
|
|
14
14
|
textStyle={fontSize ? undefined : 'p'}
|
|
15
15
|
fontSize={fontSize}
|
|
16
|
-
color="
|
|
16
|
+
color="fg.default"
|
|
17
17
|
wordBreak="keep-all"
|
|
18
18
|
{...rest}
|
|
19
19
|
/>
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './components/Chip';
|
|
|
11
11
|
export * from './components/Code';
|
|
12
12
|
export * from './components/CodeTabs';
|
|
13
13
|
export * from './components/Collapsible';
|
|
14
|
+
export * from './components/ColorMode';
|
|
14
15
|
export * from './components/Container';
|
|
15
16
|
export * from './components/CopyableCode';
|
|
16
17
|
export * from './components/DatePicker';
|
|
@@ -106,3 +107,4 @@ export { LanguageContext, useLanguage } from './hooks/useLanguage';
|
|
|
106
107
|
|
|
107
108
|
// Theme exports
|
|
108
109
|
export { logicianConfig, system, theme } from './theme';
|
|
110
|
+
export type { SemanticColorToken } from './theme/colors';
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
VStack,
|
|
7
7
|
} from '@chakra-ui/react';
|
|
8
8
|
import { Meta, StoryObj } from '@storybook/react';
|
|
9
|
-
import {
|
|
9
|
+
import { readableColor } from 'polished';
|
|
10
10
|
import { MouseEventHandler, useState } from 'react';
|
|
11
11
|
|
|
12
12
|
import { Tooltip } from '../components/Tooltip';
|
|
@@ -27,20 +27,48 @@ import { colors, semanticTokens } from './colors';
|
|
|
27
27
|
* E.g., '{colors.blue.500}' -> '#1751D0'
|
|
28
28
|
*/
|
|
29
29
|
const resolveTokenReference = (reference: string): string => {
|
|
30
|
-
//
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
|
|
30
|
+
// Scale reference, e.g. '{colors.blue.500}' or '{colors.gray.1500}'.
|
|
31
|
+
const scaleMatch = reference.match(/^\{colors\.(\w+)\.(\w+)\}$/);
|
|
32
|
+
if (scaleMatch) {
|
|
33
|
+
const [, colorName, shade] = scaleMatch;
|
|
34
|
+
const colorScale = (colors as any)[colorName];
|
|
35
|
+
if (colorScale && colorScale[shade]) {
|
|
36
|
+
return colorScale[shade].value;
|
|
37
|
+
}
|
|
34
38
|
return reference;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
+
// Flat reference with no shade, e.g. '{colors.white}' / '{colors.black}'.
|
|
41
|
+
const flatMatch = reference.match(/^\{colors\.(\w+)\}$/);
|
|
42
|
+
if (flatMatch) {
|
|
43
|
+
const entry = (colors as any)[flatMatch[1]];
|
|
44
|
+
if (entry && typeof entry.value === 'string') {
|
|
45
|
+
return entry.value;
|
|
46
|
+
}
|
|
40
47
|
}
|
|
48
|
+
// Already a hex value or unknown format.
|
|
41
49
|
return reference;
|
|
42
50
|
};
|
|
43
51
|
|
|
52
|
+
/**
|
|
53
|
+
* A semantic token `value` is either a plain reference string (legacy) or a
|
|
54
|
+
* mode-conditional object `{ base, _dark }`. Resolve it to concrete light/dark
|
|
55
|
+
* hex codes so the palette can show both modes side by side.
|
|
56
|
+
*/
|
|
57
|
+
type TokenValue = string | { base: string; _dark?: string };
|
|
58
|
+
|
|
59
|
+
const resolveTokenValue = (
|
|
60
|
+
value: TokenValue
|
|
61
|
+
): { light: string; dark: string } => {
|
|
62
|
+
if (typeof value === 'string') {
|
|
63
|
+
const hex = resolveTokenReference(value);
|
|
64
|
+
return { light: hex, dark: hex };
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
light: resolveTokenReference(value.base),
|
|
68
|
+
dark: resolveTokenReference(value._dark ?? value.base),
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
44
72
|
const meta = {
|
|
45
73
|
title: 'Setup/Theme',
|
|
46
74
|
parameters: {
|
|
@@ -84,6 +112,59 @@ export default meta;
|
|
|
84
112
|
|
|
85
113
|
type Story = StoryObj<typeof meta>;
|
|
86
114
|
|
|
115
|
+
// Safe readableColor that falls back to black
|
|
116
|
+
const safeReadableColor = (color: string) => {
|
|
117
|
+
try {
|
|
118
|
+
return readableColor(color);
|
|
119
|
+
} catch {
|
|
120
|
+
return '#000000';
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const SwatchHalf = ({
|
|
125
|
+
label,
|
|
126
|
+
hex,
|
|
127
|
+
}: {
|
|
128
|
+
label: string;
|
|
129
|
+
hex: string;
|
|
130
|
+
}) => {
|
|
131
|
+
const [wasCopied, setWasCopied] = useState<boolean>();
|
|
132
|
+
const handleClick: MouseEventHandler<HTMLButtonElement> = () => {
|
|
133
|
+
navigator.clipboard.writeText(hex);
|
|
134
|
+
setWasCopied(true);
|
|
135
|
+
setTimeout(() => setWasCopied(false), 2000);
|
|
136
|
+
};
|
|
137
|
+
return (
|
|
138
|
+
<Tooltip content="Copy hex code" placement="top">
|
|
139
|
+
<Flex
|
|
140
|
+
flex="1"
|
|
141
|
+
h="72px"
|
|
142
|
+
direction="column"
|
|
143
|
+
justify="space-between"
|
|
144
|
+
bg={hex}
|
|
145
|
+
p={2}
|
|
146
|
+
as="button"
|
|
147
|
+
transition="transform 0.1s ease-in-out"
|
|
148
|
+
// @ts-expect-error as prop
|
|
149
|
+
onClick={handleClick}
|
|
150
|
+
_hover={{ transform: 'scale(1.03)' }}
|
|
151
|
+
>
|
|
152
|
+
<Text color={safeReadableColor(hex)} fontSize="10px" textAlign="left">
|
|
153
|
+
{label}
|
|
154
|
+
</Text>
|
|
155
|
+
<Text
|
|
156
|
+
color={safeReadableColor(hex)}
|
|
157
|
+
fontSize="10px"
|
|
158
|
+
fontFamily="mono"
|
|
159
|
+
textAlign="left"
|
|
160
|
+
>
|
|
161
|
+
{wasCopied ? 'Copied!' : hex}
|
|
162
|
+
</Text>
|
|
163
|
+
</Flex>
|
|
164
|
+
</Tooltip>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
87
168
|
const ColorCard = ({
|
|
88
169
|
color,
|
|
89
170
|
shade,
|
|
@@ -91,88 +172,33 @@ const ColorCard = ({
|
|
|
91
172
|
}: {
|
|
92
173
|
color: string;
|
|
93
174
|
shade: string;
|
|
94
|
-
shadeValue:
|
|
175
|
+
shadeValue: TokenValue;
|
|
95
176
|
}) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
const handleClick: MouseEventHandler<HTMLButtonElement> = () => {
|
|
101
|
-
navigator.clipboard.writeText(hexCode);
|
|
102
|
-
setWasCopied(true);
|
|
103
|
-
setTimeout(() => {
|
|
104
|
-
setWasCopied(false);
|
|
105
|
-
}, 2000);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// Safe lighten that falls back to the original color
|
|
109
|
-
const safeLighten = (amount: number, color: string) => {
|
|
110
|
-
try {
|
|
111
|
-
return lighten(amount, color);
|
|
112
|
-
} catch {
|
|
113
|
-
return color;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// Safe readableColor that falls back to black
|
|
118
|
-
const safeReadableColor = (color: string) => {
|
|
119
|
-
try {
|
|
120
|
-
return readableColor(color);
|
|
121
|
-
} catch {
|
|
122
|
-
return '#000000';
|
|
123
|
-
}
|
|
124
|
-
};
|
|
177
|
+
// Resolve to concrete light/dark hex so both modes are visible at once.
|
|
178
|
+
const { light, dark } = resolveTokenValue(shadeValue);
|
|
179
|
+
const hasDark = dark !== light;
|
|
125
180
|
|
|
126
181
|
return (
|
|
127
|
-
<Flex flexDir="column" align="
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<Flex
|
|
146
|
-
color={safeReadableColor(hexCode)}
|
|
147
|
-
w="100%"
|
|
148
|
-
h="100%"
|
|
149
|
-
justify="center"
|
|
150
|
-
align="center"
|
|
151
|
-
>
|
|
152
|
-
Copied!
|
|
153
|
-
</Flex>
|
|
154
|
-
) : (
|
|
155
|
-
<Box
|
|
156
|
-
textAlign="center"
|
|
157
|
-
mt={4}
|
|
158
|
-
color={safeReadableColor(safeLighten(0.2, hexCode))}
|
|
159
|
-
bgColor={safeLighten(0.2, hexCode)}
|
|
160
|
-
m={2}
|
|
161
|
-
p={1}
|
|
162
|
-
w="100%"
|
|
163
|
-
borderRadius="md"
|
|
164
|
-
>
|
|
165
|
-
<Text color="inherit" textStyle="subtext">
|
|
166
|
-
{hexCode}
|
|
167
|
-
</Text>
|
|
168
|
-
</Box>
|
|
169
|
-
)}
|
|
170
|
-
</Flex>
|
|
171
|
-
</Tooltip>
|
|
172
|
-
<Text color="gray.1200" mt={2} textStyle="subtext" textAlign="center" wordBreak="break-word">
|
|
182
|
+
<Flex flexDir="column" align="stretch" key={shade} p={2}>
|
|
183
|
+
<Flex
|
|
184
|
+
borderRadius="md"
|
|
185
|
+
overflow="hidden"
|
|
186
|
+
boxShadow="md"
|
|
187
|
+
border="1px solid"
|
|
188
|
+
borderColor="border.subtle"
|
|
189
|
+
>
|
|
190
|
+
<SwatchHalf label={hasDark ? 'Light' : ''} hex={light} />
|
|
191
|
+
{hasDark && <SwatchHalf label="Dark" hex={dark} />}
|
|
192
|
+
</Flex>
|
|
193
|
+
<Text
|
|
194
|
+
color="fg.muted"
|
|
195
|
+
mt={2}
|
|
196
|
+
textStyle="subtext"
|
|
197
|
+
textAlign="center"
|
|
198
|
+
wordBreak="break-word"
|
|
199
|
+
>
|
|
173
200
|
{color}.{shade}
|
|
174
201
|
</Text>
|
|
175
|
-
<Subtext color="gray.700" textAlign="center" wordBreak="break-word">{shadeValue !== hexCode && shadeValue}</Subtext>
|
|
176
202
|
</Flex>
|
|
177
203
|
);
|
|
178
204
|
};
|
|
@@ -275,7 +301,7 @@ export const SemanticTokens: Story = {
|
|
|
275
301
|
key={shade}
|
|
276
302
|
color={color}
|
|
277
303
|
shade={shade}
|
|
278
|
-
shadeValue={(shadeValue as any).value as
|
|
304
|
+
shadeValue={(shadeValue as any).value as TokenValue}
|
|
279
305
|
/>
|
|
280
306
|
))}
|
|
281
307
|
</Grid>
|
|
@@ -733,7 +759,7 @@ export const Default: Story = {
|
|
|
733
759
|
key={shade}
|
|
734
760
|
color={color}
|
|
735
761
|
shade={shade}
|
|
736
|
-
shadeValue={(shadeValue as any).value as
|
|
762
|
+
shadeValue={(shadeValue as any).value as TokenValue}
|
|
737
763
|
/>
|
|
738
764
|
))}
|
|
739
765
|
</Grid>
|