@rovula/ui 0.0.19 → 0.0.21
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/cjs/bundle.css +3220 -1382
- package/dist/cjs/bundle.js +3 -3
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/ActionButton/ActionButton.stories.d.ts +4 -4
- package/dist/cjs/types/components/ActionButton/ActionButton.styles copy.d.ts +6 -0
- package/dist/cjs/types/components/Button/Button.styles copy.d.ts +7 -0
- package/dist/cjs/types/components/Button/Button.styles.d.ts +1 -0
- package/dist/cjs/types/components/Button/Buttons.stories.d.ts +12 -4
- package/dist/cjs/types/components/Calendar/Calendar.d.ts +0 -1
- package/dist/cjs/types/components/Calendar/Calendar.stories.d.ts +7 -7
- package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +6 -6
- package/dist/cjs/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/cjs/types/components/DatePicker/DatePicker.stories.d.ts +2 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +8 -6
- package/dist/cjs/types/components/Input/Input.stories.d.ts +12 -12
- package/dist/cjs/types/components/Label/Label.stories.d.ts +6 -6
- package/dist/cjs/types/components/Loading/Loading.d.ts +14 -0
- package/dist/cjs/types/components/Loading/Loading.stories.d.ts +35 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.d.ts +13 -0
- package/dist/cjs/types/components/ProgressBar/ProgressBar.stories.d.ts +37 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +5 -5
- package/dist/cjs/types/components/Search/Search.d.ts +22 -1
- package/dist/cjs/types/components/Search/Search.stories.d.ts +338 -7
- package/dist/cjs/types/components/Table/Table.stories.d.ts +4 -4
- package/dist/cjs/types/components/Text/Text.d.ts +1 -1
- package/dist/cjs/types/components/Text/Text.stories.d.ts +1 -1
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +4 -0
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +11 -6
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +8 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/stories/ColorGroupPreview.d.ts +1 -0
- package/dist/cjs/types/stories/ColorPreview.d.ts +5 -0
- package/dist/components/ActionButton/ActionButton.js +1 -1
- package/dist/components/ActionButton/ActionButton.stories.js +1 -1
- package/dist/components/ActionButton/ActionButton.styles copy.js +90 -0
- package/dist/components/ActionButton/ActionButton.styles.js +54 -15
- package/dist/components/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Button/Button.js +3 -2
- package/dist/components/Button/Button.styles copy.js +210 -0
- package/dist/components/Button/Button.styles.js +203 -43
- package/dist/components/Button/Buttons.stories.js +9 -1
- package/dist/components/Calendar/Calendar.js +39 -2
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Collapsible/Collapsible.styles.js +6 -3
- package/dist/components/DatePicker/DatePicker.js +13 -2
- package/dist/components/Dialog/Dialog.js +4 -4
- package/dist/components/Dropdown/Dropdown.js +9 -7
- package/dist/components/Dropdown/Dropdown.styles.js +1 -1
- package/dist/components/Input/Input.js +8 -1
- package/dist/components/Input/Input.stories.js +3 -2
- package/dist/components/Input/Input.styles.js +13 -5
- package/dist/components/Loading/Loading.js +23 -0
- package/dist/components/Loading/Loading.stories.js +37 -0
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +22 -0
- package/dist/components/ProgressBar/ProgressBar.stories.js +52 -0
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/Search/Search.js +6 -7
- package/dist/components/Search/Search.stories.js +8 -5
- package/dist/components/Text/Text.js +17 -2
- package/dist/components/Text/Text.stories.js +5 -1
- package/dist/components/TextInput/TextInput.js +14 -5
- package/dist/components/TextInput/TextInput.stories.js +3 -2
- package/dist/components/TextInput/TextInput.styles.js +120 -18
- package/dist/esm/bundle.css +3220 -1382
- package/dist/esm/bundle.js +3 -3
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/ActionButton/ActionButton.stories.d.ts +4 -4
- package/dist/esm/types/components/ActionButton/ActionButton.styles copy.d.ts +6 -0
- package/dist/esm/types/components/Button/Button.styles copy.d.ts +7 -0
- package/dist/esm/types/components/Button/Button.styles.d.ts +1 -0
- package/dist/esm/types/components/Button/Buttons.stories.d.ts +12 -4
- package/dist/esm/types/components/Calendar/Calendar.d.ts +0 -1
- package/dist/esm/types/components/Calendar/Calendar.stories.d.ts +7 -7
- package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +6 -6
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/esm/types/components/DatePicker/DatePicker.stories.d.ts +2 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +8 -6
- package/dist/esm/types/components/Input/Input.stories.d.ts +12 -12
- package/dist/esm/types/components/Label/Label.stories.d.ts +6 -6
- package/dist/esm/types/components/Loading/Loading.d.ts +14 -0
- package/dist/esm/types/components/Loading/Loading.stories.d.ts +35 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.d.ts +13 -0
- package/dist/esm/types/components/ProgressBar/ProgressBar.stories.d.ts +37 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +5 -5
- package/dist/esm/types/components/Search/Search.d.ts +22 -1
- package/dist/esm/types/components/Search/Search.stories.d.ts +338 -7
- package/dist/esm/types/components/Table/Table.stories.d.ts +4 -4
- package/dist/esm/types/components/Text/Text.d.ts +1 -1
- package/dist/esm/types/components/Text/Text.stories.d.ts +1 -1
- package/dist/esm/types/components/TextInput/TextInput.d.ts +4 -0
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +11 -6
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +8 -0
- package/dist/esm/types/index.d.ts +3 -0
- package/dist/esm/types/stories/ColorGroupPreview.d.ts +1 -0
- package/dist/esm/types/stories/ColorPreview.d.ts +5 -0
- package/dist/index.d.ts +53 -2
- package/dist/index.js +3 -0
- package/dist/src/theme/global.css +5078 -918
- package/dist/stories/ColorGroupPreview.js +478 -0
- package/dist/stories/ColorPreview.js +8 -0
- package/dist/theme/global.css +7 -227
- package/dist/theme/main-preset.js +131 -67
- package/dist/theme/plugins/utilities/typography.js +12 -0
- package/dist/theme/presets/colors.js +101 -220
- package/dist/theme/theme.d.ts +69 -0
- package/dist/theme/themes/xspector/baseline.css +7 -0
- package/dist/theme/themes/xspector/color.css +67 -0
- package/dist/theme/themes/xspector/components/action-button.css +98 -0
- package/dist/theme/themes/xspector/components/loading.css +11 -0
- package/dist/theme/themes/xspector/palette.css +122 -0
- package/dist/theme/themes/xspector/state.css +89 -0
- package/dist/theme/themes/xspector/transparent.css +68 -0
- package/dist/theme/themes/xspector/typography.css +27 -0
- package/dist/theme/tokens/baseline.css +10 -0
- package/dist/theme/tokens/color.css +63 -0
- package/dist/theme/tokens/components/action-button.css +127 -0
- package/dist/theme/tokens/components/button.css +512 -0
- package/dist/theme/tokens/components/loading.css +11 -0
- package/dist/theme/tokens/components/navbar.css +8 -0
- package/dist/theme/tokens/components/progress-bar.css +8 -0
- package/dist/theme/tokens/palette.css +122 -0
- package/dist/theme/tokens/state.css +82 -0
- package/dist/theme/tokens/transparent.css +68 -0
- package/dist/theme/tokens/typography.css +178 -0
- package/dist/theme/tokens/variables.css +28 -0
- package/dist/theme/utils.js +98 -0
- package/package.json +1 -1
- package/src/_theme/global copy.css +761 -0
- package/src/_theme/global.css +39 -0
- package/src/_theme/main-preset.js +239 -0
- package/src/_theme/plugins/utilities/typography.js +81 -0
- package/src/_theme/presets/colors copy 2.js +319 -0
- package/src/_theme/presets/colors copy.js +229 -0
- package/src/_theme/presets/colors.js +94 -0
- package/src/_theme/theme.d.ts +69 -0
- package/src/_theme/variables/base/button.css +334 -0
- package/src/_theme/variables/base/components copy.css +19 -0
- package/src/_theme/variables/default/colors.css +292 -0
- package/src/_theme/variables/default/typography.css +178 -0
- package/src/_theme/variables/xspector/colors.css +468 -0
- package/src/_theme/variables/xspector/typography.css +178 -0
- package/src/components/ActionButton/ActionButton.stories.tsx +1 -1
- package/src/components/ActionButton/ActionButton.styles copy.ts +95 -0
- package/src/components/ActionButton/ActionButton.styles.ts +54 -19
- package/src/components/ActionButton/ActionButton.tsx +1 -1
- package/src/components/AlertDialog/AlertDialog.tsx +2 -2
- package/src/components/Avatar/Avatar.styles.ts +1 -1
- package/src/components/Button/Button.styles copy.ts +214 -0
- package/src/components/Button/Button.styles.ts +203 -47
- package/src/components/Button/Button.tsx +4 -0
- package/src/components/Button/Buttons.stories.tsx +9 -1
- package/src/components/Calendar/Calendar.tsx +49 -7
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/Collapsible/Collapsible.styles.ts +6 -3
- package/src/components/DatePicker/DatePicker.tsx +8 -2
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/Dropdown/Dropdown.styles.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +14 -12
- package/src/components/Input/Input.stories.tsx +3 -2
- package/src/components/Input/Input.styles.tsx +13 -6
- package/src/components/Input/Input.tsx +8 -1
- package/src/components/Loading/Loading.stories.tsx +43 -0
- package/src/components/Loading/Loading.tsx +72 -0
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/ProgressBar/ProgressBar.stories.tsx +78 -0
- package/src/components/ProgressBar/ProgressBar.tsx +62 -0
- package/src/components/RadioGroup/RadioGroup.tsx +2 -2
- package/src/components/Search/Search.stories.tsx +13 -13
- package/src/components/Search/Search.tsx +14 -19
- package/src/components/Text/Text.stories.tsx +6 -4
- package/src/components/Text/Text.tsx +27 -3
- package/src/components/TextInput/TextInput.stories.tsx +3 -2
- package/src/components/TextInput/TextInput.styles.ts +124 -19
- package/src/components/TextInput/TextInput.tsx +34 -4
- package/src/index.ts +3 -0
- package/src/stories/ColorGroupPreview.tsx +494 -0
- package/src/stories/ColorPreview.tsx +45 -0
- package/src/stories/Colors.mdx +14 -0
- package/src/stories/Typography.mdx +7 -151
- package/src/theme/global.css +7 -227
- package/src/theme/main-preset.js +131 -67
- package/src/theme/plugins/utilities/typography.js +12 -0
- package/src/theme/presets/colors.js +101 -220
- package/src/theme/theme.d.ts +69 -0
- package/src/theme/themes/xspector/baseline.css +7 -0
- package/src/theme/themes/xspector/color.css +67 -0
- package/src/theme/themes/xspector/components/action-button.css +98 -0
- package/src/theme/themes/xspector/components/loading.css +11 -0
- package/src/theme/themes/xspector/palette.css +122 -0
- package/src/theme/themes/xspector/state.css +89 -0
- package/src/theme/themes/xspector/transparent.css +68 -0
- package/src/theme/themes/xspector/typography.css +27 -0
- package/src/theme/tokens/baseline.css +10 -0
- package/src/theme/tokens/color.css +63 -0
- package/src/theme/tokens/components/action-button.css +127 -0
- package/src/theme/tokens/components/button.css +512 -0
- package/src/theme/tokens/components/loading.css +11 -0
- package/src/theme/tokens/components/navbar.css +8 -0
- package/src/theme/tokens/components/progress-bar.css +8 -0
- package/src/theme/tokens/palette.css +122 -0
- package/src/theme/tokens/state.css +82 -0
- package/src/theme/tokens/transparent.css +68 -0
- package/src/theme/tokens/typography.css +178 -0
- package/src/theme/tokens/variables.css +28 -0
- package/src/theme/utils.js +98 -0
|
@@ -1,84 +1,244 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
export var buttonVariants = cva([
|
|
3
|
-
|
|
4
|
-
// "font-sans appearance-none select-none rounded-sm border font-medium tracking-[.02857em]",
|
|
5
|
-
// "aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed",
|
|
6
|
-
"gap-2 font-bold text-white hover:bg-opacity-90 active:scale-[98%]",
|
|
3
|
+
"gap-2 font-bold inline-flex items-center outline-none transition ease-in-out duration-45",
|
|
7
4
|
], {
|
|
8
5
|
variants: {
|
|
9
6
|
color: {
|
|
10
|
-
primary:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
primary: [
|
|
8
|
+
"bg-button-primary-solid-default border-button-primary-solid-default text-button-primary-solid-default fill-button-primary-solid-default",
|
|
9
|
+
"hover:bg-button-primary-solid-hover hover:border-button-primary-solid-hover hover:text-button-primary-solid-hover hover:fill-button-primary-solid-hover",
|
|
10
|
+
"active:bg-button-primary-solid-active active:border-button-primary-solid-active active:text-button-primary-solid-active active:fill-button-primary-solid-active",
|
|
11
|
+
"data-[loading=true]:bg-button-primary-solid-active data-[loading=true]:border-button-primary-solid-active data-[loading=true]:text-button-primary-solid-active data-[loading=true]:fill-button-primary-solid-active",
|
|
12
|
+
"disabled:bg-button-primary-solid-disabled disabled:border-button-primary-solid-disabled disabled:text-button-primary-solid-disabled disabled:fill-button-primary-solid-disabled",
|
|
13
|
+
],
|
|
14
|
+
secondary: [
|
|
15
|
+
"bg-button-secondary-solid-default border-button-secondary-solid-default text-button-secondary-solid-default fill-button-secondary-solid-default",
|
|
16
|
+
"hover:bg-button-secondary-solid-hover hover:border-button-secondary-solid-hover hover:text-button-secondary-solid-hover hover:fill-button-secondary-solid-hover",
|
|
17
|
+
"active:bg-button-secondary-solid-active active:border-button-secondary-solid-active active:text-button-secondary-solid-active active:fill-button-secondary-solid-active",
|
|
18
|
+
"data-[loading=true]:bg-button-secondary-solid-active data-[loading=true]:border-button-secondary-solid-active data-[loading=true]:text-button-secondary-solid-active data-[loading=true]:fill-button-secondary-solid-active",
|
|
19
|
+
"disabled:bg-button-secondary-solid-disabled disabled:border-button-secondary-solid-disabled disabled:text-button-secondary-solid-disabled disabled:fill-button-secondary-solid-disabled",
|
|
20
|
+
],
|
|
21
|
+
tertiary: [
|
|
22
|
+
"bg-button-tertiary-solid-default border-button-tertiary-solid-default text-button-tertiary-solid-default fill-button-tertiary-solid-default",
|
|
23
|
+
"hover:bg-button-tertiary-solid-hover hover:border-button-tertiary-solid-hover hover:text-button-tertiary-solid-hover hover:fill-button-tertiary-solid-hover",
|
|
24
|
+
"active:bg-button-tertiary-solid-active active:border-button-tertiary-solid-active active:text-button-tertiary-solid-active active:fill-button-tertiary-solid-active",
|
|
25
|
+
"data-[loading=true]:bg-button-tertiary-solid-active data-[loading=true]:border-button-tertiary-solid-active data-[loading=true]:text-button-tertiary-solid-active data-[loading=true]:fill-button-tertiary-solid-active",
|
|
26
|
+
"disabled:bg-button-tertiary-solid-disabled disabled:border-button-tertiary-solid-disabled disabled:text-button-tertiary-solid-disabled disabled:fill-button-tertiary-solid-disabled",
|
|
27
|
+
],
|
|
28
|
+
success: [
|
|
29
|
+
"bg-button-success-solid-default border-button-success-solid-default text-button-success-solid-default fill-button-success-solid-default",
|
|
30
|
+
"hover:bg-button-success-solid-hover hover:border-button-success-solid-hover hover:text-button-success-solid-hover hover:fill-button-success-solid-hover",
|
|
31
|
+
"active:bg-button-success-solid-active active:border-button-success-solid-active active:text-button-success-solid-active active:fill-button-success-solid-active",
|
|
32
|
+
"data-[loading=true]:bg-button-success-solid-active data-[loading=true]:border-button-success-solid-active data-[loading=true]:text-button-success-solid-active data-[loading=true]:fill-button-success-solid-active",
|
|
33
|
+
"disabled:bg-button-success-solid-disabled disabled:border-button-success-solid-disabled disabled:text-button-success-solid-disabled disabled:fill-button-success-solid-disabled",
|
|
34
|
+
],
|
|
35
|
+
info: [
|
|
36
|
+
"bg-button-info-solid-default border-button-info-solid-default text-button-info-solid-default fill-button-info-solid-default",
|
|
37
|
+
"hover:bg-button-info-solid-hover hover:border-button-info-solid-hover hover:text-button-info-solid-hover hover:fill-button-info-solid-hover",
|
|
38
|
+
"active:bg-button-info-solid-active active:border-button-info-solid-active active:text-button-info-solid-active active:fill-button-info-solid-active",
|
|
39
|
+
"data-[loading=true]:bg-button-info-solid-active data-[loading=true]:border-button-info-solid-active data-[loading=true]:text-button-info-solid-active data-[loading=true]:fill-button-info-solid-active",
|
|
40
|
+
"disabled:bg-button-info-solid-disabled disabled:border-button-info-solid-disabled disabled:text-button-info-solid-disabled disabled:fill-button-info-solid-disabled",
|
|
41
|
+
],
|
|
42
|
+
warning: [
|
|
43
|
+
"bg-button-warning-solid-default border-button-warning-solid-default text-button-warning-solid-default fill-button-warning-solid-default",
|
|
44
|
+
"hover:bg-button-warning-solid-hover hover:border-button-warning-solid-hover hover:text-button-warning-solid-hover hover:fill-button-warning-solid-hover",
|
|
45
|
+
"active:bg-button-warning-solid-active active:border-button-warning-solid-active active:text-button-warning-solid-active active:fill-button-warning-solid-active",
|
|
46
|
+
"data-[loading=true]:bg-button-warning-solid-active data-[loading=true]:border-button-warning-solid-active data-[loading=true]:text-button-warning-solid-active data-[loading=true]:fill-button-warning-solid-active",
|
|
47
|
+
"disabled:bg-button-warning-solid-disabled disabled:border-button-warning-solid-disabled disabled:text-button-warning-solid-disabled disabled:fill-button-warning-solid-disabled",
|
|
48
|
+
],
|
|
49
|
+
error: [
|
|
50
|
+
"bg-button-error-solid-default border-button-error-solid-default text-button-error-solid-default fill-button-error-solid-default",
|
|
51
|
+
"hover:bg-button-error-solid-hover hover:border-button-error-solid-hover hover:text-button-error-solid-hover hover:fill-button-error-solid-hover",
|
|
52
|
+
"active:bg-button-error-solid-active active:border-button-error-solid-active active:text-button-error-solid-active active:fill-button-error-solid-active",
|
|
53
|
+
"data-[loading=true]:bg-button-error-solid-active data-[loading=true]:border-button-error-solid-active data-[loading=true]:text-button-error-solid-active data-[loading=true]:fill-button-error-solid-active",
|
|
54
|
+
"disabled:bg-button-error-solid-disabled disabled:border-button-error-solid-disabled disabled:text-button-error-solid-disabled disabled:fill-button-error-solid-disabled",
|
|
55
|
+
],
|
|
17
56
|
},
|
|
18
57
|
size: {
|
|
19
|
-
sm: "px-
|
|
20
|
-
md: "px-
|
|
21
|
-
lg: "px-
|
|
58
|
+
sm: "px-md py-1 [&_svg]:size-[18px] typography-buttonMS rounded-sm gap-1",
|
|
59
|
+
md: "px-lg py-2 [&_svg]:size-5 typography-buttonL rounded-md",
|
|
60
|
+
lg: "px-xl py-4 [&_svg]:size-6 typography-buttonL rounded-md",
|
|
22
61
|
},
|
|
23
62
|
variant: {
|
|
24
63
|
solid: "border",
|
|
25
|
-
outline: "border bg-transparent
|
|
26
|
-
flat: "bg-transparent
|
|
27
|
-
link: "bg-transparent underline underline-offset-4
|
|
64
|
+
outline: "border bg-transparent",
|
|
65
|
+
flat: "bg-transparent",
|
|
66
|
+
link: "bg-transparent underline underline-offset-4",
|
|
28
67
|
},
|
|
29
68
|
disabled: {
|
|
30
|
-
true: "pointer-events-none border-transparent bg-
|
|
69
|
+
true: "pointer-events-none border-transparent bg-disable-solid text-disable-outline fill-disable-outline",
|
|
31
70
|
},
|
|
32
71
|
fullwidth: {
|
|
33
72
|
true: "w-full",
|
|
34
73
|
},
|
|
74
|
+
icon: {
|
|
75
|
+
sm: "h-4 w-4",
|
|
76
|
+
md: "h-5 w-5",
|
|
77
|
+
lg: "h-6 w-6",
|
|
78
|
+
},
|
|
35
79
|
},
|
|
36
80
|
compoundVariants: [
|
|
37
81
|
{
|
|
38
|
-
variant:
|
|
39
|
-
|
|
40
|
-
|
|
82
|
+
variant: "outline",
|
|
83
|
+
color: "primary",
|
|
84
|
+
className: [
|
|
85
|
+
"bg-button-primary-outline-default border-button-primary-outline-default text-button-primary-outline-default fill-button-primary-outline-default",
|
|
86
|
+
"hover:bg-button-primary-outline-hover hover:border-button-primary-outline-hover hover:text-button-primary-outline-hover hover:fill-button-primary-outline-hover",
|
|
87
|
+
"active:bg-button-primary-outline-active active:border-button-primary-outline-active active:text-button-primary-outline-active active:fill-button-primary-outline-active",
|
|
88
|
+
"data-[loading=true]:bg-button-primary-outline-active data-[loading=true]:border-button-primary-outline-active data-[loading=true]:text-button-primary-outline-active data-[loading=true]:fill-button-primary-outline-active",
|
|
89
|
+
"disabled:bg-button-primary-outline-disabled disabled:border-button-primary-outline-disabled disabled:text-button-primary-outline-disabled disabled:fill-button-primary-outline-disabled",
|
|
90
|
+
],
|
|
41
91
|
},
|
|
42
92
|
{
|
|
43
|
-
variant: "
|
|
93
|
+
variant: ["flat", "link"],
|
|
44
94
|
color: "primary",
|
|
45
|
-
|
|
95
|
+
className: [
|
|
96
|
+
"bg-button-primary-flat-default border-button-primary-flat-default text-button-primary-flat-default fill-button-primary-flat-default",
|
|
97
|
+
"hover:bg-button-primary-flat-hover hover:border-button-primary-flat-hover hover:text-button-primary-flat-hover hover:fill-button-primary-flat-hover",
|
|
98
|
+
"active:bg-button-primary-flat-active active:border-button-primary-flat-active active:text-button-primary-flat-active active:fill-button-primary-flat-active",
|
|
99
|
+
"data-[loading=true]:bg-button-primary-flat-active data-[loading=true]:border-button-primary-flat-active data-[loading=true]:text-button-primary-flat-active data-[loading=true]:fill-button-primary-flat-active",
|
|
100
|
+
"disabled:bg-button-primary-flat-disabled disabled:border-button-primary-flat-disabled disabled:text-button-primary-flat-disabled disabled:fill-button-primary-flat-disabled",
|
|
101
|
+
],
|
|
46
102
|
},
|
|
47
103
|
{
|
|
48
|
-
variant: "
|
|
104
|
+
variant: "outline",
|
|
105
|
+
color: "secondary",
|
|
106
|
+
className: [
|
|
107
|
+
"bg-button-secondary-outline-default border-button-secondary-outline-default text-button-secondary-outline-default fill-button-secondary-outline-default",
|
|
108
|
+
"hover:bg-button-secondary-outline-hover hover:border-button-secondary-outline-hover hover:text-button-secondary-outline-hover hover:fill-button-secondary-outline-hover",
|
|
109
|
+
"active:bg-button-secondary-outline-active active:border-button-secondary-outline-active active:text-button-secondary-outline-active active:fill-button-secondary-outline-active",
|
|
110
|
+
"data-[loading=true]:bg-button-secondary-outline-active data-[loading=true]:border-button-secondary-outline-active data-[loading=true]:text-button-secondary-outline-active data-[loading=true]:fill-button-secondary-outline-active",
|
|
111
|
+
"disabled:bg-button-secondary-outline-disabled disabled:border-button-secondary-outline-disabled disabled:text-button-secondary-outline-disabled disabled:fill-button-secondary-outline-disabled",
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
variant: ["flat", "link"],
|
|
49
116
|
color: "secondary",
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
117
|
+
className: [
|
|
118
|
+
"bg-button-secondary-flat-default border-button-secondary-flat-default text-button-secondary-flat-default fill-button-secondary-flat-default",
|
|
119
|
+
"hover:bg-button-secondary-flat-hover hover:border-button-secondary-flat-hover hover:text-button-secondary-flat-hover hover:fill-button-secondary-flat-hover",
|
|
120
|
+
"active:bg-button-secondary-flat-active active:border-button-secondary-flat-active active:text-button-secondary-flat-active active:fill-button-secondary-flat-active",
|
|
121
|
+
"data-[loading=true]:bg-button-secondary-flat-active data-[loading=true]:border-button-secondary-flat-active data-[loading=true]:text-button-secondary-flat-active data-[loading=true]:fill-button-secondary-flat-active",
|
|
122
|
+
"disabled:bg-button-secondary-flat-disabled disabled:border-button-secondary-flat-disabled disabled:text-button-secondary-flat-disabled disabled:fill-button-secondary-flat-disabled",
|
|
123
|
+
],
|
|
124
|
+
},
|
|
58
125
|
{
|
|
59
|
-
variant: "
|
|
126
|
+
variant: "outline",
|
|
60
127
|
color: "tertiary",
|
|
61
|
-
|
|
128
|
+
className: [
|
|
129
|
+
"bg-button-tertiary-outline-default border-button-tertiary-outline-default text-button-tertiary-outline-default fill-button-tertiary-outline-default",
|
|
130
|
+
"hover:bg-button-tertiary-outline-hover hover:border-button-tertiary-outline-hover hover:text-button-tertiary-outline-hover hover:fill-button-tertiary-outline-hover",
|
|
131
|
+
"active:bg-button-tertiary-outline-active active:border-button-tertiary-outline-active active:text-button-tertiary-outline-active active:fill-button-tertiary-outline-active",
|
|
132
|
+
"data-[loading=true]:bg-button-tertiary-outline-active data-[loading=true]:border-button-tertiary-outline-active data-[loading=true]:text-button-tertiary-outline-active data-[loading=true]:fill-button-tertiary-outline-active",
|
|
133
|
+
"disabled:bg-button-tertiary-outline-disabled disabled:border-button-tertiary-outline-disabled disabled:text-button-tertiary-outline-disabled disabled:fill-button-tertiary-outline-disabled",
|
|
134
|
+
],
|
|
62
135
|
},
|
|
63
136
|
{
|
|
64
|
-
variant: "
|
|
65
|
-
color: "
|
|
66
|
-
|
|
137
|
+
variant: ["flat", "link"],
|
|
138
|
+
color: "tertiary",
|
|
139
|
+
className: [
|
|
140
|
+
"bg-button-tertiary-flat-default border-button-tertiary-flat-default text-button-tertiary-flat-default fill-button-tertiary-flat-default",
|
|
141
|
+
"hover:bg-button-tertiary-flat-hover hover:border-button-tertiary-flat-hover hover:text-button-tertiary-flat-hover hover:fill-button-tertiary-flat-hover",
|
|
142
|
+
"active:bg-button-tertiary-flat-active active:border-button-tertiary-flat-active active:text-button-tertiary-flat-active active:fill-button-tertiary-flat-active",
|
|
143
|
+
"data-[loading=true]:bg-button-tertiary-flat-active data-[loading=true]:border-button-tertiary-flat-active data-[loading=true]:text-button-tertiary-flat-active data-[loading=true]:fill-button-tertiary-flat-active",
|
|
144
|
+
"disabled:bg-button-tertiary-flat-disabled disabled:border-button-tertiary-flat-disabled disabled:text-button-tertiary-flat-disabled disabled:fill-button-tertiary-flat-disabled",
|
|
145
|
+
],
|
|
67
146
|
},
|
|
68
147
|
{
|
|
69
|
-
variant: "
|
|
148
|
+
variant: "outline",
|
|
70
149
|
color: "info",
|
|
71
|
-
|
|
150
|
+
className: [
|
|
151
|
+
"bg-button-info-outline-default border-button-info-outline-default text-button-info-outline-default fill-button-info-outline-default",
|
|
152
|
+
"hover:bg-button-info-outline-hover hover:border-button-info-outline-hover hover:text-button-info-outline-hover hover:fill-button-info-outline-hover",
|
|
153
|
+
"active:bg-button-info-outline-active active:border-button-info-outline-active active:text-button-info-outline-active active:fill-button-info-outline-active",
|
|
154
|
+
"data-[loading=true]:bg-button-info-outline-active data-[loading=true]:border-button-info-outline-active data-[loading=true]:text-button-info-outline-active data-[loading=true]:fill-button-info-outline-active",
|
|
155
|
+
"disabled:bg-button-info-outline-disabled disabled:border-button-info-outline-disabled disabled:text-button-info-outline-disabled disabled:fill-button-info-outline-disabled",
|
|
156
|
+
],
|
|
72
157
|
},
|
|
73
158
|
{
|
|
74
|
-
variant: "
|
|
159
|
+
variant: ["flat", "link"],
|
|
160
|
+
color: "info",
|
|
161
|
+
className: [
|
|
162
|
+
"bg-button-info-flat-default border-button-info-flat-default text-button-info-flat-default fill-button-info-flat-default",
|
|
163
|
+
"hover:bg-button-info-flat-hover hover:border-button-info-flat-hover hover:text-button-info-flat-hover hover:fill-button-info-flat-hover",
|
|
164
|
+
"active:bg-button-info-flat-active active:border-button-info-flat-active active:text-button-info-flat-active active:fill-button-info-flat-active",
|
|
165
|
+
"data-[loading=true]:bg-button-info-flat-active data-[loading=true]:border-button-info-flat-active data-[loading=true]:text-button-info-flat-active data-[loading=true]:fill-button-info-flat-active",
|
|
166
|
+
"disabled:bg-button-info-flat-disabled disabled:border-button-info-flat-disabled disabled:text-button-info-flat-disabled disabled:fill-button-info-flat-disabled",
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
variant: "outline",
|
|
171
|
+
color: "success",
|
|
172
|
+
className: [
|
|
173
|
+
"bg-button-success-outline-default border-button-success-outline-default text-button-success-outline-default fill-button-success-outline-default",
|
|
174
|
+
"hover:bg-button-success-outline-hover hover:border-button-success-outline-hover hover:text-button-success-outline-hover hover:fill-button-success-outline-hover",
|
|
175
|
+
"active:bg-button-success-outline-active active:border-button-success-outline-active active:text-button-success-outline-active active:fill-button-success-outline-active",
|
|
176
|
+
"data-[loading=true]:bg-button-success-outline-active data-[loading=true]:border-button-success-outline-active data-[loading=true]:text-button-success-outline-active data-[loading=true]:fill-button-success-outline-active",
|
|
177
|
+
"disabled:bg-button-success-outline-disabled disabled:border-button-success-outline-disabled disabled:text-button-success-outline-disabled disabled:fill-button-success-outline-disabled",
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
variant: ["flat", "link"],
|
|
182
|
+
color: "success",
|
|
183
|
+
className: [
|
|
184
|
+
"bg-button-success-flat-default border-button-success-flat-default text-button-success-flat-default fill-button-success-flat-default",
|
|
185
|
+
"hover:bg-button-success-flat-hover hover:border-button-success-flat-hover hover:text-button-success-flat-hover hover:fill-button-success-flat-hover",
|
|
186
|
+
"active:bg-button-success-flat-active active:border-button-success-flat-active active:text-button-success-flat-active active:fill-button-success-flat-active",
|
|
187
|
+
"data-[loading=true]:bg-button-success-flat-active data-[loading=true]:border-button-success-flat-active data-[loading=true]:text-button-success-flat-active data-[loading=true]:fill-button-success-flat-active",
|
|
188
|
+
"disabled:bg-button-success-flat-disabled disabled:border-button-success-flat-disabled disabled:text-button-success-flat-disabled disabled:fill-button-success-flat-disabled",
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
variant: "outline",
|
|
75
193
|
color: "warning",
|
|
76
|
-
|
|
194
|
+
className: [
|
|
195
|
+
"bg-button-warning-outline-default border-button-warning-outline-default text-button-warning-outline-default fill-button-warning-outline-default",
|
|
196
|
+
"hover:bg-button-warning-outline-hover hover:border-button-warning-outline-hover hover:text-button-warning-outline-hover hover:fill-button-warning-outline-hover",
|
|
197
|
+
"active:bg-button-warning-outline-active active:border-button-warning-outline-active active:text-button-warning-outline-active active:fill-button-warning-outline-active",
|
|
198
|
+
"data-[loading=true]:bg-button-warning-outline-active data-[loading=true]:border-button-warning-outline-active data-[loading=true]:text-button-warning-outline-active data-[loading=true]:fill-button-warning-outline-active",
|
|
199
|
+
"disabled:bg-button-warning-outline-disabled disabled:border-button-warning-outline-disabled disabled:text-button-warning-outline-disabled disabled:fill-button-warning-outline-disabled",
|
|
200
|
+
],
|
|
77
201
|
},
|
|
78
202
|
{
|
|
79
|
-
variant: "
|
|
203
|
+
variant: ["flat", "link"],
|
|
204
|
+
color: "warning",
|
|
205
|
+
className: [
|
|
206
|
+
"bg-button-warning-flat-default border-button-warning-flat-default text-button-warning-flat-default fill-button-warning-flat-default",
|
|
207
|
+
"hover:bg-button-warning-flat-hover hover:border-button-warning-flat-hover hover:text-button-warning-flat-hover hover:fill-button-warning-flat-hover",
|
|
208
|
+
"active:bg-button-warning-flat-active active:border-button-warning-flat-active active:text-button-warning-flat-active active:fill-button-warning-flat-active",
|
|
209
|
+
"data-[loading=true]:bg-button-warning-flat-active data-[loading=true]:border-button-warning-flat-active data-[loading=true]:text-button-warning-flat-active data-[loading=true]:fill-button-warning-flat-active",
|
|
210
|
+
"disabled:bg-button-warning-flat-disabled disabled:border-button-warning-flat-disabled disabled:text-button-warning-flat-disabled disabled:fill-button-warning-flat-disabled",
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
variant: "outline",
|
|
215
|
+
color: "error",
|
|
216
|
+
className: [
|
|
217
|
+
"bg-button-error-outline-default border-button-error-outline-default text-button-error-outline-default fill-button-error-outline-default",
|
|
218
|
+
"hover:bg-button-error-outline-hover hover:border-button-error-outline-hover hover:text-button-error-outline-hover hover:fill-button-error-outline-hover",
|
|
219
|
+
"active:bg-button-error-outline-active active:border-button-error-outline-active active:text-button-error-outline-active active:fill-button-error-outline-active",
|
|
220
|
+
"data-[loading=true]:bg-button-error-outline-active data-[loading=true]:border-button-error-outline-active data-[loading=true]:text-button-error-outline-active data-[loading=true]:fill-button-error-outline-active",
|
|
221
|
+
"disabled:bg-button-error-outline-disabled disabled:border-button-error-outline-disabled disabled:text-button-error-outline-disabled disabled:fill-button-error-outline-disabled",
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
variant: ["flat", "link"],
|
|
80
226
|
color: "error",
|
|
81
|
-
|
|
227
|
+
className: [
|
|
228
|
+
"bg-button-error-flat-default border-button-error-flat-default text-button-error-flat-default fill-button-error-flat-default",
|
|
229
|
+
"hover:bg-button-error-flat-hover hover:border-button-error-flat-hover hover:text-button-error-flat-hover hover:fill-button-error-flat-hover",
|
|
230
|
+
"active:bg-button-error-flat-active active:border-button-error-flat-active active:text-button-error-flat-active active:fill-button-error-flat-active",
|
|
231
|
+
"data-[loading=true]:bg-button-error-flat-active data-[loading=true]:border-button-error-flat-active data-[loading=true]:text-button-error-flat-active data-[loading=true]:fill-button-error-flat-active",
|
|
232
|
+
"disabled:bg-button-error-flat-disabled disabled:border-button-error-flat-disabled disabled:text-button-error-flat-disabled disabled:fill-button-error-flat-disabled",
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
// --- Disabled --
|
|
236
|
+
{
|
|
237
|
+
variant: ["outline", "flat", "link"],
|
|
238
|
+
disabled: true,
|
|
239
|
+
className: [
|
|
240
|
+
"bg-transparent border-disabled-outline text-disable-outline fill-disable-outline",
|
|
241
|
+
],
|
|
82
242
|
},
|
|
83
243
|
],
|
|
84
244
|
defaultVariants: {
|
|
@@ -28,16 +28,20 @@ export default meta;
|
|
|
28
28
|
export var Solid = {
|
|
29
29
|
args: {
|
|
30
30
|
title: "Button",
|
|
31
|
+
disabled: false,
|
|
32
|
+
isLoading: false,
|
|
31
33
|
},
|
|
32
34
|
render: function (args) {
|
|
33
35
|
var props = __assign(__assign({}, args), { className: "capitalize" });
|
|
34
|
-
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, __assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, __assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, __assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, __assign({ color: "info" }, props, { title: "info" })), _jsx(Button, __assign({ color: "success" }, props, { title: "success" })), _jsx(Button, __assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, __assign({ color: "error" }, props, { title: "error" }))] }));
|
|
36
|
+
return (_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(Button, __assign({ color: "primary" }, props, { title: "primary" })), _jsx(Button, __assign({ color: "secondary" }, props, { title: "secondary" })), _jsx(Button, __assign({ color: "tertiary" }, props, { title: "tertiary" })), _jsx(Button, __assign({ color: "info" }, props, { title: "info" })), _jsx(Button, __assign({ color: "success" }, props, { title: "success" })), _jsx(Button, __assign({ color: "warning" }, props, { title: "warning" })), _jsx(Button, __assign({ color: "error" }, props, { title: "error" }))] }));
|
|
35
37
|
},
|
|
36
38
|
};
|
|
37
39
|
export var Outline = {
|
|
38
40
|
args: {
|
|
39
41
|
title: "Button",
|
|
40
42
|
variant: "outline",
|
|
43
|
+
disabled: false,
|
|
44
|
+
isLoading: false,
|
|
41
45
|
},
|
|
42
46
|
render: function (args) {
|
|
43
47
|
var props = __assign(__assign({}, args), { className: "capitalize" });
|
|
@@ -48,6 +52,8 @@ export var Flat = {
|
|
|
48
52
|
args: {
|
|
49
53
|
title: "Button",
|
|
50
54
|
variant: "flat",
|
|
55
|
+
disabled: false,
|
|
56
|
+
isLoading: false,
|
|
51
57
|
},
|
|
52
58
|
render: function (args) {
|
|
53
59
|
var props = __assign(__assign({}, args), { className: "capitalize" });
|
|
@@ -58,6 +64,8 @@ export var Link = {
|
|
|
58
64
|
args: {
|
|
59
65
|
title: "Button",
|
|
60
66
|
variant: "link",
|
|
67
|
+
disabled: false,
|
|
68
|
+
isLoading: false,
|
|
61
69
|
},
|
|
62
70
|
render: function (args) {
|
|
63
71
|
var props = __assign(__assign({}, args), { className: "capitalize" });
|
|
@@ -23,12 +23,49 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
};
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
26
|
-
import "react-day-picker/dist/style.css";
|
|
26
|
+
// import "react-day-picker/dist/style.css";
|
|
27
27
|
import { cn } from "@/utils/cn";
|
|
28
28
|
function Calendar(_a) {
|
|
29
29
|
var className = _a.className, classNames = _a.classNames, _b = _a.showOutsideDays, showOutsideDays = _b === void 0 ? true : _b, props = __rest(_a, ["className", "classNames", "showOutsideDays"]);
|
|
30
30
|
var defaultClassNames = getDefaultClassNames();
|
|
31
|
-
return (_jsx(DayPicker, __assign({ showOutsideDays: showOutsideDays, captionLayout: "dropdown-years" }, props, { className: cn("bg-
|
|
31
|
+
return (_jsx(DayPicker, __assign({ showOutsideDays: showOutsideDays, captionLayout: "dropdown-years" }, props, { className: cn("bg-surface text-surface-foreground border-surface", className), classNames: __assign(__assign(__assign({}, defaultClassNames), { day_button: cn(defaultClassNames.day_button, "size-9 "), day: "typography-subtitile1 ", today: "text-bold text-surface-foreground [&_button]:rounded-full [&_button]:!border-primary [&_button]:!border [&_button]:!border-solid", selected: "bg-primary !text-primary-foreground rounded-full ", weekdays: "text-gray-400", month_caption: cn(defaultClassNames.month_caption, "h-[54px]"), outside: "text-gray-400", nav: cn(defaultClassNames.nav, "gap-6 absolute flex right-0"), chevron: "fill-primary", root: cn(defaultClassNames.root, "px-6 py-4"), caption_label: cn(defaultClassNames.caption_label, "gap-2 flex items-center"), months: "flex flex-col relative" }), classNames), styles: {
|
|
32
|
+
caption_label: {
|
|
33
|
+
zIndex: 1,
|
|
34
|
+
position: "relative",
|
|
35
|
+
display: "inline-flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
whiteSpace: "nowrap",
|
|
38
|
+
border: 0,
|
|
39
|
+
},
|
|
40
|
+
dropdown: {
|
|
41
|
+
zIndex: 2,
|
|
42
|
+
opacity: 0,
|
|
43
|
+
WebkitAppearance: "none",
|
|
44
|
+
MozAppearance: "none",
|
|
45
|
+
appearance: "none",
|
|
46
|
+
position: "absolute",
|
|
47
|
+
insetBlockStart: 0,
|
|
48
|
+
insetBlockEnd: 0,
|
|
49
|
+
insetInlineStart: 0,
|
|
50
|
+
width: "100%",
|
|
51
|
+
margin: 0,
|
|
52
|
+
padding: 0,
|
|
53
|
+
cursor: "inherit",
|
|
54
|
+
border: "none",
|
|
55
|
+
lineHeight: "inherit",
|
|
56
|
+
},
|
|
57
|
+
dropdowns: {
|
|
58
|
+
position: "relative",
|
|
59
|
+
display: "inline-flex",
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
gap: 4,
|
|
62
|
+
},
|
|
63
|
+
dropdown_root: {
|
|
64
|
+
position: "relative",
|
|
65
|
+
display: "inline-flex",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
},
|
|
68
|
+
} })));
|
|
32
69
|
}
|
|
33
70
|
Calendar.displayName = "Calendar";
|
|
34
71
|
export default Calendar;
|
|
@@ -28,7 +28,7 @@ import { CheckIcon } from "@heroicons/react/16/solid";
|
|
|
28
28
|
import { cn } from "@/utils/cn";
|
|
29
29
|
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
30
30
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
31
|
-
return (_jsx(CheckboxPrimitive.Root, __assign({ ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary-30 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-
|
|
31
|
+
return (_jsx(CheckboxPrimitive.Root, __assign({ ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary-30 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-state-disable-solid", {
|
|
32
32
|
"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground": !props.disabled,
|
|
33
33
|
"bg-grey2-300": props.checked && props.disabled,
|
|
34
34
|
}, className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) })));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
export var collapseButtonVariants = cva([
|
|
3
|
-
"flex flex-1 bg-
|
|
3
|
+
"flex flex-1 bg-secondary-default hover:bg-secondary-hover text-secondary-foreground",
|
|
4
4
|
"focus:outline-none focus-visible:ring focus-visible:ring-gray-500 focus-visible:ring-opacity-75",
|
|
5
5
|
], {
|
|
6
6
|
variants: {
|
|
@@ -30,7 +30,10 @@ export var collapseIconVariants = cva(["transition-all flex content-center justi
|
|
|
30
30
|
isExpand: false,
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
export var collapsePanelVariants = cva([
|
|
33
|
+
export var collapsePanelVariants = cva([
|
|
34
|
+
"flex flex-1 border-t border-t-secondary",
|
|
35
|
+
"transition ease-in-out delay-150 duration-300",
|
|
36
|
+
], {
|
|
34
37
|
variants: {
|
|
35
38
|
size: {
|
|
36
39
|
sm: "py-2 px-3",
|
|
@@ -43,5 +46,5 @@ export var collapsePanelVariants = cva(["flex flex-1 border-t", "transition ease
|
|
|
43
46
|
},
|
|
44
47
|
});
|
|
45
48
|
export var collapseContainerVariants = cva([
|
|
46
|
-
"flex flex-col border rounded overflow-hidden",
|
|
49
|
+
"flex flex-col border border-secondary rounded overflow-hidden",
|
|
47
50
|
]);
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
14
|
import { useState } from "react";
|
|
4
15
|
import { CalendarIcon } from "@heroicons/react/16/solid";
|
|
@@ -7,9 +18,9 @@ import { Popover, PopoverContent, PopoverTrigger } from "../Popover/Popover";
|
|
|
7
18
|
import { TextInput } from "../TextInput/TextInput";
|
|
8
19
|
import { format } from "date-fns/format";
|
|
9
20
|
var DatePicker = function (_a) {
|
|
10
|
-
var date = _a.date, onSelect = _a.onSelect;
|
|
21
|
+
var date = _a.date, onSelect = _a.onSelect, textInputProps = _a.textInputProps;
|
|
11
22
|
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
12
|
-
return (_jsx("div", { children: _jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("div", { className: "flex", children: _jsx(TextInput, { fullwidth: true, id: "2", readOnly: true, label: "Date", size: "md", value: date ? format(date, "dd MMM yyyy") : isOpen ? " " : "", hasClearIcon: false, endIcon: _jsx(CalendarIcon, { fill: "inherit" }) }) }) }), _jsx(PopoverContent, { className: "w-auto p-0", children: _jsx(Calendar, { mode: "single", selected: date, onSelect: function () {
|
|
23
|
+
return (_jsx("div", { children: _jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("div", { className: "flex", children: _jsx(TextInput, __assign({ fullwidth: true, id: "2", readOnly: true, label: "Date", size: "md", value: date ? format(date, "dd MMM yyyy") : isOpen ? " " : "", hasClearIcon: false, endIcon: _jsx(CalendarIcon, { fill: "inherit" }) }, textInputProps)) }) }), _jsx(PopoverContent, { className: "w-auto p-0", children: _jsx(Calendar, { mode: "single", selected: date, onSelect: function () {
|
|
13
24
|
var value = [];
|
|
14
25
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
15
26
|
value[_i] = arguments[_i];
|
|
@@ -32,12 +32,12 @@ var DialogPortal = DialogPrimitive.Portal;
|
|
|
32
32
|
var DialogClose = DialogPrimitive.Close;
|
|
33
33
|
var DialogOverlay = React.forwardRef(function (_a, ref) {
|
|
34
34
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
35
|
-
return (_jsx(DialogPrimitive.Overlay, __assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-popup-
|
|
35
|
+
return (_jsx(DialogPrimitive.Overlay, __assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-base-popup-curtain data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props)));
|
|
36
36
|
});
|
|
37
37
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
38
38
|
var DialogContent = React.forwardRef(function (_a, ref) {
|
|
39
39
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
40
|
-
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, __assign({ ref: ref, className: cn("fixed text-
|
|
40
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, __assign({ ref: ref, className: cn("fixed text-base-popup-foreground left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-base-popup bg-base-popup p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-md", className) }, props, { children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-primary data-[state=open]:text-primary-foreground", children: [_jsx(XMarkIcon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] }))] }));
|
|
41
41
|
});
|
|
42
42
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
43
43
|
var DialogHeader = function (_a) {
|
|
@@ -47,12 +47,12 @@ var DialogHeader = function (_a) {
|
|
|
47
47
|
DialogHeader.displayName = "DialogHeader";
|
|
48
48
|
var DialogFooter = function (_a) {
|
|
49
49
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
50
|
-
return (_jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className) }, props)));
|
|
50
|
+
return (_jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 ", className) }, props)));
|
|
51
51
|
};
|
|
52
52
|
DialogFooter.displayName = "DialogFooter";
|
|
53
53
|
var DialogTitle = React.forwardRef(function (_a, ref) {
|
|
54
54
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
55
|
-
return (_jsx(DialogPrimitive.Title, __assign({ ref: ref, className: cn("typography-h5 tracking-tight", className) }, props)));
|
|
55
|
+
return (_jsx(DialogPrimitive.Title, __assign({ ref: ref, className: cn("typography-h5 tracking-tight ", className) }, props)));
|
|
56
56
|
});
|
|
57
57
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
58
58
|
var DialogDescription = React.forwardRef(function (_a, ref) {
|
|
@@ -26,11 +26,11 @@ import TextInput from "../TextInput/TextInput";
|
|
|
26
26
|
import { customInputVariant, dropdownIconVariant, iconWrapperVariant, } from "./Dropdown.styles";
|
|
27
27
|
import { ChevronDownIcon } from "@heroicons/react/16/solid";
|
|
28
28
|
var Dropdown = forwardRef(function (_a, ref) {
|
|
29
|
-
var id = _a.id,
|
|
29
|
+
var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, label = _a.label, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.rounded, rounded = _d === void 0 ? "normal" : _d, _e = _a.variant, variant = _e === void 0 ? "outline" : _e, helperText = _a.helperText, errorMessage = _a.errorMessage, _f = _a.fullwidth, fullwidth = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.filterMode, filterMode = _j === void 0 ? false : _j, _k = _a.required, required = _k === void 0 ? true : _k, onChangeText = _a.onChangeText, onSelect = _a.onSelect, props = __rest(_a, ["id", "options", "value", "label", "size", "rounded", "variant", "helperText", "errorMessage", "fullwidth", "disabled", "error", "filterMode", "required", "onChangeText", "onSelect"]);
|
|
30
30
|
var _id = id || "".concat(label, "-select");
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
31
|
+
var _l = useState(false), isFocused = _l[0], setIsFocused = _l[1];
|
|
32
|
+
var _m = useState(null), selectedOption = _m[0], setSelectedOption = _m[1];
|
|
33
|
+
var _o = useState(""), textValue = _o[0], setTextValue = _o[1];
|
|
34
34
|
var keyCode = useRef("");
|
|
35
35
|
useEffect(function () {
|
|
36
36
|
if (value && !selectedOption) {
|
|
@@ -53,7 +53,7 @@ var Dropdown = forwardRef(function (_a, ref) {
|
|
|
53
53
|
((_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(textValue === null || textValue === void 0 ? void 0 : textValue.toLowerCase()));
|
|
54
54
|
});
|
|
55
55
|
}, [options, filterMode, textValue]);
|
|
56
|
-
var renderOptions = function () { return (_jsxs("ul", { className: "absolute mt-1 w-full bg-
|
|
56
|
+
var renderOptions = function () { return (_jsxs("ul", { className: "absolute mt-1 w-full bg-base-popup border border-base-popup text-base-popup-foreground rounded-md shadow-md z-10 max-h-60 overflow-y-auto", children: [optionsFiltered.map(function (option) {
|
|
57
57
|
if (option.renderLabel) {
|
|
58
58
|
return (_jsx(Fragment, { children: option.renderLabel({
|
|
59
59
|
value: option.value,
|
|
@@ -62,7 +62,9 @@ var Dropdown = forwardRef(function (_a, ref) {
|
|
|
62
62
|
className: "px-4 py-2 hover:bg-gray-100 cursor-pointer ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? " bg-gray-200" : ""),
|
|
63
63
|
}) }, option.value));
|
|
64
64
|
}
|
|
65
|
-
return (_jsx("li", { onMouseDown: function () { return handleOptionClick(option); }, className: "px-4 py-2 hover:bg-
|
|
65
|
+
return (_jsx("li", { onMouseDown: function () { return handleOptionClick(option); }, className: "px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ".concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value
|
|
66
|
+
? "bg-base-popup-highligh"
|
|
67
|
+
: ""), children: option.label }, option.value));
|
|
66
68
|
}), optionsFiltered.length === 0 && (_jsx("li", { className: "px-4 py-14 text-center text-input-text", children: "Not found" }))] })); };
|
|
67
69
|
var handleOnFocus = useCallback(function (e) {
|
|
68
70
|
var _a;
|
|
@@ -100,6 +102,6 @@ var Dropdown = forwardRef(function (_a, ref) {
|
|
|
100
102
|
keyCode.current = e.code;
|
|
101
103
|
(_a = props === null || props === void 0 ? void 0 : props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
102
104
|
}, [props === null || props === void 0 ? void 0 : props.onKeyDown]);
|
|
103
|
-
return (_jsxs("div", { className: "relative ".concat(fullwidth ? "w-full" : ""), children: [_jsx(TextInput, __assign({}, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled,
|
|
105
|
+
return (_jsxs("div", { className: "relative ".concat(fullwidth ? "w-full" : ""), children: [_jsx(TextInput, __assign({ hasClearIcon: false, endIcon: _jsx("div", { className: iconWrapperVariant({ size: size }), children: _jsx(ChevronDownIcon, { className: dropdownIconVariant({ size: size, isFocus: isFocused }) }) }) }, props, { ref: ref, readOnly: !filterMode, value: textValue, onChange: handleOnChangeText, label: label, placeholder: " ", type: "text", rounded: rounded, variant: variant, helperText: helperText, errorMessage: errorMessage, fullwidth: fullwidth, error: error, required: required, id: _id, disabled: disabled, size: size, className: customInputVariant({ size: size }), onFocus: handleOnFocus, onBlur: handleOnBlur, onKeyDown: handleOnKeyDown })), isFocused && renderOptions()] }));
|
|
104
106
|
});
|
|
105
107
|
export default Dropdown;
|
|
@@ -26,7 +26,14 @@ import { cn } from "@/utils/cn";
|
|
|
26
26
|
import { inputVariants } from "./Input.styles";
|
|
27
27
|
var Input = forwardRef(function (_a, ref) {
|
|
28
28
|
var className = _a.className, _b = _a.type, type = _b === void 0 ? "text" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "outline" : _d, _e = _a.fullwidth, fullwidth = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.error, error = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.hiddenPlaceholder, hiddenPlaceholder = _j === void 0 ? false : _j, props = __rest(_a, ["className", "type", "size", "variant", "fullwidth", "disabled", "error", "required", "hiddenPlaceholder"]);
|
|
29
|
-
return (_jsx("input", __assign({ type: type, className: cn(inputVariants({
|
|
29
|
+
return (_jsx("input", __assign({ type: type, className: cn(inputVariants({
|
|
30
|
+
size: size,
|
|
31
|
+
variant: variant,
|
|
32
|
+
fullwidth: fullwidth,
|
|
33
|
+
error: error,
|
|
34
|
+
hiddenPlaceholder: hiddenPlaceholder,
|
|
35
|
+
disabled: disabled,
|
|
36
|
+
}), className), ref: ref, disabled: disabled }, props)));
|
|
30
37
|
});
|
|
31
38
|
Input.displayName = "Input";
|
|
32
39
|
export { Input };
|
|
@@ -19,13 +19,14 @@ var meta = {
|
|
|
19
19
|
layout: "fullscreen",
|
|
20
20
|
},
|
|
21
21
|
decorators: [
|
|
22
|
-
function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
|
|
22
|
+
function (Story) { return (_jsx("div", { className: "p-5 flex w-full ", children: _jsx(Story, {}) })); },
|
|
23
23
|
],
|
|
24
24
|
};
|
|
25
25
|
export default meta;
|
|
26
26
|
export var Default = {
|
|
27
27
|
args: {
|
|
28
|
-
//
|
|
28
|
+
// disabled: true,
|
|
29
|
+
// value: "Aaaaa",
|
|
29
30
|
},
|
|
30
31
|
render: function (args) {
|
|
31
32
|
console.log("args ", args);
|