@mindlogic-ai/logician-ui 3.0.0 → 3.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/Card/Card.styles.js +2 -2
- package/dist/components/Card/Card.styles.js.map +1 -1
- package/dist/components/Card/Card.styles.mjs +2 -2
- package/dist/components/Card/Card.styles.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/CopyableCode/CopyableCode.d.ts.map +1 -1
- package/dist/components/CopyableCode/CopyableCode.js +4 -1
- package/dist/components/CopyableCode/CopyableCode.js.map +1 -1
- package/dist/components/CopyableCode/CopyableCode.mjs +4 -1
- package/dist/components/CopyableCode/CopyableCode.mjs.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.js +9 -6
- package/dist/components/DatePicker/RangeDatePicker.js.map +1 -1
- package/dist/components/DatePicker/RangeDatePicker.mjs +9 -6
- package/dist/components/DatePicker/RangeDatePicker.mjs.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.js +4 -4
- package/dist/components/DatePicker/SingleDatePicker.js.map +1 -1
- package/dist/components/DatePicker/SingleDatePicker.mjs +4 -4
- 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/InfoSprinkle/InfoSprinkle.js +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.js.map +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.mjs +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.mjs.map +1 -1
- package/dist/components/InlineCode/InlineCode.js +1 -1
- package/dist/components/InlineCode/InlineCode.js.map +1 -1
- package/dist/components/InlineCode/InlineCode.mjs +1 -1
- package/dist/components/InlineCode/InlineCode.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 +14 -16
- package/dist/components/MDXEditor/MDXEditor.js.map +1 -1
- package/dist/components/MDXEditor/MDXEditor.mjs +14 -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/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.mjs +1 -1
- package/dist/components/Pagination/Pagination.mjs.map +1 -1
- package/dist/components/PinInput/PinInput.js +1 -1
- package/dist/components/PinInput/PinInput.js.map +1 -1
- package/dist/components/PinInput/PinInput.mjs +1 -1
- package/dist/components/PinInput/PinInput.mjs.map +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/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
- package/dist/components/RadialProgress/RadialProgress.js +4 -4
- package/dist/components/RadialProgress/RadialProgress.js.map +1 -1
- package/dist/components/RadialProgress/RadialProgress.mjs +4 -4
- 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 +8 -4
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.mjs +8 -4
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/components/SegmentedProgressBar/ProgressSegment.js +1 -1
- package/dist/components/SegmentedProgressBar/ProgressSegment.mjs +1 -1
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.js +1 -1
- package/dist/components/SegmentedProgressBar/SegmentedProgressBar.mjs +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/SliderFilledTrack/SliderFilledTrack.js +1 -1
- package/dist/components/Slider/SliderFilledTrack/SliderFilledTrack.mjs +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.js +2 -2
- package/dist/components/Slider/SliderThumb/SliderThumb.js.map +1 -1
- package/dist/components/Slider/SliderThumb/SliderThumb.mjs +2 -2
- package/dist/components/Slider/SliderThumb/SliderThumb.mjs.map +1 -1
- package/dist/components/Slider/SliderTrack/SliderTrack.js +1 -1
- package/dist/components/Slider/SliderTrack/SliderTrack.mjs +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Spinner/Spinner.mjs +1 -1
- package/dist/components/Switch/SwitchControl.js +1 -1
- package/dist/components/Switch/SwitchControl.mjs +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 +201 -40
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/colors.mjs +201 -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.styles.ts +2 -2
- 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 +2 -2
- 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/CopyableCode/CopyableCode.tsx +3 -1
- package/src/components/DatePicker/RangeDatePicker.tsx +9 -6
- package/src/components/DatePicker/SingleDatePicker.tsx +4 -4
- package/src/components/ErrorFallback/ErrorFallback.tsx +3 -3
- package/src/components/FileInput/FileInput.tsx +4 -4
- 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/InfoSprinkle/InfoSprinkle.tsx +1 -1
- package/src/components/InlineCode/InlineCode.tsx +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.css +19 -0
- package/src/components/MDXEditor/MDXEditor.tsx +14 -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/Pagination/Pagination.tsx +2 -2
- package/src/components/PinInput/PinInput.tsx +1 -1
- package/src/components/Popover/PopoverArrowTip.tsx +1 -1
- package/src/components/Popover/PopoverContent.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.tsx +1 -1
- package/src/components/RadialProgress/RadialProgress.stories.tsx +1 -1
- package/src/components/RadialProgress/RadialProgress.tsx +7 -7
- package/src/components/SeeMoreButton/SeeMoreButton.styles.ts +2 -2
- package/src/components/SegmentedControl/SegmentedControl.tsx +7 -4
- package/src/components/SegmentedProgressBar/ProgressSegment.tsx +1 -1
- package/src/components/SegmentedProgressBar/SegmentedProgressBar.tsx +1 -1
- package/src/components/Select/Select.styles.ts +11 -10
- package/src/components/Slider/SliderFilledTrack/SliderFilledTrack.tsx +1 -1
- package/src/components/Slider/SliderThumb/SliderThumb.tsx +2 -2
- package/src/components/Slider/SliderTrack/SliderTrack.tsx +1 -1
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Switch/SwitchControl.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/SemanticTokens.mdx +198 -0
- package/src/theme/colors.ts +229 -40
- package/src/theme/global.ts +12 -1
|
@@ -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>
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Setup/Theme/Using Semantic Tokens" />
|
|
4
|
+
|
|
5
|
+
# Using Semantic Tokens
|
|
6
|
+
|
|
7
|
+
The design system ships a layer of **semantic color tokens** on top of the raw
|
|
8
|
+
color palette. They are the colors you should reach for in app and component
|
|
9
|
+
code. This guide explains what they are, when to use which, and how they make
|
|
10
|
+
light/dark mode work automatically.
|
|
11
|
+
|
|
12
|
+
> Looking for the live swatches and exact hex values? See
|
|
13
|
+
> **Setup/Theme → Palette** — this page is the _how-to_.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Why semantic tokens?
|
|
18
|
+
|
|
19
|
+
A **primitive** like `gray.300` or `blue.500` is a fixed color. It means the
|
|
20
|
+
same thing everywhere and never changes between light and dark.
|
|
21
|
+
|
|
22
|
+
A **semantic token** like `fg.default` or `bg.surface` describes the _role_ a
|
|
23
|
+
color plays ("primary text", "raised surface"), and resolves to a different
|
|
24
|
+
primitive depending on the active color mode.
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
// ❌ Primitive — frozen. Looks fine in light, unreadable in dark.
|
|
28
|
+
<Text color="gray.1300" bg="white" />
|
|
29
|
+
|
|
30
|
+
// ✅ Semantic — flips with the mode automatically.
|
|
31
|
+
<Text color="fg.default" bg="bg.surface" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Two payoffs:
|
|
35
|
+
|
|
36
|
+
1. **Dark mode for free.** Add `color="fg.default"` and it's `gray.1300` in
|
|
37
|
+
light and `gray.50` in dark — no `useColorMode`, no conditionals.
|
|
38
|
+
2. **Intent, not value.** `border.subtle` always reads as "a low-emphasis
|
|
39
|
+
divider," whatever the mode. The intent is encoded once, in the theme.
|
|
40
|
+
|
|
41
|
+
**Rule of thumb:** in app/component code, prefer semantic tokens. Drop to a
|
|
42
|
+
primitive (`gray.300`, `blue.500`, …) only for one-off visuals that genuinely
|
|
43
|
+
have no semantic meaning.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## The neutral tokens
|
|
48
|
+
|
|
49
|
+
These cover text, surfaces, and borders — the bulk of any UI. Each flips
|
|
50
|
+
between a light and a dark value.
|
|
51
|
+
|
|
52
|
+
### Foreground — `fg.*` (text & icons)
|
|
53
|
+
|
|
54
|
+
| Token | Light | Dark | Use for |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| `fg.default` | `gray.1300` | `gray.50` | Primary text, headings, icons |
|
|
57
|
+
| `fg.muted` | `gray.900` | `gray.400` | Secondary text, captions, supporting icons |
|
|
58
|
+
| `fg.subtle` | `gray.700` | `gray.600` | Tertiary text, placeholders, disabled-ish labels |
|
|
59
|
+
| `fg.inverse` | `gray.0` | `gray.1400` | Text on an **inverse** surface (e.g. tooltip) |
|
|
60
|
+
|
|
61
|
+
### Background — `bg.*` (surfaces & fills)
|
|
62
|
+
|
|
63
|
+
| Token | Light | Dark | Use for |
|
|
64
|
+
| --- | --- | --- | --- |
|
|
65
|
+
| `bg.canvas` | `gray.0` | `gray.1500` | App/page background |
|
|
66
|
+
| `bg.surface` | `white` | `gray.1400` | Raised surface — cards, popovers, menus, modals |
|
|
67
|
+
| `bg.subtle` | `gray.50` | `gray.1300` | Subtle fill, hover background, secondary surface |
|
|
68
|
+
| `bg.muted` | `gray.100` | `gray.1200` | Muted fill, tertiary surface, neutral chips |
|
|
69
|
+
| `bg.inverse` | `gray.1300` | `gray.50` | High-contrast/inverse surface (flips with mode) |
|
|
70
|
+
|
|
71
|
+
### Border — `border.*` (borders & dividers)
|
|
72
|
+
|
|
73
|
+
| Token | Light | Dark | Use for |
|
|
74
|
+
| --- | --- | --- | --- |
|
|
75
|
+
| `border.subtle` | `gray.200` | `gray.1300` | Low-emphasis dividers, faint outlines |
|
|
76
|
+
| `border.default` | `gray.300` | `gray.1100` | Standard borders, container outlines |
|
|
77
|
+
| `border.strong` | `gray.500` | `gray.900` | High-emphasis borders, form-control outlines |
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<Box bg="bg.surface" borderColor="border.default" borderWidth="1px">
|
|
81
|
+
<Heading color="fg.default">Title</Heading>
|
|
82
|
+
<Text color="fg.muted">Supporting copy</Text>
|
|
83
|
+
</Box>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## The brand tokens
|
|
89
|
+
|
|
90
|
+
Five intent palettes — `primary` (blue), `secondary` (violet), `danger` (rose),
|
|
91
|
+
`success` (green), `warning` (gold) — each expose a 7-step scale that also
|
|
92
|
+
flips in dark mode:
|
|
93
|
+
|
|
94
|
+
| Step | Typical use |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `lightest` / `extralight` | Tinted backgrounds (badges, soft buttons, banners) |
|
|
97
|
+
| `lighter` / `light` | Hover/pressed tints, subtle fills |
|
|
98
|
+
| `main` | The action color — links, focus rings, ghost/outline text, icons |
|
|
99
|
+
| `dark` | Emphasis text on a light/tinted background |
|
|
100
|
+
| `darker` | High-contrast text |
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
<Badge bg="danger.extralight" color="danger.dark">Error</Badge>
|
|
104
|
+
<Link color="primary.main">Learn more</Link>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
In dark mode these steps lighten so they keep contrast on dark surfaces — e.g.
|
|
108
|
+
`primary.main` is `blue.500` in light and lifts to `blue.300` in dark.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Migration cheat-sheet
|
|
113
|
+
|
|
114
|
+
Replacing primitives in existing code? Map by role, not by exact value — pick
|
|
115
|
+
the nearest semantic token:
|
|
116
|
+
|
|
117
|
+
| Was (primitive) | Use (semantic) |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `gray.1000`–`gray.1500` as text | `fg.default` |
|
|
120
|
+
| `gray.800`–`gray.900` as text | `fg.muted` |
|
|
121
|
+
| `gray.500`–`gray.700` as text/icon | `fg.subtle` |
|
|
122
|
+
| `white` / `gray.0` surface | `bg.surface` / `bg.canvas` |
|
|
123
|
+
| `gray.50` / `gray.100` fill | `bg.subtle` / `bg.muted` |
|
|
124
|
+
| `gray.200` / `gray.300` border | `border.subtle` / `border.default` |
|
|
125
|
+
| `gray.500` border | `border.strong` |
|
|
126
|
+
| `blue.*` / `rose.*` … intent color | matching `primary.*` / `danger.*` … step |
|
|
127
|
+
|
|
128
|
+
The full set of names is exported as the `SemanticColorToken` type
|
|
129
|
+
(`fg.default`, `bg.surface`, `primary.main`, …) for codemods and review.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## How light/dark actually resolves
|
|
134
|
+
|
|
135
|
+
- The mode is a **class on `<html>`**: `.dark` toggles every token's `_dark`
|
|
136
|
+
value (the Chakra v3 default `_dark` selector). No class = light.
|
|
137
|
+
- `LogicianProvider` mounts the color-mode runtime by default (backed by
|
|
138
|
+
`next-themes`) and owns `color-scheme`. Consumers should add
|
|
139
|
+
`suppressHydrationWarning` to their `<html>`.
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
<LogicianProvider defaultColorMode="system">
|
|
143
|
+
<App />
|
|
144
|
+
</LogicianProvider>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`LogicianProvider` props: `defaultColorMode`, `forcedColorMode` (pin a mode for
|
|
148
|
+
staged rollouts), `enableColorMode`.
|
|
149
|
+
|
|
150
|
+
### Reading / toggling the mode
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { useColorMode, useColorModeValue, ColorModeToggle } from '@mindlogic-ai/logician-ui';
|
|
154
|
+
|
|
155
|
+
const { colorMode, setColorMode, toggleColorMode } = useColorMode();
|
|
156
|
+
|
|
157
|
+
// Prefer tokens; use this only when a value can't be a token (e.g. an image).
|
|
158
|
+
const src = useColorModeValue('/logo-light.svg', '/logo-dark.svg');
|
|
159
|
+
|
|
160
|
+
// Drop-in switch:
|
|
161
|
+
<ColorModeToggle />
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Authoring mode-aware components
|
|
167
|
+
|
|
168
|
+
**Prefer tokens.** If you must vary a raw value by mode, use a conditional
|
|
169
|
+
object — light stays exact, dark overrides:
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
<Box bgColor={{ base: 'gray.300', _dark: 'gray.1200' }} />
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
For **third-party libraries that don't understand Chakra tokens** (e.g.
|
|
176
|
+
recharts), pass the token's CSS variable so it still flips via the `.dark`
|
|
177
|
+
class:
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<XAxis tick={{ fill: 'var(--chakra-colors-fg-muted)' }} />
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Contrast / accessibility
|
|
186
|
+
|
|
187
|
+
The semantic pairings are tuned to meet **WCAG AA** in both modes. A couple of
|
|
188
|
+
things to keep in mind:
|
|
189
|
+
|
|
190
|
+
- **Solid color buttons keep white labels** on the saturated fill in both
|
|
191
|
+
modes — except **`warning` (gold)**, which uses a dark label because
|
|
192
|
+
white-on-gold fails AA. If you build a custom solid `warning` surface, use
|
|
193
|
+
dark text.
|
|
194
|
+
- For **border-only** controls (e.g. an unchecked checkbox), reach for
|
|
195
|
+
`border.strong` so the outline clears the 3:1 non-text-contrast bar on dark.
|
|
196
|
+
|
|
197
|
+
When in doubt, verify the specific pair in **Setup/Theme → Palette**, which
|
|
198
|
+
shows the resolved light/dark values side by side.
|