@uxf/ui 1.0.0-beta.6 → 1.0.0-beta.60
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/_private-utils/get-provider-config.d.ts +2 -0
- package/_private-utils/get-provider-config.js +8 -0
- package/avatar/avatar.d.ts +5 -0
- package/avatar/avatar.js +14 -0
- package/avatar/avatar.stories.d.ts +7 -0
- package/avatar/avatar.stories.js +21 -0
- package/avatar/index.d.ts +1 -0
- package/avatar/index.js +5 -0
- package/avatar-file-input/avatar-file-input.d.ts +32 -0
- package/avatar-file-input/avatar-file-input.js +69 -0
- package/avatar-file-input/avatar-file-input.stories.d.ts +7 -0
- package/avatar-file-input/avatar-file-input.stories.js +30 -0
- package/avatar-file-input/index.d.ts +1 -0
- package/{theme → avatar-file-input}/index.js +1 -3
- package/badge/badge.d.ts +7 -0
- package/badge/badge.js +15 -0
- package/badge/badge.stories.d.ts +7 -0
- package/badge/badge.stories.js +39 -0
- package/badge/index.d.ts +1 -0
- package/badge/index.js +5 -0
- package/badge/theme.d.ts +5 -0
- package/badge/theme.js +2 -0
- package/button/button.d.ts +13 -13
- package/button/button.js +16 -14
- package/button/button.stories.d.ts +7 -0
- package/button/button.stories.js +59 -0
- package/button/index.d.ts +1 -2
- package/button/index.js +1 -8
- package/button/theme.d.ts +8 -4
- package/button/theme.js +0 -1
- package/checkbox/checkbox.d.ts +9 -0
- package/checkbox/checkbox.js +23 -0
- package/checkbox/checkbox.stories.d.ts +7 -0
- package/checkbox/checkbox.stories.js +57 -0
- package/checkbox/index.d.ts +1 -0
- package/checkbox/index.js +17 -0
- package/checkbox-button/checkbox-button.d.ts +8 -0
- package/checkbox-button/checkbox-button.js +21 -0
- package/checkbox-button/checkbox-button.stories.d.ts +7 -0
- package/checkbox-button/checkbox-button.stories.js +57 -0
- package/checkbox-button/index.d.ts +1 -0
- package/checkbox-button/index.js +17 -0
- package/checkbox-input/checkbox-input.d.ts +2 -0
- package/checkbox-input/checkbox-input.js +12 -0
- package/checkbox-input/checkbox-input.stories.d.ts +7 -0
- package/checkbox-input/checkbox-input.stories.js +17 -0
- package/checkbox-input/index.d.ts +1 -0
- package/checkbox-input/index.js +17 -0
- package/chip/chip.d.ts +7 -0
- package/chip/chip.js +14 -0
- package/chip/chip.stories.d.ts +7 -0
- package/chip/chip.stories.js +22 -0
- package/chip/index.d.ts +1 -0
- package/chip/index.js +5 -0
- package/chip/theme.d.ts +5 -0
- package/chip/theme.js +2 -0
- package/color-radio-group/color-radio-group.d.ts +17 -0
- package/color-radio-group/color-radio-group.js +47 -0
- package/color-radio-group/color-radio-group.stories.d.ts +7 -0
- package/color-radio-group/color-radio-group.stories.js +79 -0
- package/color-radio-group/color-radio.d.ts +8 -0
- package/color-radio-group/color-radio.js +28 -0
- package/color-radio-group/index.d.ts +1 -0
- package/color-radio-group/index.js +5 -0
- package/combobox/combobox.d.ts +24 -0
- package/combobox/combobox.js +63 -0
- package/combobox/combobox.stories.d.ts +9 -0
- package/combobox/combobox.stories.js +67 -0
- package/combobox/index.d.ts +1 -0
- package/combobox/index.js +17 -0
- package/config/icons-config.d.ts +2 -0
- package/config/icons-config.js +5 -0
- package/config/icons.d.ts +57 -0
- package/config/icons.js +16 -0
- package/content/content-schema.d.ts +3 -0
- package/content/content-schema.js +2 -0
- package/content/types.d.ts +27 -0
- package/content/types.js +2 -0
- package/context/context.d.ts +12 -0
- package/context/context.js +5 -0
- package/context/index.d.ts +3 -0
- package/context/index.js +19 -0
- package/context/provider.d.ts +8 -0
- package/context/provider.js +10 -0
- package/context/use-component-context.d.ts +3 -0
- package/context/use-component-context.js +13 -0
- package/css/avatar-file-input.css +9 -0
- package/css/avatar.css +15 -0
- package/css/badge.css +23 -0
- package/css/button.css +223 -0
- package/css/checkbox-button.css +99 -0
- package/css/checkbox-input.css +4 -0
- package/css/checkbox.css +103 -0
- package/css/chip.css +37 -0
- package/css/color-radio-group.css +26 -0
- package/css/color-radio.css +21 -0
- package/css/combobox.css +73 -0
- package/css/component-structure-analyzer.css +31 -0
- package/css/date-picker-input.css +123 -0
- package/css/date-picker.css +34 -0
- package/css/dropdown.css +19 -0
- package/css/error-message.css +3 -0
- package/css/flash-messages.css +20 -0
- package/css/form-control.css +7 -0
- package/css/icon.css +8 -0
- package/css/input-basic.css +18 -0
- package/css/input.css +162 -0
- package/css/label.css +14 -0
- package/css/list-item.css +24 -0
- package/css/radio-group.css +143 -0
- package/css/radio.css +90 -0
- package/css/raster-image.css +16 -0
- package/css/select.css +54 -0
- package/css/tabs.css +104 -0
- package/css/text-link.css +12 -0
- package/css/textarea.css +98 -0
- package/css/toggle.css +60 -0
- package/date-picker-input/date-picker-day.d.ts +8 -0
- package/date-picker-input/date-picker-day.js +63 -0
- package/date-picker-input/date-picker-decade.d.ts +6 -0
- package/date-picker-input/date-picker-decade.js +68 -0
- package/date-picker-input/date-picker-input.d.ts +20 -0
- package/date-picker-input/date-picker-input.js +60 -0
- package/date-picker-input/date-picker-input.stories.d.ts +7 -0
- package/date-picker-input/date-picker-input.stories.js +45 -0
- package/date-picker-input/date-picker-month.d.ts +7 -0
- package/date-picker-input/date-picker-month.js +63 -0
- package/date-picker-input/date-picker-provider.d.ts +8 -0
- package/date-picker-input/date-picker-provider.js +26 -0
- package/date-picker-input/date-picker-year.d.ts +7 -0
- package/date-picker-input/date-picker-year.js +73 -0
- package/date-picker-input/date-picker.d.ts +3 -0
- package/date-picker-input/date-picker.js +53 -0
- package/date-picker-input/index.d.ts +3 -0
- package/date-picker-input/index.js +19 -0
- package/date-picker-input/types.d.ts +5 -0
- package/date-picker-input/types.js +2 -0
- package/dropdown/dropdown.d.ts +10 -0
- package/dropdown/dropdown.js +27 -0
- package/dropdown/index.d.ts +1 -0
- package/dropdown/index.js +17 -0
- package/error-message/error-message.d.ts +7 -0
- package/error-message/error-message.js +11 -0
- package/error-message/error-message.stories.d.ts +8 -0
- package/error-message/error-message.stories.js +17 -0
- package/error-message/index.d.ts +1 -0
- package/error-message/index.js +17 -0
- package/flash-messages/flash-message.d.ts +16 -0
- package/flash-messages/flash-message.js +46 -0
- package/flash-messages/flash-messages-service.d.ts +5 -0
- package/flash-messages/flash-messages-service.js +15 -0
- package/flash-messages/flash-messages.d.ts +8 -0
- package/flash-messages/flash-messages.js +55 -0
- package/flash-messages/flash-messages.stories.d.ts +7 -0
- package/flash-messages/flash-messages.stories.js +31 -0
- package/flash-messages/theme.d.ts +4 -0
- package/flash-messages/theme.js +2 -0
- package/form-control/form-control.d.ts +12 -0
- package/form-control/form-control.js +19 -0
- package/form-control/form-control.stories.d.ts +12 -0
- package/form-control/form-control.stories.js +23 -0
- package/form-control/index.d.ts +1 -0
- package/form-control/index.js +17 -0
- package/hooks/use-dropdown.d.ts +2 -0
- package/hooks/use-dropdown.js +28 -0
- package/hooks/use-input-submit.d.ts +4 -0
- package/hooks/use-input-submit.js +40 -0
- package/icon/icon.d.ts +17 -0
- package/icon/icon.js +31 -0
- package/icon/icon.stories.d.ts +7 -0
- package/icon/icon.stories.js +74 -0
- package/icon/index.d.ts +1 -0
- package/icon/index.js +17 -0
- package/icon/theme.d.ts +2 -0
- package/icon/theme.js +2 -0
- package/icon/types.d.ts +2 -0
- package/icon/types.js +2 -0
- package/image-gallery/components/close-button.d.ts +6 -0
- package/image-gallery/components/close-button.js +12 -0
- package/image-gallery/components/dot.d.ts +6 -0
- package/image-gallery/components/dot.js +12 -0
- package/image-gallery/components/gallery.d.ts +11 -0
- package/image-gallery/components/gallery.js +71 -0
- package/image-gallery/components/next-button.d.ts +6 -0
- package/image-gallery/components/next-button.js +12 -0
- package/image-gallery/components/previous-button.d.ts +6 -0
- package/image-gallery/components/previous-button.js +12 -0
- package/image-gallery/context.d.ts +10 -0
- package/image-gallery/context.js +12 -0
- package/image-gallery/image-gallery.d.ts +6 -0
- package/image-gallery/image-gallery.js +55 -0
- package/image-gallery/image-gallery.stories.d.ts +13 -0
- package/image-gallery/image-gallery.stories.js +26 -0
- package/image-gallery/image.d.ts +4 -0
- package/image-gallery/image.js +14 -0
- package/image-gallery/index.d.ts +4 -0
- package/image-gallery/index.js +26 -0
- package/image-gallery/types.d.ts +7 -0
- package/image-gallery/types.js +2 -0
- package/image-gallery/use-image.d.ts +2 -0
- package/image-gallery/use-image.js +16 -0
- package/input/index.d.ts +12 -0
- package/input/index.js +16 -0
- package/input/input-element.d.ts +21 -0
- package/input/input-element.js +11 -0
- package/input/input-left-addon.d.ts +9 -0
- package/input/input-left-addon.js +12 -0
- package/input/input-left-element.d.ts +9 -0
- package/input/input-left-element.js +12 -0
- package/input/input-right-addon.d.ts +8 -0
- package/input/input-right-addon.js +12 -0
- package/input/input-right-element.d.ts +9 -0
- package/input/input-right-element.js +12 -0
- package/input/input.d.ts +8 -0
- package/input/input.js +64 -0
- package/input/input.stories.d.ts +14 -0
- package/input/input.stories.js +81 -0
- package/input/theme.d.ts +6 -0
- package/input/theme.js +2 -0
- package/label/index.d.ts +1 -0
- package/label/index.js +17 -0
- package/label/label.d.ts +11 -0
- package/label/label.js +14 -0
- package/label/label.stories.d.ts +7 -0
- package/label/label.stories.js +17 -0
- package/list-item/index.d.ts +1 -0
- package/list-item/index.js +5 -0
- package/list-item/list-item.d.ts +7 -0
- package/list-item/list-item.js +23 -0
- package/list-item/list-item.stories.d.ts +7 -0
- package/list-item/list-item.stories.js +28 -0
- package/package.json +17 -34
- package/radio/index.d.ts +1 -0
- package/radio/index.js +17 -0
- package/radio/radio.d.ts +6 -0
- package/radio/radio.js +15 -0
- package/radio/radio.stories.d.ts +7 -0
- package/radio/radio.stories.js +42 -0
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.js +17 -0
- package/radio-group/radio-group.d.ts +20 -0
- package/radio-group/radio-group.js +49 -0
- package/radio-group/radio-group.stories.d.ts +7 -0
- package/radio-group/radio-group.stories.js +61 -0
- package/raster-image/index.d.ts +1 -0
- package/raster-image/index.js +17 -0
- package/raster-image/raster-image.d.ts +16 -0
- package/raster-image/raster-image.js +21 -0
- package/raster-image/raster-image.stories.d.ts +7 -0
- package/raster-image/raster-image.stories.js +17 -0
- package/select/index.d.ts +1 -0
- package/select/index.js +17 -0
- package/select/select.d.ts +24 -0
- package/select/select.js +60 -0
- package/select/select.stories.d.ts +9 -0
- package/select/select.stories.js +71 -0
- package/tabs/index.d.ts +1 -0
- package/tabs/index.js +5 -0
- package/tabs/tabs.d.ts +7 -0
- package/tabs/tabs.js +64 -0
- package/tabs/tabs.stories.d.ts +7 -0
- package/tabs/tabs.stories.js +33 -0
- package/text-input/index.d.ts +1 -0
- package/text-input/index.js +17 -0
- package/text-input/text-input.d.ts +30 -0
- package/text-input/text-input.js +57 -0
- package/text-input/text-input.stories.d.ts +8 -0
- package/text-input/text-input.stories.js +54 -0
- package/text-link/index.d.ts +1 -0
- package/text-link/index.js +5 -0
- package/text-link/text-link.d.ts +5 -0
- package/text-link/text-link.js +19 -0
- package/text-link/text-link.stories.d.ts +7 -0
- package/text-link/text-link.stories.js +24 -0
- package/textarea/index.d.ts +1 -0
- package/textarea/index.js +17 -0
- package/textarea/textarea.d.ts +17 -0
- package/textarea/textarea.js +81 -0
- package/textarea/textarea.stories.d.ts +7 -0
- package/textarea/textarea.stories.js +44 -0
- package/toggle/index.d.ts +1 -0
- package/toggle/index.js +17 -0
- package/toggle/toggle.d.ts +8 -0
- package/toggle/toggle.js +16 -0
- package/toggle/toggle.stories.d.ts +7 -0
- package/toggle/toggle.stories.js +51 -0
- package/types/form-control-props.d.ts +24 -0
- package/types/form-control-props.js +2 -0
- package/types/index.d.ts +1 -0
- package/types/index.js +17 -0
- package/utils/action.d.ts +2 -0
- package/utils/action.js +11 -0
- package/utils/component-structure-analyzer.d.ts +6 -0
- package/utils/component-structure-analyzer.js +10 -0
- package/utils/icons-config.js +53 -0
- package/utils/image.d.ts +9 -0
- package/utils/image.js +30 -0
- package/utils/localized-dayjs.d.ts +2 -0
- package/utils/localized-dayjs.js +34 -0
- package/utils/storybook-config.d.ts +19 -0
- package/utils/storybook-config.js +47 -0
- package/utils/tailwind-config.js +152 -0
- package/stories/button.stories.tsx +0 -29
- package/theme/index.d.ts +0 -2
- package/theme/theme-context.d.ts +0 -9
- package/theme/theme-context.js +0 -59
- package/theme/theme.d.ts +0 -14
- package/theme/theme.js +0 -3
- package/types.d.ts +0 -3
- package/types.js +0 -3
package/css/label.css
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.uxf-list-item {
|
|
2
|
+
@apply flex justify-between grow py-4 px-5 min-h-[64px] transition-opacity hover:opacity-75
|
|
3
|
+
outline-none relative before:absolute before:inset-0 before:rounded-lg focus-visible:before:border-2;
|
|
4
|
+
|
|
5
|
+
.uxf-list-item__end-icon {
|
|
6
|
+
@apply shrink-0 pl-3;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:root .light & {
|
|
10
|
+
@apply focus-visible:before:border-primary-500;
|
|
11
|
+
|
|
12
|
+
.uxf-list-item__end-icon {
|
|
13
|
+
@apply text-gray-300;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:root .dark & {
|
|
18
|
+
@apply focus-visible:before:border-primary-500;
|
|
19
|
+
|
|
20
|
+
.uxf-list-item__end-icon {
|
|
21
|
+
@apply text-gray-600;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
.uxf-radio-group {
|
|
2
|
+
&__option {
|
|
3
|
+
@apply outline-none focus-visible:ring-offset-2 focus-visible:ring-2 focus-visible:rounded-lg;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&__option__wrapper {
|
|
7
|
+
@apply flex justify-between;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__option__label {
|
|
11
|
+
@apply line-clamp-2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__label {
|
|
15
|
+
@apply mb-2;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__label--hidden {
|
|
19
|
+
@apply sr-only;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:root .light & {
|
|
23
|
+
.uxf-radio-group__option {
|
|
24
|
+
@apply focus-visible:ring-primary-500 focus-visible:ring-offset-white;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.uxf-radio-group__option__label {
|
|
28
|
+
@apply text-gray-600;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.uxf-radio-group__option__wrapper {
|
|
32
|
+
&.is-selected {
|
|
33
|
+
.uxf-radio-group__option__label {
|
|
34
|
+
@apply text-gray-900;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:root .dark & {
|
|
41
|
+
.uxf-radio-group__option {
|
|
42
|
+
@apply focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.uxf-radio-group__option__label {
|
|
46
|
+
@apply text-white/80;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.uxf-radio-group__option__wrapper {
|
|
50
|
+
&.is-selected {
|
|
51
|
+
.uxf-radio-group__option__label {
|
|
52
|
+
@apply text-white;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.uxf-radio-group--list {
|
|
60
|
+
.uxf-radio-group__options-wrapper {
|
|
61
|
+
@apply divide-y;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.uxf-radio-group__option__wrapper {
|
|
65
|
+
@apply items-center py-4;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.uxf-radio-group__option__label {
|
|
69
|
+
@apply pr-4;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:root .light & {
|
|
73
|
+
.uxf-radio-group__options-wrapper {
|
|
74
|
+
@apply divide-gray-200;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.uxf-radio-group--list__option {
|
|
78
|
+
@apply focus-visible:ring-primary-500 focus-visible:ring-offset-white;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:root .dark & {
|
|
83
|
+
.uxf-radio-group__options-wrapper {
|
|
84
|
+
@apply divide-gray-800;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.uxf-radio-group--list__option {
|
|
88
|
+
@apply focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.uxf-radio-group--list__option__label {
|
|
92
|
+
@apply text-white;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.uxf-radio-group--radioButton {
|
|
98
|
+
.uxf-radio-group__options-wrapper {
|
|
99
|
+
@apply flex flex-wrap gap-2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.uxf-radio-group__option__wrapper {
|
|
103
|
+
@apply flex-col-reverse min-w-[112px] p-3 relative
|
|
104
|
+
before:absolute before:inset-0 before:pointer-events-none before:border before:rounded-lg;
|
|
105
|
+
|
|
106
|
+
&.is-selected {
|
|
107
|
+
@apply before:border-2;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.uxf-radio-group__option__label {
|
|
112
|
+
@apply pt-4 text-sm;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:root .light & {
|
|
116
|
+
.uxf-radio-group__option {
|
|
117
|
+
@apply focus-visible:ring-primary-500;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.uxf-radio-group__option__wrapper {
|
|
121
|
+
@apply before:border-gray-400;
|
|
122
|
+
|
|
123
|
+
&.is-selected {
|
|
124
|
+
@apply before:border-primary-500;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:root .dark & {
|
|
130
|
+
.uxf-radio-group__option {
|
|
131
|
+
@apply focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.uxf-radio-group__option__wrapper {
|
|
135
|
+
@apply border-gray-400;
|
|
136
|
+
|
|
137
|
+
&.is-selected {
|
|
138
|
+
@apply before:border-primary-500;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
package/css/radio.css
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.uxf-radio {
|
|
2
|
+
@apply flex shrink-0 items-center justify-center h-6 w-6 border rounded-full transition focus-visible:ring-2;
|
|
3
|
+
|
|
4
|
+
&__label {
|
|
5
|
+
@apply sr-only;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&__inner {
|
|
9
|
+
@apply rounded-full h-2.5 w-2.5 opacity-0 transition;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.is-selected {
|
|
13
|
+
.uxf-radio__inner {
|
|
14
|
+
@apply opacity-100;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:root .light & {
|
|
19
|
+
@apply border-gray-400 focus-visible:ring-primary-500;
|
|
20
|
+
|
|
21
|
+
&.is-selected {
|
|
22
|
+
@apply bg-primary-500 border-none;
|
|
23
|
+
|
|
24
|
+
.uxf-radio__inner {
|
|
25
|
+
@apply bg-white;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.is-disabled {
|
|
30
|
+
@apply border-gray-200 pointer-events-none;
|
|
31
|
+
|
|
32
|
+
&.is-selected {
|
|
33
|
+
@apply bg-gray-200;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.uxf-radio__inner {
|
|
37
|
+
@apply bg-gray-400;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.is-invalid {
|
|
42
|
+
@apply border-red-600;
|
|
43
|
+
|
|
44
|
+
&.is-selected {
|
|
45
|
+
@apply bg-red-600;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.uxf-radio__inner {
|
|
49
|
+
@apply bg-white;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:root .dark & {
|
|
55
|
+
@apply border-gray-400 focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
|
|
56
|
+
|
|
57
|
+
&.is-selected {
|
|
58
|
+
@apply bg-primary-500 border-none;
|
|
59
|
+
|
|
60
|
+
.uxf-radio__inner {
|
|
61
|
+
@apply bg-white;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.is-disabled {
|
|
66
|
+
@apply border-gray-600 pointer-events-none;
|
|
67
|
+
|
|
68
|
+
&.is-selected {
|
|
69
|
+
@apply bg-gray-600;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.uxf-radio__inner {
|
|
73
|
+
@apply bg-gray-800;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.is-invalid {
|
|
78
|
+
@apply border-red-600;
|
|
79
|
+
|
|
80
|
+
&.is-selected {
|
|
81
|
+
@apply bg-red-600;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.uxf-radio__inner {
|
|
85
|
+
@apply bg-white;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
package/css/select.css
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.uxf-select {
|
|
2
|
+
@apply relative;
|
|
3
|
+
|
|
4
|
+
&__button {
|
|
5
|
+
@apply relative flex h-12 w-full cursor-default flex-row items-center rounded-lg py-3 px-4 text-left outline-none focus-visible:ring-2 before:absolute before:inset-0 before:pointer-events-none before:border before:rounded-lg;
|
|
6
|
+
|
|
7
|
+
:root .light & {
|
|
8
|
+
@apply bg-gray-100 text-gray-900 before:border-gray-200 focus-visible:before:border-none focus-visible:ring-primary-500;
|
|
9
|
+
|
|
10
|
+
.is-empty {
|
|
11
|
+
@apply text-gray-400;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:root .dark & {
|
|
16
|
+
@apply bg-gray-800 text-gray-300 before:border-gray-700 focus-visible:ring-primary-500;
|
|
17
|
+
|
|
18
|
+
.is-empty {
|
|
19
|
+
@apply text-gray-400;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.is-invalid {
|
|
24
|
+
@apply ring-1;
|
|
25
|
+
|
|
26
|
+
:root .light & {
|
|
27
|
+
@apply ring-error-500 text-error-500;
|
|
28
|
+
|
|
29
|
+
.is-empty {
|
|
30
|
+
@apply text-error-500;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
:root .dark & {
|
|
34
|
+
@apply ring-error-500 text-error-500;
|
|
35
|
+
|
|
36
|
+
.is-empty {
|
|
37
|
+
@apply text-error-500;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__button-text {
|
|
44
|
+
@apply flex-grow;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__button-icon {
|
|
48
|
+
@apply text-gray-600 transition duration-300;
|
|
49
|
+
|
|
50
|
+
&.is-open {
|
|
51
|
+
@apply -scale-y-100;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
package/css/tabs.css
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
.test-focus {
|
|
2
|
+
@apply ring-red-400 ring-2;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.uxf-tabs {
|
|
6
|
+
@apply w-full;
|
|
7
|
+
|
|
8
|
+
&__tab-list__wrapper {
|
|
9
|
+
@apply w-fit mb-6;
|
|
10
|
+
|
|
11
|
+
&--default {
|
|
12
|
+
@apply relative before:absolute before:pointer-events-none before:bottom-0 before:w-full before:border-b-2;
|
|
13
|
+
|
|
14
|
+
:root .light & {
|
|
15
|
+
@apply before:border-b-gray-100;
|
|
16
|
+
}
|
|
17
|
+
:root .dark & {
|
|
18
|
+
@apply before:border-b-gray-800;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--segmented {
|
|
23
|
+
@apply rounded-lg;
|
|
24
|
+
|
|
25
|
+
:root .light & {
|
|
26
|
+
@apply bg-gray-100;
|
|
27
|
+
}
|
|
28
|
+
:root .dark & {
|
|
29
|
+
@apply bg-gray-700;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__tab-list {
|
|
35
|
+
@apply flex items-center text-base font-semibold overflow-x-auto whitespace-nowrap w-fit;
|
|
36
|
+
|
|
37
|
+
scrollbar-width: none;
|
|
38
|
+
|
|
39
|
+
&::-webkit-scrollbar {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--default {
|
|
44
|
+
@apply py-1.5 px-1 space-x-2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--segmented {
|
|
48
|
+
@apply p-1 space-x-1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__tab {
|
|
53
|
+
@apply inline-flex text-center items-center justify-center px-2 py-2 whitespace-nowrap
|
|
54
|
+
transition-colors outline-none cursor-pointer is-disabled:pointer-events-none
|
|
55
|
+
focus-visible:ring-2 focus-visible:ring-offset-1 overflow-visible;
|
|
56
|
+
|
|
57
|
+
&--default {
|
|
58
|
+
@apply relative rounded-lg before:absolute before:bottom-[-6px] before:w-full before:border-b-2
|
|
59
|
+
before:opacity-0 before:transition;
|
|
60
|
+
|
|
61
|
+
:root .light & {
|
|
62
|
+
@apply text-gray-600 hover:bg-gray-100 focus-visible:ring-primary-500;
|
|
63
|
+
}
|
|
64
|
+
:root .dark & {
|
|
65
|
+
@apply text-gray-200 hover:bg-gray-800 focus-visible:ring-primary-500
|
|
66
|
+
focus-visible:ring-offset-gray-900;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.is-active {
|
|
70
|
+
@apply before:opacity-100;
|
|
71
|
+
|
|
72
|
+
:root .light & {
|
|
73
|
+
@apply text-gray-900 before:border-b-primary-500 hover:bg-transparent;
|
|
74
|
+
}
|
|
75
|
+
:root .dark & {
|
|
76
|
+
@apply text-white before:border-b-primary-500 hover:bg-transparent;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&--segmented {
|
|
82
|
+
@apply rounded;
|
|
83
|
+
|
|
84
|
+
:root .light & {
|
|
85
|
+
@apply text-gray-600 bg-gray-100 hover:text-primary-600 hover:bg-primary-100
|
|
86
|
+
focus-visible:ring-primary-500 focus-visible:ring-offset-gray-100;
|
|
87
|
+
}
|
|
88
|
+
:root .dark & {
|
|
89
|
+
@apply text-gray-200 bg-gray-700 hover:bg-gray-800 focus-visible:ring-primary-500
|
|
90
|
+
focus-visible:ring-offset-gray-700;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.is-active {
|
|
94
|
+
:root .light & {
|
|
95
|
+
@apply text-white bg-primary-500;
|
|
96
|
+
}
|
|
97
|
+
:root .dark & {
|
|
98
|
+
@apply text-white bg-primary-500;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.uxf-text-link {
|
|
2
|
+
@apply underline transition outline-none relative before:absolute before:-inset-1
|
|
3
|
+
focus-visible:before:border-2 focus-visible:before:rounded-lg;
|
|
4
|
+
|
|
5
|
+
:root .light & {
|
|
6
|
+
@apply text-primary-500 hover:text-primary-400 focus-visible:before:border-primary-500;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:root .dark & {
|
|
10
|
+
@apply text-primary-500 hover:text-primary-400 focus-visible:before:border-primary-500;
|
|
11
|
+
}
|
|
12
|
+
}
|
package/css/textarea.css
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
.uxf-textarea {
|
|
2
|
+
&__wrapper {
|
|
3
|
+
@apply rounded-md text-base
|
|
4
|
+
border p-2;
|
|
5
|
+
|
|
6
|
+
:root .light & {
|
|
7
|
+
@apply bg-gray-100 text-gray-900 border-gray-200;
|
|
8
|
+
}
|
|
9
|
+
:root .dark & {
|
|
10
|
+
@apply bg-gray-800 text-gray-300 border-gray-700;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__element {
|
|
15
|
+
@apply bg-transparent outline-none resize-none;
|
|
16
|
+
|
|
17
|
+
:root .light & {
|
|
18
|
+
@apply placeholder:text-gray-400;
|
|
19
|
+
}
|
|
20
|
+
:root .dark & {
|
|
21
|
+
@apply placeholder:text-gray-400;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.is-focused {
|
|
26
|
+
.uxf-textarea__wrapper {
|
|
27
|
+
@apply ring-2 ring-inset ring-offset-0;
|
|
28
|
+
|
|
29
|
+
:root .light & {
|
|
30
|
+
@apply ring-primary-500;
|
|
31
|
+
}
|
|
32
|
+
:root .dark & {
|
|
33
|
+
@apply ring-primary-500;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.is-disabled {
|
|
39
|
+
@apply cursor-not-allowed;
|
|
40
|
+
.uxf-textarea__wrapper {
|
|
41
|
+
:root .light & {
|
|
42
|
+
@apply bg-gray-300;
|
|
43
|
+
}
|
|
44
|
+
:root .dark & {
|
|
45
|
+
@apply bg-gray-600;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.uxf-textarea__element {
|
|
50
|
+
@apply cursor-not-allowed;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.is-readonly {
|
|
55
|
+
@apply cursor-text;
|
|
56
|
+
|
|
57
|
+
.uxf-textarea__element {
|
|
58
|
+
@apply cursor-text;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.uxf-textarea__wrapper {
|
|
62
|
+
@apply ring-0;
|
|
63
|
+
|
|
64
|
+
:root .light & {
|
|
65
|
+
@apply border-gray-300;
|
|
66
|
+
}
|
|
67
|
+
:root .dark & {
|
|
68
|
+
@apply border-gray-500;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.uxf-textarea__element {
|
|
73
|
+
@apply cursor-not-allowed pointer-events-none;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.is-invalid {
|
|
78
|
+
&.is-focused {
|
|
79
|
+
.uxf-textarea__wrapper {
|
|
80
|
+
@apply ring-0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.uxf-textarea__wrapper {
|
|
85
|
+
@apply border-error-500;
|
|
86
|
+
|
|
87
|
+
.uxf-textarea__element {
|
|
88
|
+
:root .light & {
|
|
89
|
+
@apply text-error-500 placeholder:text-error-500;
|
|
90
|
+
}
|
|
91
|
+
:root .dark & {
|
|
92
|
+
@apply text-error-500 placeholder:text-error-500;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
package/css/toggle.css
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.uxf-toggle {
|
|
2
|
+
@apply relative inline-flex h-6 w-12 items-center rounded-full p-0.5 outline-none ring-offset-2
|
|
3
|
+
focus-visible:ring-2;
|
|
4
|
+
|
|
5
|
+
&__label {
|
|
6
|
+
@apply sr-only;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&__inner {
|
|
10
|
+
@apply inline-block h-5 w-5 transform rounded-full bg-white transition;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.is-selected {
|
|
14
|
+
.uxf-toggle__inner {
|
|
15
|
+
@apply translate-x-6;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
:root .light & {
|
|
21
|
+
@apply bg-gray-200 focus-visible:ring-primary-500;
|
|
22
|
+
|
|
23
|
+
&__inner {
|
|
24
|
+
@apply bg-white;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.is-selected {
|
|
28
|
+
@apply bg-primary-500;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.is-disabled {
|
|
32
|
+
@apply bg-gray-100;
|
|
33
|
+
|
|
34
|
+
.uxf-toggle__inner {
|
|
35
|
+
@apply bg-gray-400;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:root .dark & {
|
|
41
|
+
@apply bg-gray-400 focus-visible:ring-primary-500 focus-visible:ring-offset-gray-900;
|
|
42
|
+
|
|
43
|
+
&.is-selected {
|
|
44
|
+
@apply bg-primary-500;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__inner {
|
|
48
|
+
@apply bg-gray-900;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.is-disabled {
|
|
52
|
+
@apply bg-gray-700;
|
|
53
|
+
|
|
54
|
+
.uxf-toggle__inner {
|
|
55
|
+
@apply bg-gray-500;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CalendarDay } from "@uxf/datepicker/utils/get-days";
|
|
3
|
+
interface DatePickerDayProps {
|
|
4
|
+
currentMonth: boolean;
|
|
5
|
+
day: CalendarDay;
|
|
6
|
+
}
|
|
7
|
+
export declare const DatePickerDay: React.NamedExoticComponent<DatePickerDayProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DatePickerDay = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const use_day_1 = require("@uxf/datepicker/hooks/use-day");
|
|
29
|
+
const date_picker_context_1 = require("@uxf/datepicker/contexts/date-picker-context");
|
|
30
|
+
const composeRefs_1 = require("@uxf/core/utils/composeRefs");
|
|
31
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
32
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
33
|
+
const useOnMount_1 = require("@uxf/core/hooks/useOnMount");
|
|
34
|
+
exports.DatePickerDay = (0, react_1.memo)((props) => {
|
|
35
|
+
const { day } = props;
|
|
36
|
+
const dayCellRef = (0, react_1.useRef)(null);
|
|
37
|
+
const innerRef = (0, react_1.useRef)(null);
|
|
38
|
+
const { focusedDate, isDateBlocked, isDateFocused, isDateHovered, isDateSelected, onDateFocus, onDateHover, onDateSelect, } = (0, react_1.useContext)(date_picker_context_1.DatePickerContext);
|
|
39
|
+
const { disabledDate, isSelected, onClick, onKeyDown, onMouseEnter, tabIndex, isToday } = (0, use_day_1.useDay)({
|
|
40
|
+
date: day.date,
|
|
41
|
+
focusedDate,
|
|
42
|
+
isDateBlocked,
|
|
43
|
+
isDateFocused,
|
|
44
|
+
isDateHovered,
|
|
45
|
+
isDateSelected,
|
|
46
|
+
onDateFocus,
|
|
47
|
+
onDateHover,
|
|
48
|
+
onDateSelect,
|
|
49
|
+
dayRef: dayCellRef,
|
|
50
|
+
});
|
|
51
|
+
const isDisabled = disabledDate || !day.currentMonth;
|
|
52
|
+
(0, useOnMount_1.useOnMount)(() => {
|
|
53
|
+
const node = innerRef.current;
|
|
54
|
+
if (node && (isToday || isSelected)) {
|
|
55
|
+
node.focus();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
if (!day.dayLabel) {
|
|
59
|
+
return react_1.default.createElement("div", null);
|
|
60
|
+
}
|
|
61
|
+
return (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-date-picker__cell uxf-date-picker__cell__day", isDisabled && classes_1.CLASSES.IS_DISABLED, isToday && "uxf-date-picker__cell__day--today", isSelected && "uxf-date-picker__cell__day--selected", !props.currentMonth && "uxf-date-picker__cell__day--not-current-month"), ref: isDisabled ? undefined : (0, composeRefs_1.composeRefs)(dayCellRef, innerRef), onClick: onClick, onKeyDown: onKeyDown, onMouseEnter: onMouseEnter, tabIndex: tabIndex }, day.dayLabel));
|
|
62
|
+
});
|
|
63
|
+
exports.DatePickerDay.displayName = "DatePickerDay";
|