@dxos/react-ui 0.1.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/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/src/components/Alert/Alert.d.ts +10 -0
- package/dist/src/components/Alert/Alert.d.ts.map +1 -0
- package/dist/src/components/Alert/Alert.js +21 -0
- package/dist/src/components/Alert/Alert.js.map +1 -0
- package/dist/src/components/Alert/Alert.stories.d.ts +9 -0
- package/dist/src/components/Alert/Alert.stories.d.ts.map +1 -0
- package/dist/src/components/Alert/Alert.stories.js +30 -0
- package/dist/src/components/Alert/Alert.stories.js.map +1 -0
- package/dist/src/components/Alert/index.d.ts +2 -0
- package/dist/src/components/Alert/index.d.ts.map +1 -0
- package/dist/src/components/Alert/index.js +21 -0
- package/dist/src/components/Alert/index.js.map +1 -0
- package/dist/src/components/AlertDialog/AlertDialog.d.ts +17 -0
- package/dist/src/components/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/dist/src/components/AlertDialog/AlertDialog.js +65 -0
- package/dist/src/components/AlertDialog/AlertDialog.js.map +1 -0
- package/dist/src/components/AlertDialog/AlertDialog.stories.d.ts +9 -0
- package/dist/src/components/AlertDialog/AlertDialog.stories.d.ts.map +1 -0
- package/dist/src/components/AlertDialog/AlertDialog.stories.js +37 -0
- package/dist/src/components/AlertDialog/AlertDialog.stories.js.map +1 -0
- package/dist/src/components/AlertDialog/index.d.ts +2 -0
- package/dist/src/components/AlertDialog/index.d.ts.map +1 -0
- package/dist/src/components/AlertDialog/index.js +21 -0
- package/dist/src/components/AlertDialog/index.js.map +1 -0
- package/dist/src/components/Avatar/Avatar.d.ts +13 -0
- package/dist/src/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/src/components/Avatar/Avatar.js +53 -0
- package/dist/src/components/Avatar/Avatar.js.map +1 -0
- package/dist/src/components/Avatar/Avatar.stories.d.ts +10 -0
- package/dist/src/components/Avatar/Avatar.stories.d.ts.map +1 -0
- package/dist/src/components/Avatar/Avatar.stories.js +30 -0
- package/dist/src/components/Avatar/Avatar.stories.js.map +1 -0
- package/dist/src/components/Avatar/index.d.ts +2 -0
- package/dist/src/components/Avatar/index.d.ts.map +1 -0
- package/dist/src/components/Avatar/index.js +21 -0
- package/dist/src/components/Avatar/index.js.map +1 -0
- package/dist/src/components/Button/Button.d.ts +4 -0
- package/dist/src/components/Button/Button.d.ts.map +1 -0
- package/dist/src/components/Button/Button.js +37 -0
- package/dist/src/components/Button/Button.js.map +1 -0
- package/dist/src/components/Button/Button.stories.d.ts +12 -0
- package/dist/src/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/src/components/Button/Button.stories.js +31 -0
- package/dist/src/components/Button/Button.stories.js.map +1 -0
- package/dist/src/components/Button/ButtonProps.d.ts +8 -0
- package/dist/src/components/Button/ButtonProps.d.ts.map +1 -0
- package/dist/src/components/Button/ButtonProps.js +6 -0
- package/dist/src/components/Button/ButtonProps.js.map +1 -0
- package/dist/src/components/Button/buttonStyles.d.ts +5 -0
- package/dist/src/components/Button/buttonStyles.d.ts.map +1 -0
- package/dist/src/components/Button/buttonStyles.js +24 -0
- package/dist/src/components/Button/buttonStyles.js.map +1 -0
- package/dist/src/components/Button/index.d.ts +4 -0
- package/dist/src/components/Button/index.d.ts.map +1 -0
- package/dist/src/components/Button/index.js +23 -0
- package/dist/src/components/Button/index.js.map +1 -0
- package/dist/src/components/CompoundButton/CompoundButton.d.ts +10 -0
- package/dist/src/components/CompoundButton/CompoundButton.d.ts.map +1 -0
- package/dist/src/components/CompoundButton/CompoundButton.js +27 -0
- package/dist/src/components/CompoundButton/CompoundButton.js.map +1 -0
- package/dist/src/components/CompoundButton/CompoundButton.stories.d.ts +10 -0
- package/dist/src/components/CompoundButton/CompoundButton.stories.d.ts.map +1 -0
- package/dist/src/components/CompoundButton/CompoundButton.stories.js +40 -0
- package/dist/src/components/CompoundButton/CompoundButton.stories.js.map +1 -0
- package/dist/src/components/CompoundButton/index.d.ts +2 -0
- package/dist/src/components/CompoundButton/index.d.ts.map +1 -0
- package/dist/src/components/CompoundButton/index.js +21 -0
- package/dist/src/components/CompoundButton/index.js.map +1 -0
- package/dist/src/components/Dialog/Dialog.d.ts +14 -0
- package/dist/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/src/components/Dialog/Dialog.js +59 -0
- package/dist/src/components/Dialog/Dialog.js.map +1 -0
- package/dist/src/components/Dialog/Dialog.stories.d.ts +9 -0
- package/dist/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
- package/dist/src/components/Dialog/Dialog.stories.js +37 -0
- package/dist/src/components/Dialog/Dialog.stories.js.map +1 -0
- package/dist/src/components/Dialog/index.d.ts +2 -0
- package/dist/src/components/Dialog/index.d.ts.map +1 -0
- package/dist/src/components/Dialog/index.js +21 -0
- package/dist/src/components/Dialog/index.js.map +1 -0
- package/dist/src/components/Group/Group.d.ts +10 -0
- package/dist/src/components/Group/Group.d.ts.map +1 -0
- package/dist/src/components/Group/Group.js +22 -0
- package/dist/src/components/Group/Group.js.map +1 -0
- package/dist/src/components/Group/Group.stories.d.ts +9 -0
- package/dist/src/components/Group/Group.stories.d.ts.map +1 -0
- package/dist/src/components/Group/Group.stories.js +27 -0
- package/dist/src/components/Group/Group.stories.js.map +1 -0
- package/dist/src/components/Group/index.d.ts +2 -0
- package/dist/src/components/Group/index.d.ts.map +1 -0
- package/dist/src/components/Group/index.js +21 -0
- package/dist/src/components/Group/index.js.map +1 -0
- package/dist/src/components/Heading/Heading.d.ts +266 -0
- package/dist/src/components/Heading/Heading.d.ts.map +1 -0
- package/dist/src/components/Heading/Heading.js +28 -0
- package/dist/src/components/Heading/Heading.js.map +1 -0
- package/dist/src/components/Heading/Heading.stories.d.ts +274 -0
- package/dist/src/components/Heading/Heading.stories.d.ts.map +1 -0
- package/dist/src/components/Heading/Heading.stories.js +34 -0
- package/dist/src/components/Heading/Heading.stories.js.map +1 -0
- package/dist/src/components/Heading/index.d.ts +2 -0
- package/dist/src/components/Heading/index.d.ts.map +1 -0
- package/dist/src/components/Heading/index.js +21 -0
- package/dist/src/components/Heading/index.js.map +1 -0
- package/dist/src/components/Input/Input.d.ts +17 -0
- package/dist/src/components/Input/Input.d.ts.map +1 -0
- package/dist/src/components/Input/Input.js +70 -0
- package/dist/src/components/Input/Input.js.map +1 -0
- package/dist/src/components/Input/Input.stories.d.ts +23 -0
- package/dist/src/components/Input/Input.stories.d.ts.map +1 -0
- package/dist/src/components/Input/Input.stories.js +73 -0
- package/dist/src/components/Input/Input.stories.js.map +1 -0
- package/dist/src/components/Input/index.d.ts +2 -0
- package/dist/src/components/Input/index.d.ts.map +1 -0
- package/dist/src/components/Input/index.js +21 -0
- package/dist/src/components/Input/index.js.map +1 -0
- package/dist/src/components/Loading/Loading.d.ts +12 -0
- package/dist/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/src/components/Loading/Loading.js +29 -0
- package/dist/src/components/Loading/Loading.js.map +1 -0
- package/dist/src/components/Loading/Loading.stories.d.ts +25 -0
- package/dist/src/components/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/src/components/Loading/Loading.stories.js +39 -0
- package/dist/src/components/Loading/Loading.stories.js.map +1 -0
- package/dist/src/components/Loading/index.d.ts +2 -0
- package/dist/src/components/Loading/index.d.ts.map +1 -0
- package/dist/src/components/Loading/index.js +21 -0
- package/dist/src/components/Loading/index.js.map +1 -0
- package/dist/src/components/NavMenu/NavMenu.d.ts +31 -0
- package/dist/src/components/NavMenu/NavMenu.d.ts.map +1 -0
- package/dist/src/components/NavMenu/NavMenu.js +71 -0
- package/dist/src/components/NavMenu/NavMenu.js.map +1 -0
- package/dist/src/components/NavMenu/NavMenu.stories.d.ts +9 -0
- package/dist/src/components/NavMenu/NavMenu.stories.d.ts.map +1 -0
- package/dist/src/components/NavMenu/NavMenu.stories.js +50 -0
- package/dist/src/components/NavMenu/NavMenu.stories.js.map +1 -0
- package/dist/src/components/NavMenu/index.d.ts +2 -0
- package/dist/src/components/NavMenu/index.d.ts.map +1 -0
- package/dist/src/components/NavMenu/index.js +21 -0
- package/dist/src/components/NavMenu/index.js.map +1 -0
- package/dist/src/components/Popover/Popover.d.ts +11 -0
- package/dist/src/components/Popover/Popover.d.ts.map +1 -0
- package/dist/src/components/Popover/Popover.js +56 -0
- package/dist/src/components/Popover/Popover.js.map +1 -0
- package/dist/src/components/Popover/Popover.stories.d.ts +10 -0
- package/dist/src/components/Popover/Popover.stories.d.ts.map +1 -0
- package/dist/src/components/Popover/Popover.stories.js +39 -0
- package/dist/src/components/Popover/Popover.stories.js.map +1 -0
- package/dist/src/components/Popover/index.d.ts +2 -0
- package/dist/src/components/Popover/index.d.ts.map +1 -0
- package/dist/src/components/Popover/index.js +21 -0
- package/dist/src/components/Popover/index.js.map +1 -0
- package/dist/src/components/QrCode/QrCode.d.ts +11 -0
- package/dist/src/components/QrCode/QrCode.d.ts.map +1 -0
- package/dist/src/components/QrCode/QrCode.js +51 -0
- package/dist/src/components/QrCode/QrCode.js.map +1 -0
- package/dist/src/components/QrCode/QrCode.stories.d.ts +9 -0
- package/dist/src/components/QrCode/QrCode.stories.d.ts.map +1 -0
- package/dist/src/components/QrCode/QrCode.stories.js +29 -0
- package/dist/src/components/QrCode/QrCode.stories.js.map +1 -0
- package/dist/src/components/QrCode/index.d.ts +2 -0
- package/dist/src/components/QrCode/index.d.ts.map +1 -0
- package/dist/src/components/QrCode/index.js +21 -0
- package/dist/src/components/QrCode/index.js.map +1 -0
- package/dist/src/components/Tag/Tag.d.ts +8 -0
- package/dist/src/components/Tag/Tag.d.ts.map +1 -0
- package/dist/src/components/Tag/Tag.js +23 -0
- package/dist/src/components/Tag/Tag.js.map +1 -0
- package/dist/src/components/Tag/Tag.stories.d.ts +10 -0
- package/dist/src/components/Tag/Tag.stories.d.ts.map +1 -0
- package/dist/src/components/Tag/Tag.stories.js +24 -0
- package/dist/src/components/Tag/Tag.stories.js.map +1 -0
- package/dist/src/components/Tag/index.d.ts +2 -0
- package/dist/src/components/Tag/index.d.ts.map +1 -0
- package/dist/src/components/Tag/index.js +21 -0
- package/dist/src/components/Tag/index.js.map +1 -0
- package/dist/src/components/Toast/Toast.d.ts +16 -0
- package/dist/src/components/Toast/Toast.d.ts.map +1 -0
- package/dist/src/components/Toast/Toast.js +54 -0
- package/dist/src/components/Toast/Toast.js.map +1 -0
- package/dist/src/components/Toast/Toast.stories.d.ts +9 -0
- package/dist/src/components/Toast/Toast.stories.d.ts.map +1 -0
- package/dist/src/components/Toast/Toast.stories.js +32 -0
- package/dist/src/components/Toast/Toast.stories.js.map +1 -0
- package/dist/src/components/Toast/index.d.ts +2 -0
- package/dist/src/components/Toast/index.d.ts.map +1 -0
- package/dist/src/components/Toast/index.js +21 -0
- package/dist/src/components/Toast/index.js.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.js +50 -0
- package/dist/src/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts +9 -0
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -0
- package/dist/src/components/Tooltip/Tooltip.stories.js +30 -0
- package/dist/src/components/Tooltip/Tooltip.stories.js.map +1 -0
- package/dist/src/components/Tooltip/index.d.ts +2 -0
- package/dist/src/components/Tooltip/index.d.ts.map +1 -0
- package/dist/src/components/Tooltip/index.js +21 -0
- package/dist/src/components/Tooltip/index.js.map +1 -0
- package/dist/src/components/UiProvider/UiProvider.d.ts +10 -0
- package/dist/src/components/UiProvider/UiProvider.d.ts.map +1 -0
- package/dist/src/components/UiProvider/UiProvider.js +21 -0
- package/dist/src/components/UiProvider/UiProvider.js.map +1 -0
- package/dist/src/components/UiProvider/index.d.ts +2 -0
- package/dist/src/components/UiProvider/index.d.ts.map +1 -0
- package/dist/src/components/UiProvider/index.js +21 -0
- package/dist/src/components/UiProvider/index.js.map +1 -0
- package/dist/src/components/index.d.ts +18 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +37 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/hooks/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/index.js +21 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/useId.d.ts +2 -0
- package/dist/src/hooks/useId.d.ts.map +1 -0
- package/dist/src/hooks/useId.js +19 -0
- package/dist/src/hooks/useId.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +24 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/plugin.d.ts +9 -0
- package/dist/src/plugin.d.ts.map +1 -0
- package/dist/src/plugin.js +268 -0
- package/dist/src/plugin.js.map +1 -0
- package/dist/src/props/Elevation.d.ts +2 -0
- package/dist/src/props/Elevation.d.ts.map +1 -0
- package/dist/src/props/Elevation.js +6 -0
- package/dist/src/props/Elevation.js.map +1 -0
- package/dist/src/props/MessageValence.d.ts +2 -0
- package/dist/src/props/MessageValence.d.ts.map +1 -0
- package/dist/src/props/MessageValence.js +6 -0
- package/dist/src/props/MessageValence.js.map +1 -0
- package/dist/src/props/Size.d.ts +2 -0
- package/dist/src/props/Size.d.ts.map +1 -0
- package/dist/src/props/Size.js +6 -0
- package/dist/src/props/Size.js.map +1 -0
- package/dist/src/props/index.d.ts +4 -0
- package/dist/src/props/index.d.ts.map +1 -0
- package/dist/src/props/index.js +23 -0
- package/dist/src/props/index.js.map +1 -0
- package/dist/src/styles/active.d.ts +2 -0
- package/dist/src/styles/active.d.ts.map +1 -0
- package/dist/src/styles/active.js +12 -0
- package/dist/src/styles/active.js.map +1 -0
- package/dist/src/styles/disabled.d.ts +2 -0
- package/dist/src/styles/disabled.d.ts.map +1 -0
- package/dist/src/styles/disabled.js +8 -0
- package/dist/src/styles/disabled.js.map +1 -0
- package/dist/src/styles/focus.d.ts +2 -0
- package/dist/src/styles/focus.d.ts.map +1 -0
- package/dist/src/styles/focus.js +8 -0
- package/dist/src/styles/focus.js.map +1 -0
- package/dist/src/styles/group.d.ts +5 -0
- package/dist/src/styles/group.d.ts.map +1 -0
- package/dist/src/styles/group.js +26 -0
- package/dist/src/styles/group.js.map +1 -0
- package/dist/src/styles/hover.d.ts +4 -0
- package/dist/src/styles/hover.d.ts.map +1 -0
- package/dist/src/styles/hover.js +12 -0
- package/dist/src/styles/hover.js.map +1 -0
- package/dist/src/styles/index.d.ts +10 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/dist/src/styles/index.js +29 -0
- package/dist/src/styles/index.js.map +1 -0
- package/dist/src/styles/ornament.d.ts +3 -0
- package/dist/src/styles/ornament.d.ts.map +1 -0
- package/dist/src/styles/ornament.js +9 -0
- package/dist/src/styles/ornament.js.map +1 -0
- package/dist/src/styles/size.d.ts +7 -0
- package/dist/src/styles/size.d.ts.map +1 -0
- package/dist/src/styles/size.js +89 -0
- package/dist/src/styles/size.js.map +1 -0
- package/dist/src/styles/text.d.ts +5 -0
- package/dist/src/styles/text.d.ts.map +1 -0
- package/dist/src/styles/text.js +11 -0
- package/dist/src/styles/text.js.map +1 -0
- package/dist/src/styles/valence.d.ts +19 -0
- package/dist/src/styles/valence.d.ts.map +1 -0
- package/dist/src/styles/valence.js +66 -0
- package/dist/src/styles/valence.js.map +1 -0
- package/dist/src/testing/index.d.ts +2 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +21 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/templateForComponent.d.ts +4 -0
- package/dist/src/testing/templateForComponent.d.ts.map +1 -0
- package/dist/src/testing/templateForComponent.js +18 -0
- package/dist/src/testing/templateForComponent.js.map +1 -0
- package/dist/src/theme.css +62 -0
- package/package.json +55 -0
- package/src/components/Alert/Alert.stories.tsx +31 -0
- package/src/components/Alert/Alert.tsx +34 -0
- package/src/components/Alert/index.ts +5 -0
- package/src/components/Avatar/Avatar.stories.tsx +29 -0
- package/src/components/Avatar/Avatar.tsx +82 -0
- package/src/components/Avatar/index.ts +5 -0
- package/src/components/Button/Button.stories.tsx +43 -0
- package/src/components/Button/Button.tsx +20 -0
- package/src/components/Button/ButtonProps.ts +10 -0
- package/src/components/Button/buttonStyles.ts +32 -0
- package/src/components/Button/index.ts +7 -0
- package/src/components/CompoundButton/CompoundButton.stories.tsx +46 -0
- package/src/components/CompoundButton/CompoundButton.tsx +53 -0
- package/src/components/CompoundButton/index.ts +5 -0
- package/src/components/Dialog/Dialog.stories.tsx +37 -0
- package/src/components/Dialog/Dialog.tsx +124 -0
- package/src/components/Dialog/index.ts +5 -0
- package/src/components/Group/Group.stories.tsx +25 -0
- package/src/components/Group/Group.tsx +48 -0
- package/src/components/Group/index.ts +5 -0
- package/src/components/Heading/Heading.stories.tsx +29 -0
- package/src/components/Heading/Heading.tsx +28 -0
- package/src/components/Heading/index.ts +5 -0
- package/src/components/Input/Input.stories.tsx +91 -0
- package/src/components/Input/Input.tsx +132 -0
- package/src/components/Input/index.ts +5 -0
- package/src/components/Loading/Loading.stories.tsx +34 -0
- package/src/components/Loading/Loading.tsx +59 -0
- package/src/components/Loading/index.ts +5 -0
- package/src/components/Main/Main.tsx +14 -0
- package/src/components/Main/index.ts +5 -0
- package/src/components/NavMenu/NavMenu.stories.tsx +54 -0
- package/src/components/NavMenu/NavMenu.tsx +180 -0
- package/src/components/NavMenu/index.ts +5 -0
- package/src/components/Popover/Popover.stories.tsx +45 -0
- package/src/components/Popover/Popover.tsx +76 -0
- package/src/components/Popover/index.ts +5 -0
- package/src/components/QrCode/QrCode.stories.tsx +27 -0
- package/src/components/QrCode/QrCode.tsx +42 -0
- package/src/components/QrCode/index.ts +5 -0
- package/src/components/Toast/Toast.stories.tsx +31 -0
- package/src/components/Toast/Toast.tsx +84 -0
- package/src/components/Toast/index.ts +5 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +28 -0
- package/src/components/Tooltip/Tooltip.tsx +57 -0
- package/src/components/Tooltip/index.ts +5 -0
- package/src/components/UiProvider/UiProvider.tsx +44 -0
- package/src/components/UiProvider/index.ts +5 -0
- package/src/components/index.ts +20 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useId.ts +21 -0
- package/src/index.ts +8 -0
- package/src/plugin.ts +270 -0
- package/src/props/MessageValence.ts +5 -0
- package/src/props/Size.ts +40 -0
- package/src/props/index.ts +6 -0
- package/src/styles/active.ts +11 -0
- package/src/styles/disabled.ts +5 -0
- package/src/styles/focus.ts +6 -0
- package/src/styles/hover.ts +10 -0
- package/src/styles/index.ts +11 -0
- package/src/styles/size.ts +87 -0
- package/src/styles/text.ts +10 -0
- package/src/styles/valence.ts +71 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/templateForComponent.tsx +16 -0
- package/src/theme.css +62 -0
- package/src/typings.d.ts +7 -0
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import tailwindcssForms from '@tailwindcss/forms';
|
|
6
|
+
import autoprefixer from 'autoprefixer';
|
|
7
|
+
import { resolve } from 'path';
|
|
8
|
+
import tailwindcss from 'tailwindcss';
|
|
9
|
+
import tailwindcssRadix from 'tailwindcss-radix';
|
|
10
|
+
import tailwindColors from 'tailwindcss/colors';
|
|
11
|
+
import defaultConfig from 'tailwindcss/stubs/defaultConfig.stub.js';
|
|
12
|
+
import { Plugin } from 'vite';
|
|
13
|
+
|
|
14
|
+
export interface VitePluginTailwindOptions {
|
|
15
|
+
jit?: boolean;
|
|
16
|
+
cssPath?: string;
|
|
17
|
+
virtualFileId?: string;
|
|
18
|
+
content: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const themePlugin = (options: VitePluginTailwindOptions) => {
|
|
22
|
+
const config: VitePluginTailwindOptions = {
|
|
23
|
+
jit: true,
|
|
24
|
+
cssPath: resolve(__dirname, './theme.css'),
|
|
25
|
+
virtualFileId: '@dxosTheme',
|
|
26
|
+
...options
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
name: 'vite-plugin-dxos-ui-theme',
|
|
31
|
+
config: ({ root }, env) => {
|
|
32
|
+
return {
|
|
33
|
+
css: {
|
|
34
|
+
postcss: {
|
|
35
|
+
plugins: [
|
|
36
|
+
tailwindcss({
|
|
37
|
+
darkMode: 'class',
|
|
38
|
+
theme: {
|
|
39
|
+
fontFamily: {
|
|
40
|
+
body: ['Roboto FlexVariable', ...defaultConfig.theme.fontFamily.sans],
|
|
41
|
+
display: ['Space GroteskVariable', 'Roboto FlexVariable', ...defaultConfig.theme.fontFamily.sans],
|
|
42
|
+
mono: ['Fira CodeVariable', ...defaultConfig.theme.fontFamily.mono]
|
|
43
|
+
},
|
|
44
|
+
extend: {
|
|
45
|
+
colors: {
|
|
46
|
+
success: tailwindColors.emerald,
|
|
47
|
+
warning: tailwindColors.amber,
|
|
48
|
+
error: tailwindColors.red,
|
|
49
|
+
info: tailwindColors.cyan,
|
|
50
|
+
neutral: {
|
|
51
|
+
// Key color #707076
|
|
52
|
+
// Hue torsion 0.0º
|
|
53
|
+
// C*CP black 0.80, C*CP white 0.88
|
|
54
|
+
950: '#101012',
|
|
55
|
+
900: '#1b1b1e',
|
|
56
|
+
850: '#252529',
|
|
57
|
+
800: '#303034',
|
|
58
|
+
750: '#3b3b3f',
|
|
59
|
+
700: '#46464b',
|
|
60
|
+
650: '#525257',
|
|
61
|
+
600: '#5e5e64',
|
|
62
|
+
550: '#6a6a70',
|
|
63
|
+
500: '#77767d',
|
|
64
|
+
450: '#838389',
|
|
65
|
+
400: '#909096',
|
|
66
|
+
350: '#9d9da4',
|
|
67
|
+
300: '#ababb1',
|
|
68
|
+
250: '#b8b8be',
|
|
69
|
+
200: '#c6c6cc',
|
|
70
|
+
150: '#d4d4d9',
|
|
71
|
+
100: '#e2e2e7',
|
|
72
|
+
50: '#f1f1f4'
|
|
73
|
+
},
|
|
74
|
+
primary: {
|
|
75
|
+
// Key color #00e0e0
|
|
76
|
+
// Hue torsion -73.5º
|
|
77
|
+
// C*CP black 1.0, C*CP white 1.0
|
|
78
|
+
950: '#110c2a',
|
|
79
|
+
900: '#101940',
|
|
80
|
+
850: '#0b2453',
|
|
81
|
+
800: '#003164',
|
|
82
|
+
750: '#003e70',
|
|
83
|
+
700: '#004b7c',
|
|
84
|
+
650: '#005887',
|
|
85
|
+
600: '#006693',
|
|
86
|
+
550: '#00749e',
|
|
87
|
+
500: '#0082a9',
|
|
88
|
+
450: '#0091b3',
|
|
89
|
+
400: '#00a0be',
|
|
90
|
+
350: '#00afc7',
|
|
91
|
+
300: '#00bed0',
|
|
92
|
+
250: '#00ced8',
|
|
93
|
+
200: '#00dedf',
|
|
94
|
+
150: '#3cede4',
|
|
95
|
+
100: '#69fae8',
|
|
96
|
+
50: '#b9ffee'
|
|
97
|
+
},
|
|
98
|
+
transparent: 'transparent',
|
|
99
|
+
current: 'currentColor',
|
|
100
|
+
white: '#ffffff',
|
|
101
|
+
black: '#000000'
|
|
102
|
+
},
|
|
103
|
+
fontSize: {
|
|
104
|
+
// Base size 16px
|
|
105
|
+
// Scale 1.125
|
|
106
|
+
xs: ['0.79rem', { lineHeight: '1rem' }],
|
|
107
|
+
sm: ['0.889rem', { lineHeight: '1.25rem' }],
|
|
108
|
+
base: ['1rem', { lineHeight: '1.5rem' }],
|
|
109
|
+
lg: ['1.125rem', { lineHeight: '1.75rem' }],
|
|
110
|
+
xl: ['1.266rem', { lineHeight: '1.75rem' }],
|
|
111
|
+
'2xl': ['1.424rem', { lineHeight: '2rem' }],
|
|
112
|
+
'3xl': ['1.602rem', { lineHeight: '2.25rem' }],
|
|
113
|
+
'4xl': ['1.802rem', { lineHeight: '2.5rem' }],
|
|
114
|
+
'5xl': ['2.027rem', { lineHeight: '1' }],
|
|
115
|
+
'6xl': ['2.281rem', { lineHeight: '1' }],
|
|
116
|
+
'7xl': ['2.566rem', { lineHeight: '1' }],
|
|
117
|
+
'8xl': ['2.887rem', { lineHeight: '1' }],
|
|
118
|
+
'9xl': ['3.247rem', { lineHeight: '1' }]
|
|
119
|
+
},
|
|
120
|
+
outlineWidth: {
|
|
121
|
+
3: '3px'
|
|
122
|
+
},
|
|
123
|
+
boxShadow: {
|
|
124
|
+
slider: '0 0 0 5px rgba(0, 0, 0, 0.3)'
|
|
125
|
+
},
|
|
126
|
+
keyframes: {
|
|
127
|
+
// Dropdown menu
|
|
128
|
+
'scale-in': {
|
|
129
|
+
'0%': { opacity: '0', transform: 'scale(0)' },
|
|
130
|
+
'100%': { opacity: '1', transform: 'scale(1)' }
|
|
131
|
+
},
|
|
132
|
+
'slide-down': {
|
|
133
|
+
'0%': { opacity: '0', transform: 'translateY(-10px)' },
|
|
134
|
+
'100%': { opacity: '1', transform: 'translateY(0)' }
|
|
135
|
+
},
|
|
136
|
+
'slide-up': {
|
|
137
|
+
'0%': { opacity: '0', transform: 'translateY(10px)' },
|
|
138
|
+
'100%': { opacity: '1', transform: 'translateY(0)' }
|
|
139
|
+
},
|
|
140
|
+
// Tooltip
|
|
141
|
+
'slide-up-fade': {
|
|
142
|
+
'0%': { opacity: '0', transform: 'translateY(2px)' },
|
|
143
|
+
'100%': { opacity: '1', transform: 'translateY(0)' }
|
|
144
|
+
},
|
|
145
|
+
'slide-right-fade': {
|
|
146
|
+
'0%': { opacity: '0', transform: 'translateX(-2px)' },
|
|
147
|
+
'100%': { opacity: '1', transform: 'translateX(0)' }
|
|
148
|
+
},
|
|
149
|
+
'slide-down-fade': {
|
|
150
|
+
'0%': { opacity: '0', transform: 'translateY(-2px)' },
|
|
151
|
+
'100%': { opacity: '1', transform: 'translateY(0)' }
|
|
152
|
+
},
|
|
153
|
+
'slide-left-fade': {
|
|
154
|
+
'0%': { opacity: '0', transform: 'translateX(2px)' },
|
|
155
|
+
'100%': { opacity: '1', transform: 'translateX(0)' }
|
|
156
|
+
},
|
|
157
|
+
// Navigation menu
|
|
158
|
+
'enter-from-right': {
|
|
159
|
+
'0%': { transform: 'translateX(200px)', opacity: '0' },
|
|
160
|
+
'100%': { transform: 'translateX(0)', opacity: '1' }
|
|
161
|
+
},
|
|
162
|
+
'enter-from-left': {
|
|
163
|
+
'0%': { transform: 'translateX(-200px)', opacity: '0' },
|
|
164
|
+
'100%': { transform: 'translateX(0)', opacity: '1' }
|
|
165
|
+
},
|
|
166
|
+
'exit-to-right': {
|
|
167
|
+
'0%': { transform: 'translateX(0)', opacity: '1' },
|
|
168
|
+
'100%': { transform: 'translateX(200px)', opacity: '0' }
|
|
169
|
+
},
|
|
170
|
+
'exit-to-left': {
|
|
171
|
+
'0%': { transform: 'translateX(0)', opacity: '1' },
|
|
172
|
+
'100%': {
|
|
173
|
+
transform: 'translateX(-200px)',
|
|
174
|
+
opacity: '0'
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
'scale-in-content': {
|
|
178
|
+
'0%': {
|
|
179
|
+
transform: 'rotateX(-30deg) scale(0.9)',
|
|
180
|
+
opacity: '0'
|
|
181
|
+
},
|
|
182
|
+
'100%': {
|
|
183
|
+
transform: 'rotateX(0deg) scale(1)',
|
|
184
|
+
opacity: '1'
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
'scale-out-content': {
|
|
188
|
+
'0%': {
|
|
189
|
+
transform: 'rotateX(0deg) scale(1)',
|
|
190
|
+
opacity: '1'
|
|
191
|
+
},
|
|
192
|
+
'100%': {
|
|
193
|
+
transform: 'rotateX(-10deg) scale(0.95)',
|
|
194
|
+
opacity: '0'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
'fade-in': {
|
|
198
|
+
'0%': { opacity: '0' },
|
|
199
|
+
'100%': { opacity: '1' }
|
|
200
|
+
},
|
|
201
|
+
'fade-out': {
|
|
202
|
+
'0%': { opacity: '1' },
|
|
203
|
+
'100%': { opacity: '0' }
|
|
204
|
+
},
|
|
205
|
+
// Toast
|
|
206
|
+
'toast-hide': {
|
|
207
|
+
'0%': { opacity: '1' },
|
|
208
|
+
'100%': { opacity: '0' }
|
|
209
|
+
},
|
|
210
|
+
'toast-slide-in-right': {
|
|
211
|
+
'0%': { transform: 'translateX(calc(100% + 1rem))' },
|
|
212
|
+
'100%': { transform: 'translateX(0)' }
|
|
213
|
+
},
|
|
214
|
+
'toast-slide-in-bottom': {
|
|
215
|
+
'0%': { transform: 'translateY(calc(100% + 1rem))' },
|
|
216
|
+
'100%': { transform: 'translateY(0)' }
|
|
217
|
+
},
|
|
218
|
+
'toast-swipe-out': {
|
|
219
|
+
'0%': {
|
|
220
|
+
transform: 'translateX(var(--radix-toast-swipe-end-x))'
|
|
221
|
+
},
|
|
222
|
+
'100%': {
|
|
223
|
+
transform: 'translateX(calc(100% + 1rem))'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
animation: {
|
|
228
|
+
// Dropdown menu
|
|
229
|
+
'scale-in': 'scale-in 0.2s ease-in-out',
|
|
230
|
+
'slide-down': 'slide-down 0.6s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
231
|
+
'slide-up': 'slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
232
|
+
// Tooltip
|
|
233
|
+
'slide-up-fade': 'slide-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
234
|
+
'slide-right-fade': 'slide-right-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
235
|
+
'slide-down-fade': 'slide-down-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
236
|
+
'slide-left-fade': 'slide-left-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
237
|
+
// Navigation menu
|
|
238
|
+
'enter-from-right': 'enter-from-right 0.25s ease',
|
|
239
|
+
'enter-from-left': 'enter-from-left 0.25s ease',
|
|
240
|
+
'exit-to-right': 'exit-to-right 0.25s ease',
|
|
241
|
+
'exit-to-left': 'exit-to-left 0.25s ease',
|
|
242
|
+
'scale-in-content': 'scale-in-content 0.2s ease',
|
|
243
|
+
'scale-out-content': 'scale-out-content 0.2s ease',
|
|
244
|
+
'fade-in': 'fade-in 0.2s ease',
|
|
245
|
+
'fade-out': 'fade-out 0.2s ease',
|
|
246
|
+
// Toast
|
|
247
|
+
'toast-hide': 'toast-hide 100ms ease-in forwards',
|
|
248
|
+
'toast-slide-in-right': 'toast-slide-in-right 150ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
249
|
+
'toast-slide-in-bottom': 'toast-slide-in-bottom 150ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
250
|
+
'toast-swipe-out': 'toast-swipe-out 100ms ease-out forwards'
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
plugins: [tailwindcssForms, tailwindcssRadix()],
|
|
255
|
+
...(env.mode === 'development' && { mode: 'jit' }),
|
|
256
|
+
content: [resolve(root || './', 'node_modules/@dxos/react-ui/dist/**/*.js'), ...config.content]
|
|
257
|
+
}),
|
|
258
|
+
autoprefixer
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
resolveId: (id) => {
|
|
265
|
+
if (id === config.virtualFileId) {
|
|
266
|
+
return config.cssPath;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
} as Plugin;
|
|
270
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export type Size =
|
|
6
|
+
| 0
|
|
7
|
+
| 'px'
|
|
8
|
+
| 0.5
|
|
9
|
+
| 1
|
|
10
|
+
| 1.5
|
|
11
|
+
| 2
|
|
12
|
+
| 2.5
|
|
13
|
+
| 3
|
|
14
|
+
| 3.5
|
|
15
|
+
| 4
|
|
16
|
+
| 5
|
|
17
|
+
| 6
|
|
18
|
+
| 7
|
|
19
|
+
| 8
|
|
20
|
+
| 9
|
|
21
|
+
| 10
|
|
22
|
+
| 11
|
|
23
|
+
| 12
|
|
24
|
+
| 14
|
|
25
|
+
| 16
|
|
26
|
+
| 20
|
|
27
|
+
| 24
|
|
28
|
+
| 28
|
|
29
|
+
| 32
|
|
30
|
+
| 36
|
|
31
|
+
| 40
|
|
32
|
+
| 44
|
|
33
|
+
| 48
|
|
34
|
+
| 52
|
|
35
|
+
| 56
|
|
36
|
+
| 60
|
|
37
|
+
| 64
|
|
38
|
+
| 72
|
|
39
|
+
| 80
|
|
40
|
+
| 96;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
|
|
7
|
+
export const defaultActive = cx(
|
|
8
|
+
'radix-state-open:outline-2 radix-state-open:outline-offset-1 radix-state-open:outline-primary-300 radix-state-open:outline-offset-transparent dark:radix-state-open:outline-primary-400 dark:radix-state-open:outline-offset-transparent',
|
|
9
|
+
'radix-state-on:outline-2 radix-state-on:outline-offset-1 radix-state-on:outline-primary-300 radix-state-on:outline-offset-transparent dark:radix-state-on:outline-primary-400 dark:radix-state-on:outline-offset-transparent',
|
|
10
|
+
'radix-state-instant-open:outline-2 radix-state-instant-open:outline-offset-1 radix-state-instant-open:outline-primary-300 radix-state-instant-open:outline-offset-transparent dark:radix-state-instant-open:outline-primary-400 dark:radix-state-instant-open:outline-offset-transparent'
|
|
11
|
+
);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const defaultFocus =
|
|
6
|
+
'focus:outline-none focus-visible:hover:outline-none dark:focus-visible:hover:outline-none focus-visible:ring focus-visible:ring-offset-1 focus-visible:ring-primary-500 focus-visible:ring-offset-white dark:focus-visible:ring-primary-200 dark:focus-visible:ring-offset-black';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const defaultHover = ({ disabled }: { disabled?: boolean }) => {
|
|
6
|
+
return (
|
|
7
|
+
!disabled &&
|
|
8
|
+
'outline outline-3 outline-transparent hover:outline-primary-300 dark:hover:outline-primary-400 hover:focus:outline-primary-300 dark:hover:focus:outline-primary-400'
|
|
9
|
+
);
|
|
10
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
|
|
7
|
+
import { Size } from '../props/Size';
|
|
8
|
+
|
|
9
|
+
export const sizeWidthMap = new Map<Size, string>([
|
|
10
|
+
[0, 'w-0'],
|
|
11
|
+
['px', 'w-px'],
|
|
12
|
+
[0.5, 'w-0.5'],
|
|
13
|
+
[1, 'w-1'],
|
|
14
|
+
[1.5, 'w-1.5'],
|
|
15
|
+
[2, 'w-2'],
|
|
16
|
+
[2.5, 'w-2.5'],
|
|
17
|
+
[3, 'w-3'],
|
|
18
|
+
[3.5, 'w-3.5'],
|
|
19
|
+
[4, 'w-4'],
|
|
20
|
+
[5, 'w-5'],
|
|
21
|
+
[6, 'w-6'],
|
|
22
|
+
[7, 'w-7'],
|
|
23
|
+
[8, 'w-8'],
|
|
24
|
+
[9, 'w-9'],
|
|
25
|
+
[10, 'w-10'],
|
|
26
|
+
[11, 'w-11'],
|
|
27
|
+
[12, 'w-12'],
|
|
28
|
+
[14, 'w-14'],
|
|
29
|
+
[16, 'w-16'],
|
|
30
|
+
[20, 'w-20'],
|
|
31
|
+
[24, 'w-24'],
|
|
32
|
+
[28, 'w-28'],
|
|
33
|
+
[32, 'w-32'],
|
|
34
|
+
[36, 'w-36'],
|
|
35
|
+
[40, 'w-40'],
|
|
36
|
+
[44, 'w-44'],
|
|
37
|
+
[48, 'w-48'],
|
|
38
|
+
[52, 'w-52'],
|
|
39
|
+
[56, 'w-56'],
|
|
40
|
+
[60, 'w-60'],
|
|
41
|
+
[64, 'w-64'],
|
|
42
|
+
[72, 'w-72'],
|
|
43
|
+
[80, 'w-80'],
|
|
44
|
+
[96, 'w-96']
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
export const sizeHeightMap = new Map<Size, string>([
|
|
48
|
+
[0, 'h-0'],
|
|
49
|
+
['px', 'h-px'],
|
|
50
|
+
[0.5, 'h-0.5'],
|
|
51
|
+
[1, 'h-1'],
|
|
52
|
+
[1.5, 'h-1.5'],
|
|
53
|
+
[2, 'h-2'],
|
|
54
|
+
[2.5, 'h-2.5'],
|
|
55
|
+
[3, 'h-3'],
|
|
56
|
+
[3.5, 'h-3.5'],
|
|
57
|
+
[4, 'h-4'],
|
|
58
|
+
[5, 'h-5'],
|
|
59
|
+
[6, 'h-6'],
|
|
60
|
+
[7, 'h-7'],
|
|
61
|
+
[8, 'h-8'],
|
|
62
|
+
[9, 'h-9'],
|
|
63
|
+
[10, 'h-10'],
|
|
64
|
+
[11, 'h-11'],
|
|
65
|
+
[12, 'h-12'],
|
|
66
|
+
[14, 'h-14'],
|
|
67
|
+
[16, 'h-16'],
|
|
68
|
+
[20, 'h-20'],
|
|
69
|
+
[24, 'h-24'],
|
|
70
|
+
[28, 'h-28'],
|
|
71
|
+
[32, 'h-32'],
|
|
72
|
+
[36, 'h-36'],
|
|
73
|
+
[40, 'h-40'],
|
|
74
|
+
[44, 'h-44'],
|
|
75
|
+
[48, 'h-48'],
|
|
76
|
+
[52, 'h-52'],
|
|
77
|
+
[56, 'h-56'],
|
|
78
|
+
[60, 'h-60'],
|
|
79
|
+
[64, 'h-64'],
|
|
80
|
+
[72, 'h-72'],
|
|
81
|
+
[80, 'h-80'],
|
|
82
|
+
[96, 'h-96']
|
|
83
|
+
]);
|
|
84
|
+
|
|
85
|
+
export const getSizeHeight = sizeHeightMap.get.bind(sizeHeightMap);
|
|
86
|
+
export const getSizeWidth = sizeWidthMap.get.bind(sizeWidthMap);
|
|
87
|
+
export const getSize = (size: Size) => cx(getSizeHeight(size), getSizeWidth(size));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export const defaultPlaceholder = 'placeholder-neutral-500 dark:placeholder-neutral-400';
|
|
6
|
+
|
|
7
|
+
export const defaultDescription = 'text-xs font-normal text-neutral-650 dark:text-neutral-300';
|
|
8
|
+
export const primaryDescription = 'text-xs font-normal text-white/90';
|
|
9
|
+
|
|
10
|
+
export const defaultTooltip = 'text-xs font-normal text-neutral-900 dark:text-neutral-50';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { MessageValence } from '../props';
|
|
6
|
+
|
|
7
|
+
export const successText = 'text-xs font-medium text-success-700 dark:text-success-300';
|
|
8
|
+
export const infoText = 'text-xs font-medium text-info-700 dark:text-info-300';
|
|
9
|
+
export const warningText = 'text-xs font-medium text-warning-700 dark:text-warning-300';
|
|
10
|
+
export const errorText = 'text-xs font-medium text-error-700 dark:text-error-300';
|
|
11
|
+
|
|
12
|
+
export const valenceColorText = (valence?: MessageValence) => {
|
|
13
|
+
switch (valence) {
|
|
14
|
+
case 'success':
|
|
15
|
+
return successText;
|
|
16
|
+
case 'info':
|
|
17
|
+
return infoText;
|
|
18
|
+
case 'warning':
|
|
19
|
+
return warningText;
|
|
20
|
+
case 'error':
|
|
21
|
+
return errorText;
|
|
22
|
+
default:
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const neutralInputBorder = 'border-neutral-500 dark:border-neutral-600';
|
|
28
|
+
export const successInputBorder = 'border-success-500 dark:border-success-600';
|
|
29
|
+
export const infoInputBorder = 'border-info-500 dark:border-info-600';
|
|
30
|
+
export const warningInputBorder = 'border-warning-500 dark:border-warning-600';
|
|
31
|
+
export const errorInputBorder = 'border-error-500 dark:border-error-600';
|
|
32
|
+
|
|
33
|
+
export const valenceInputBorder = (valence?: MessageValence) => {
|
|
34
|
+
switch (valence) {
|
|
35
|
+
case 'success':
|
|
36
|
+
return successInputBorder;
|
|
37
|
+
case 'info':
|
|
38
|
+
return infoInputBorder;
|
|
39
|
+
case 'warning':
|
|
40
|
+
return warningInputBorder;
|
|
41
|
+
case 'error':
|
|
42
|
+
return errorInputBorder;
|
|
43
|
+
default:
|
|
44
|
+
return neutralInputBorder;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const neutralAlertColors = 'border-neutral-500 dark:border-neutral-600';
|
|
49
|
+
export const successAlertColors =
|
|
50
|
+
'border-success-500 dark:border-success-600 text-success-700 dark:text-success-100 bg-success-50 dark:bg-success-900';
|
|
51
|
+
export const infoAlertColors =
|
|
52
|
+
'border-info-500 dark:border-info-600 text-info-700 dark:text-info-100 bg-info-50 dark:bg-info-900';
|
|
53
|
+
export const warningAlertColors =
|
|
54
|
+
'border-warning-500 dark:border-warning-600 text-warning-700 dark:text-warning-100 bg-warning-50 dark:bg-warning-900';
|
|
55
|
+
export const errorAlertColors =
|
|
56
|
+
'border-error-500 dark:border-error-600 text-error-700 dark:text-error-100 bg-error-50 dark:bg-error-900';
|
|
57
|
+
|
|
58
|
+
export const valenceAlertColors = (valence?: MessageValence) => {
|
|
59
|
+
switch (valence) {
|
|
60
|
+
case 'success':
|
|
61
|
+
return successAlertColors;
|
|
62
|
+
case 'info':
|
|
63
|
+
return infoAlertColors;
|
|
64
|
+
case 'warning':
|
|
65
|
+
return warningAlertColors;
|
|
66
|
+
case 'error':
|
|
67
|
+
return errorAlertColors;
|
|
68
|
+
default:
|
|
69
|
+
return neutralAlertColors;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { ComponentStory, Story } from '@storybook/react';
|
|
6
|
+
import React, { FC } from 'react';
|
|
7
|
+
|
|
8
|
+
export const templateForComponent =
|
|
9
|
+
<P extends {}>(Component: FC<P>) =>
|
|
10
|
+
(props: P): Story<P> => {
|
|
11
|
+
const template: ComponentStory<typeof Component> = (args) => <Component {...args} />;
|
|
12
|
+
|
|
13
|
+
const story = template.bind({});
|
|
14
|
+
story.args = props;
|
|
15
|
+
return story;
|
|
16
|
+
};
|
package/src/theme.css
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@import '@fontsource/roboto-flex/variable-full.css';
|
|
2
|
+
@import '@fontsource/fira-code/variable.css';
|
|
3
|
+
@import '@fontsource/space-grotesk/variable-full.css';
|
|
4
|
+
|
|
5
|
+
@tailwind base;
|
|
6
|
+
@tailwind utilities;
|
|
7
|
+
@tailwind components;
|
|
8
|
+
|
|
9
|
+
@layer utilities {
|
|
10
|
+
/* Font weights */
|
|
11
|
+
.font-thin {
|
|
12
|
+
font-variation-settings: 'wght' 100;
|
|
13
|
+
}
|
|
14
|
+
.font-extralight {
|
|
15
|
+
font-variation-settings: 'wght' 200;
|
|
16
|
+
}
|
|
17
|
+
.font-light {
|
|
18
|
+
font-variation-settings: 'wght' 300;
|
|
19
|
+
}
|
|
20
|
+
.font-normal {
|
|
21
|
+
font-variation-settings: 'wght' 400;
|
|
22
|
+
}
|
|
23
|
+
.font-medium {
|
|
24
|
+
font-variation-settings: 'wght' 500;
|
|
25
|
+
}
|
|
26
|
+
.font-semibold {
|
|
27
|
+
font-variation-settings: 'wght' 600;
|
|
28
|
+
}
|
|
29
|
+
.font-bold {
|
|
30
|
+
font-variation-settings: 'wght' 700;
|
|
31
|
+
}
|
|
32
|
+
.font-extrabold {
|
|
33
|
+
font-variation-settings: 'wght' 800;
|
|
34
|
+
}
|
|
35
|
+
.font-black {
|
|
36
|
+
font-variation-settings: 'wght' 900;
|
|
37
|
+
}
|
|
38
|
+
/* Elevations */
|
|
39
|
+
.button-elevation {
|
|
40
|
+
box-shadow: var(--button-elevation)
|
|
41
|
+
}
|
|
42
|
+
.elevated-buttons {
|
|
43
|
+
--button-elevation: theme(boxShadow.sm);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:root {
|
|
48
|
+
--surface-bg: theme(colors.neutral.50);
|
|
49
|
+
--surface-text: theme(colors.neutral.900);
|
|
50
|
+
--button-elevation: theme(boxShadow.md);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.dark {
|
|
54
|
+
--surface-bg: theme(colors.neutral.900);
|
|
55
|
+
--surface-text: theme(colors.neutral.50);
|
|
56
|
+
--button-elevation: theme(boxShadow.lg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
html {
|
|
60
|
+
background-color: var(--surface-bg);
|
|
61
|
+
color: var(--surface-text);
|
|
62
|
+
}
|