@uxf/ui 1.0.0-beta.9 → 1.0.0-beta.91
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 +12 -0
- package/avatar/avatar.d.ts +5 -0
- package/avatar/avatar.js +14 -0
- package/avatar/avatar.spec.d.ts +1 -0
- package/avatar/avatar.spec.js +9 -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 +17 -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/{storybook → avatar-file-input}/index.js +1 -2
- 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 +17 -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 -12
- package/button/button.stories.d.ts +9 -5
- package/button/button.stories.js +56 -18
- package/button/index.d.ts +1 -2
- package/button/index.js +1 -8
- package/button/theme.d.ts +5 -2
- package/button/theme.js +0 -1
- package/checkbox/checkbox.d.ts +12 -0
- package/checkbox/checkbox.js +18 -0
- package/checkbox/checkbox.spec.d.ts +1 -0
- package/checkbox/checkbox.spec.js +11 -0
- package/checkbox/checkbox.stories.d.ts +7 -0
- package/checkbox/checkbox.stories.js +44 -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 +18 -0
- package/checkbox-button/checkbox-button.spec.d.ts +1 -0
- package/checkbox-button/checkbox-button.spec.js +10 -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-visual/checkbox-visual.d.ts +9 -0
- package/checkbox-visual/checkbox-visual.js +17 -0
- package/checkbox-visual/checkbox-visual.stories.d.ts +7 -0
- package/checkbox-visual/checkbox-visual.stories.js +44 -0
- package/checkbox-visual/index.d.ts +1 -0
- package/checkbox-visual/index.js +17 -0
- package/checkbox-visual/theme.d.ts +4 -0
- package/checkbox-visual/theme.js +2 -0
- package/chip/chip.d.ts +10 -0
- package/chip/chip.js +19 -0
- package/chip/chip.stories.d.ts +14 -0
- package/chip/chip.stories.js +32 -0
- package/chip/index.d.ts +1 -0
- package/chip/index.js +17 -0
- package/chip/theme.d.ts +14 -0
- package/chip/theme.js +2 -0
- package/color-radio-group/color-radio-group.d.ts +18 -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 +22 -0
- package/color-radio-group/index.d.ts +1 -0
- package/color-radio-group/index.js +17 -0
- package/combobox/combobox.d.ts +24 -0
- package/combobox/combobox.js +61 -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 +77 -0
- package/config/icons.js +20 -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 +15 -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 +13 -0
- package/context/use-component-context.d.ts +3 -0
- package/context/use-component-context.js +13 -0
- package/css/avatar-file-input.css +7 -0
- package/css/avatar.css +15 -0
- package/css/badge.css +23 -0
- package/css/button.css +221 -0
- package/css/button.old.css +231 -0
- package/css/checkbox-button.css +98 -0
- package/css/checkbox.css +142 -0
- package/css/chip.css +171 -0
- package/css/chip.old.css +37 -0
- package/css/color-radio-group.css +21 -0
- package/css/color-radio.css +21 -0
- package/css/combobox.css +108 -0
- package/css/combobox.old.css +102 -0
- package/css/component-structure-analyzer.css +31 -0
- package/css/date-picker-input.css +133 -0
- package/css/date-picker.css +90 -0
- package/css/dropdown.css +24 -0
- package/css/dropdown.old.css +24 -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 +7 -0
- package/css/input-basic.css +18 -0
- package/css/input.css +205 -0
- package/css/input.old.css +193 -0
- package/css/label.css +15 -0
- package/css/layout.css +47 -0
- package/css/list-item.css +29 -0
- package/css/pagination.css +28 -0
- package/css/radio-group.css +160 -0
- package/css/radio.css +105 -0
- package/css/raster-image.css +20 -0
- package/css/select.css +72 -0
- package/css/select.old.css +66 -0
- package/css/tabs.css +131 -0
- package/css/text-link.css +12 -0
- package/css/textarea.css +117 -0
- package/css/time-picker-input.css +136 -0
- package/css/time-picker.css +27 -0
- package/css/toggle.css +80 -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 +71 -0
- package/date-picker-input/date-picker-input.d.ts +21 -0
- package/date-picker-input/date-picker-input.js +88 -0
- package/date-picker-input/date-picker-input.stories.d.ts +14 -0
- package/date-picker-input/date-picker-input.stories.js +54 -0
- package/date-picker-input/date-picker-month.d.ts +7 -0
- package/date-picker-input/date-picker-month.js +66 -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 +74 -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 +11 -0
- package/dropdown/dropdown.js +27 -0
- package/dropdown/dropdown.stories.d.ts +10 -0
- package/dropdown/dropdown.stories.js +30 -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 +13 -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 +25 -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 +30 -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 +38 -0
- package/icon/icon.stories.d.ts +18 -0
- package/icon/icon.stories.js +53 -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 +72 -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 +27 -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 +65 -0
- package/input/input.stories.d.ts +15 -0
- package/input/input.stories.js +93 -0
- package/input/theme.d.ts +8 -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 +12 -0
- package/label/label.js +14 -0
- package/label/label.stories.d.ts +7 -0
- package/label/label.stories.js +17 -0
- package/layout/index.d.ts +1 -0
- package/layout/index.js +17 -0
- package/layout/layout.d.ts +9 -0
- package/layout/layout.js +60 -0
- package/layout/layout.stories.d.ts +8 -0
- package/layout/layout.stories.js +21 -0
- package/layout/uxf-logo.d.ts +6 -0
- package/layout/uxf-logo.js +13 -0
- package/list-item/index.d.ts +1 -0
- package/list-item/index.js +17 -0
- package/list-item/list-item.d.ts +8 -0
- package/list-item/list-item.js +24 -0
- package/list-item/list-item.stories.d.ts +7 -0
- package/list-item/list-item.stories.js +32 -0
- package/package.json +18 -36
- package/pagination/pagination.d.ts +7 -0
- package/pagination/pagination.js +49 -0
- package/pagination/pagination.stories.d.ts +7 -0
- package/pagination/pagination.stories.js +47 -0
- package/radio/index.d.ts +1 -0
- package/radio/index.js +17 -0
- package/radio/radio.d.ts +9 -0
- package/radio/radio.js +16 -0
- package/radio/radio.spec.d.ts +1 -0
- package/radio/radio.spec.js +10 -0
- package/radio/radio.stories.d.ts +7 -0
- package/radio/radio.stories.js +35 -0
- package/radio/theme.d.ts +4 -0
- package/radio/theme.js +2 -0
- package/radio-group/index.d.ts +1 -0
- package/radio-group/index.js +17 -0
- package/radio-group/radio-group.d.ts +24 -0
- package/radio-group/radio-group.js +49 -0
- package/radio-group/radio-group.spec.d.ts +1 -0
- package/radio-group/radio-group.spec.js +24 -0
- package/radio-group/radio-group.stories.d.ts +7 -0
- package/radio-group/radio-group.stories.js +58 -0
- package/radio-group/theme.d.ts +5 -0
- package/radio-group/theme.js +2 -0
- package/raster-image/index.d.ts +1 -0
- package/raster-image/index.js +17 -0
- package/raster-image/raster-image.d.ts +30 -0
- package/raster-image/raster-image.js +35 -0
- package/raster-image/raster-image.stories.d.ts +30 -0
- package/raster-image/raster-image.stories.js +17 -0
- package/scripts/generate-tw-tokens.js +94 -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 +58 -0
- package/select/select.stories.d.ts +9 -0
- package/select/select.stories.js +81 -0
- package/tabs/index.d.ts +1 -0
- package/tabs/index.js +17 -0
- package/tabs/tabs.d.ts +19 -0
- package/tabs/tabs.js +68 -0
- package/tabs/tabs.stories.d.ts +11 -0
- package/tabs/tabs.stories.js +48 -0
- package/text-input/index.d.ts +1 -0
- package/text-input/index.js +17 -0
- package/text-input/text-input.d.ts +31 -0
- package/text-input/text-input.js +57 -0
- package/text-input/text-input.spec.d.ts +1 -0
- package/text-input/text-input.spec.js +9 -0
- package/text-input/text-input.stories.d.ts +8 -0
- package/text-input/text-input.stories.js +56 -0
- package/text-link/index.d.ts +1 -0
- package/text-link/index.js +17 -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 +18 -0
- package/textarea/textarea.js +81 -0
- package/textarea/textarea.stories.d.ts +7 -0
- package/textarea/textarea.stories.js +44 -0
- package/time-picker-input/index.d.ts +2 -0
- package/time-picker-input/index.js +18 -0
- package/time-picker-input/time-picker-hour.d.ts +5 -0
- package/time-picker-input/time-picker-hour.js +47 -0
- package/time-picker-input/time-picker-hours.d.ts +2 -0
- package/time-picker-input/time-picker-hours.js +14 -0
- package/time-picker-input/time-picker-input.d.ts +22 -0
- package/time-picker-input/time-picker-input.js +89 -0
- package/time-picker-input/time-picker-input.stories.d.ts +7 -0
- package/time-picker-input/time-picker-input.stories.js +45 -0
- package/time-picker-input/time-picker-minute.d.ts +5 -0
- package/time-picker-input/time-picker-minute.js +47 -0
- package/time-picker-input/time-picker-minutes.d.ts +2 -0
- package/time-picker-input/time-picker-minutes.js +14 -0
- package/time-picker-input/time-picker.d.ts +8 -0
- package/time-picker-input/time-picker.js +69 -0
- package/toggle/index.d.ts +1 -0
- package/toggle/index.js +17 -0
- package/toggle/theme.d.ts +4 -0
- package/toggle/theme.js +2 -0
- package/toggle/toggle.d.ts +12 -0
- package/toggle/toggle.js +19 -0
- package/toggle/toggle.stories.d.ts +7 -0
- package/toggle/toggle.stories.js +52 -0
- package/tw-tokens/tw-box-shadow.d.ts +11 -0
- package/tw-tokens/tw-box-shadow.js +14 -0
- package/tw-tokens/tw-colors.d.ts +328 -0
- package/tw-tokens/tw-colors.js +331 -0
- package/tw-tokens/tw-containers.d.ts +8 -0
- package/tw-tokens/tw-containers.js +11 -0
- package/tw-tokens/tw-font-size.d.ts +42 -0
- package/tw-tokens/tw-font-size.js +19 -0
- package/tw-tokens/tw-font-weight.d.ts +12 -0
- package/tw-tokens/tw-font-weight.js +15 -0
- package/tw-tokens/tw-line-height.d.ts +17 -0
- package/tw-tokens/tw-line-height.js +20 -0
- package/tw-tokens/tw-screens.d.ts +8 -0
- package/tw-tokens/tw-screens.js +11 -0
- package/tw-tokens/tw-spacing.d.ts +39 -0
- package/tw-tokens/tw-spacing.js +42 -0
- package/tw-tokens/tw-z-index.d.ts +19 -0
- package/tw-tokens/tw-z-index.js +22 -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 +73 -0
- package/utils/image.d.ts +19 -0
- package/utils/image.js +104 -0
- package/utils/is-light-background.d.ts +2 -0
- package/utils/is-light-background.js +11 -0
- package/utils/snap-test.d.ts +2 -0
- package/utils/snap-test.js +17 -0
- package/utils/storybook-config.d.ts +26 -0
- package/{storybook → utils}/storybook-config.js +12 -6
- package/utils/tailwind-config.js +170 -0
- package/stories/button.stories.tsx +0 -87
- package/storybook/index.d.ts +0 -1
- package/storybook/storybook-config.d.ts +0 -21
- package/tailwindui/button.css +0 -51
- package/types.d.ts +0 -3
- package/types.js +0 -3
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
const plugin = require("tailwindcss/plugin");
|
|
2
|
+
const { em } = require("@uxf/styles/units/em");
|
|
3
|
+
const { rem } = require("@uxf/styles/units/rem");
|
|
4
|
+
|
|
5
|
+
/** @type {Record<string, string>} */
|
|
6
|
+
const CONTAINERS = {
|
|
7
|
+
xs: rem(540),
|
|
8
|
+
sm: rem(720),
|
|
9
|
+
md: rem(928),
|
|
10
|
+
lg: rem(1024),
|
|
11
|
+
xl: rem(1216),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @type {Record<string, string>} */
|
|
15
|
+
const SCREENS = {
|
|
16
|
+
xs: em(576),
|
|
17
|
+
sm: em(768),
|
|
18
|
+
md: em(992),
|
|
19
|
+
lg: em(1200),
|
|
20
|
+
xl: em(1440),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @type {import('tailwindcss').Config} */
|
|
24
|
+
module.exports = {
|
|
25
|
+
content: [],
|
|
26
|
+
theme: {
|
|
27
|
+
containers: CONTAINERS,
|
|
28
|
+
screens: SCREENS,
|
|
29
|
+
inputSize: {
|
|
30
|
+
xs: "30px",
|
|
31
|
+
sm: "34px",
|
|
32
|
+
default: "38px",
|
|
33
|
+
lg: "42px",
|
|
34
|
+
xl: "46px",
|
|
35
|
+
},
|
|
36
|
+
extend: {
|
|
37
|
+
borderRadius: {
|
|
38
|
+
inherit: "inherit",
|
|
39
|
+
},
|
|
40
|
+
colors: {
|
|
41
|
+
inherit: "inherit",
|
|
42
|
+
lightHigh: "#111827",
|
|
43
|
+
lightMedium: "#4b5563",
|
|
44
|
+
lightLow: "#9ca3af",
|
|
45
|
+
darkHigh: "#ffffff",
|
|
46
|
+
darkMedium: "#ffffffcc",
|
|
47
|
+
darkLow: "#ffffff80",
|
|
48
|
+
lightBorder: "#e5e7eb",
|
|
49
|
+
darkBorder: "#374151",
|
|
50
|
+
primary: {
|
|
51
|
+
50: "#eff6ff",
|
|
52
|
+
100: "#dbeafe",
|
|
53
|
+
200: "#bfdbfe",
|
|
54
|
+
300: "#93c5fd",
|
|
55
|
+
400: "#60a5fa",
|
|
56
|
+
500: "#3b82f6",
|
|
57
|
+
600: "#2563eb",
|
|
58
|
+
700: "#1d4ed8",
|
|
59
|
+
800: "#1e40af",
|
|
60
|
+
900: "#1e3a8a",
|
|
61
|
+
},
|
|
62
|
+
success: {
|
|
63
|
+
50: "#f0fdf4",
|
|
64
|
+
100: "#dcfce7",
|
|
65
|
+
200: "#bbf7d0",
|
|
66
|
+
300: "#86efac",
|
|
67
|
+
400: "#4ade80",
|
|
68
|
+
500: "#22c55e",
|
|
69
|
+
600: "#16a34a",
|
|
70
|
+
700: "#15803d",
|
|
71
|
+
800: "#166534",
|
|
72
|
+
900: "#14532d",
|
|
73
|
+
},
|
|
74
|
+
warning: {
|
|
75
|
+
50: "#fff7ed",
|
|
76
|
+
100: "#ffedd5",
|
|
77
|
+
200: "#fed7aa",
|
|
78
|
+
300: "#fdba74",
|
|
79
|
+
400: "#fb923c",
|
|
80
|
+
500: "#f97316",
|
|
81
|
+
600: "#ea580c",
|
|
82
|
+
700: "#c2410c",
|
|
83
|
+
800: "#9a3412",
|
|
84
|
+
900: "#7c2d12",
|
|
85
|
+
},
|
|
86
|
+
error: {
|
|
87
|
+
50: "#fef2f2",
|
|
88
|
+
100: "#fee2e2",
|
|
89
|
+
200: "#fecaca",
|
|
90
|
+
300: "#fca5a5",
|
|
91
|
+
400: "#f87171",
|
|
92
|
+
500: "#ef4444",
|
|
93
|
+
600: "#dc2626",
|
|
94
|
+
700: "#b91c1c",
|
|
95
|
+
800: "#991b1b",
|
|
96
|
+
900: "#7f1d1d",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
spacing: {
|
|
100
|
+
inherit: "inherit",
|
|
101
|
+
},
|
|
102
|
+
zIndex: {
|
|
103
|
+
1: "1",
|
|
104
|
+
focus: "5",
|
|
105
|
+
fixed: "10",
|
|
106
|
+
menu: "25",
|
|
107
|
+
header: "50",
|
|
108
|
+
modal: "100",
|
|
109
|
+
dropdown: "200",
|
|
110
|
+
flashMessage: "250",
|
|
111
|
+
tooltip: "300",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
corePlugins: {
|
|
116
|
+
aspectRatio: false,
|
|
117
|
+
container: false,
|
|
118
|
+
},
|
|
119
|
+
plugins: [
|
|
120
|
+
require("@tailwindcss/aspect-ratio"),
|
|
121
|
+
require("@tailwindcss/line-clamp"),
|
|
122
|
+
plugin(
|
|
123
|
+
({ addComponents, theme }) => {
|
|
124
|
+
const screens = theme("screens", SCREENS);
|
|
125
|
+
const containers = theme("containers", CONTAINERS);
|
|
126
|
+
|
|
127
|
+
const mqs = Object.entries(screens);
|
|
128
|
+
const widths = mqs
|
|
129
|
+
.map((item) => {
|
|
130
|
+
const key = item[0];
|
|
131
|
+
const value = item[1];
|
|
132
|
+
const width = containers[key];
|
|
133
|
+
if (width) {
|
|
134
|
+
return { [`@media (min-width: ${value})`]: { ".container": { "max-width": width } } };
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
.filter((i) => i);
|
|
138
|
+
|
|
139
|
+
addComponents([
|
|
140
|
+
{
|
|
141
|
+
".container": {
|
|
142
|
+
"margin-left": "auto",
|
|
143
|
+
"margin-right": "auto",
|
|
144
|
+
width: "100%",
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
...widths,
|
|
148
|
+
]);
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
content: [],
|
|
152
|
+
theme: {
|
|
153
|
+
containers: CONTAINERS,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
),
|
|
157
|
+
plugin(({ addVariant }) => {
|
|
158
|
+
addVariant("is-active", "&.is-active");
|
|
159
|
+
addVariant("is-selected", "&.is-selected");
|
|
160
|
+
addVariant("is-hoverable", ["&.is-hoverable:active", "&.is-hoverable:hover"]);
|
|
161
|
+
addVariant("is-focused", "&.is-focused");
|
|
162
|
+
addVariant("is-required", ["&.is-required", "&:required"]);
|
|
163
|
+
addVariant("is-invalid", "&.is-invalid");
|
|
164
|
+
addVariant("is-loading", ["&.is-loading"]);
|
|
165
|
+
addVariant("is-readonly", ["&.is-readonly", "&:readonly"]);
|
|
166
|
+
addVariant("is-disabled", ["&.is-disabled", "&:disabled"]);
|
|
167
|
+
addVariant("is-empty", ["&.is-empty"]);
|
|
168
|
+
}),
|
|
169
|
+
],
|
|
170
|
+
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Button } from "@uxf/ui/button";
|
|
3
|
-
import { useStorybookConfig } from "@uxf/ui/storybook";
|
|
4
|
-
import { Fragment } from "react";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "UI/Button",
|
|
8
|
-
component: Button,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export function Default() {
|
|
12
|
-
const config = useStorybookConfig("Button");
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div className="space-y-2">
|
|
16
|
-
{config.variants.map((variant) => (
|
|
17
|
-
<Fragment key={variant}>
|
|
18
|
-
{config.colors.map((color) => (
|
|
19
|
-
<div key={color} className="space-x-2">
|
|
20
|
-
{config.sizes.map((size) => (
|
|
21
|
-
<Button key={size} variant={variant} color={color} size={size}>
|
|
22
|
-
Button
|
|
23
|
-
</Button>
|
|
24
|
-
))}
|
|
25
|
-
</div>
|
|
26
|
-
))}
|
|
27
|
-
</Fragment>
|
|
28
|
-
))}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function Disabled() {
|
|
34
|
-
const config = useStorybookConfig("Button");
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div className="space-y-2">
|
|
38
|
-
{config.variants.map((variant) => (
|
|
39
|
-
<Fragment key={variant}>
|
|
40
|
-
{config.colors.map((color) => (
|
|
41
|
-
<div key={color} className="space-x-2">
|
|
42
|
-
{config.sizes.map((size) => (
|
|
43
|
-
<Button
|
|
44
|
-
key={size}
|
|
45
|
-
variant={variant}
|
|
46
|
-
color={color}
|
|
47
|
-
size={size}
|
|
48
|
-
disabled
|
|
49
|
-
>
|
|
50
|
-
Button
|
|
51
|
-
</Button>
|
|
52
|
-
))}
|
|
53
|
-
</div>
|
|
54
|
-
))}
|
|
55
|
-
</Fragment>
|
|
56
|
-
))}
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function Loading() {
|
|
62
|
-
const config = useStorybookConfig("Button");
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<div className="space-y-2">
|
|
66
|
-
{config.variants.map((variant) => (
|
|
67
|
-
<Fragment key={variant}>
|
|
68
|
-
{config.colors.map((color) => (
|
|
69
|
-
<div key={color} className="space-x-2">
|
|
70
|
-
{config.sizes.map((size) => (
|
|
71
|
-
<Button
|
|
72
|
-
key={size}
|
|
73
|
-
variant={variant}
|
|
74
|
-
color={color}
|
|
75
|
-
size={size}
|
|
76
|
-
loading
|
|
77
|
-
>
|
|
78
|
-
Button
|
|
79
|
-
</Button>
|
|
80
|
-
))}
|
|
81
|
-
</div>
|
|
82
|
-
))}
|
|
83
|
-
</Fragment>
|
|
84
|
-
))}
|
|
85
|
-
</div>
|
|
86
|
-
);
|
|
87
|
-
}
|
package/storybook/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./storybook-config";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ButtonColors, ButtonSizes, ButtonVariants } from "@uxf/ui/button";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
export declare const defaultConfig: StorybookConfig;
|
|
4
|
-
export interface StorybookConfig {
|
|
5
|
-
Button: {
|
|
6
|
-
sizes: Array<keyof ButtonSizes>;
|
|
7
|
-
variants: Array<keyof ButtonVariants>;
|
|
8
|
-
colors: Array<keyof ButtonColors>;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare function useStorybookConfig(key: keyof StorybookConfig): {
|
|
12
|
-
sizes: (keyof ButtonSizes)[];
|
|
13
|
-
variants: (keyof ButtonVariants)[];
|
|
14
|
-
colors: (keyof ButtonColors)[];
|
|
15
|
-
};
|
|
16
|
-
interface StorybookContextProviderProps {
|
|
17
|
-
config: StorybookConfig;
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
}
|
|
20
|
-
export declare function StorybookContextProvider(props: StorybookContextProviderProps): JSX.Element;
|
|
21
|
-
export {};
|
package/tailwindui/button.css
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
@apply inline-flex shadow-sm items-center shadow-sm font-medium rounded focus:outline-none focus:ring-2 focus:ring-offset-2;
|
|
3
|
-
|
|
4
|
-
&.button--disabled {
|
|
5
|
-
@apply pointer-events-none opacity-40;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
&.button--size-xs {
|
|
9
|
-
@apply px-2.5 py-1.5 text-xs;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&.button--size-sm {
|
|
13
|
-
@apply px-3 py-2 text-sm leading-4;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.button--size-default {
|
|
17
|
-
@apply px-4 py-2 text-sm;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.button--size-lg {
|
|
21
|
-
@apply px-4 py-2 text-base;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.button--size-xl {
|
|
25
|
-
@apply px-6 py-3 border text-base;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.button--variant-outlined {
|
|
29
|
-
@apply border bg-white;
|
|
30
|
-
|
|
31
|
-
&.button--color-default {
|
|
32
|
-
@apply border-primary-300 text-primary-700 hover:bg-primary-50 focus:ring-primary-500;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.button--color-secondary {
|
|
36
|
-
@apply border-secondary-300 text-secondary-700 hover:bg-secondary-50 focus:ring-secondary-500;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.button--variant-default {
|
|
41
|
-
@apply border-transparent text-white;
|
|
42
|
-
|
|
43
|
-
&.button--color-default {
|
|
44
|
-
@apply bg-primary-500 hover:bg-primary-600 focus:ring-primary-400;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.button--color-secondary {
|
|
48
|
-
@apply bg-secondary-500 hover:bg-secondary-600 focus:ring-secondary-400;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
package/types.d.ts
DELETED
package/types.js
DELETED