@sk-web-gui/core 0.1.44 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +5 -5
- package/package.json +2 -2
- package/src/colors.js +145 -145
- package/src/components/accordion.js +93 -89
- package/src/components/alert.js +98 -98
- package/src/components/avatar.js +85 -85
- package/src/components/badge.js +60 -60
- package/src/components/breadcrumb.js +13 -13
- package/src/components/button-group.js +46 -46
- package/src/components/button.js +304 -304
- package/src/components/calendar.js +82 -82
- package/src/components/card.js +54 -54
- package/src/components/checkbox.js +127 -127
- package/src/components/code.js +9 -9
- package/src/components/cookie-consent.js +30 -30
- package/src/components/divider.js +12 -12
- package/src/components/dot.js +84 -84
- package/src/components/dropdown-filter.js +72 -72
- package/src/components/footer.js +42 -42
- package/src/components/forms.js +256 -256
- package/src/components/header.js +35 -35
- package/src/components/icon-button.js +5 -5
- package/src/components/icon.js +9 -9
- package/src/components/kbd.js +9 -9
- package/src/components/link.js +20 -20
- package/src/components/message.js +62 -62
- package/src/components/modal.js +30 -30
- package/src/components/notification.js +56 -56
- package/src/components/pagination.js +69 -69
- package/src/components/radio.js +104 -104
- package/src/components/search-bar.js +45 -45
- package/src/components/side-menu.js +167 -167
- package/src/components/switch.js +119 -119
- package/src/components/tab-menu.js +44 -44
- package/src/components/table.js +13 -13
- package/src/components/tag.js +97 -97
- package/src/components/user-menu.js +23 -23
- package/src/components/zebratable.js +77 -77
- package/src/index.js +283 -272
- package/src/with-opacity.js +6 -6
- package/dist/cjs/colors.js +0 -140
- package/dist/cjs/colors.js.map +0 -1
- package/dist/cjs/components/accordion.js +0 -86
- package/dist/cjs/components/accordion.js.map +0 -1
- package/dist/cjs/components/alert.js +0 -71
- package/dist/cjs/components/alert.js.map +0 -1
- package/dist/cjs/components/avatar.js +0 -78
- package/dist/cjs/components/avatar.js.map +0 -1
- package/dist/cjs/components/badge.js +0 -53
- package/dist/cjs/components/badge.js.map +0 -1
- package/dist/cjs/components/breadcrumb.js +0 -23
- package/dist/cjs/components/breadcrumb.js.map +0 -1
- package/dist/cjs/components/button-group.js +0 -50
- package/dist/cjs/components/button-group.js.map +0 -1
- package/dist/cjs/components/button.js +0 -154
- package/dist/cjs/components/button.js.map +0 -1
- package/dist/cjs/components/calendar.js +0 -76
- package/dist/cjs/components/calendar.js.map +0 -1
- package/dist/cjs/components/card.js +0 -59
- package/dist/cjs/components/card.js.map +0 -1
- package/dist/cjs/components/checkbox.js +0 -92
- package/dist/cjs/components/checkbox.js.map +0 -1
- package/dist/cjs/components/code.js +0 -21
- package/dist/cjs/components/code.js.map +0 -1
- package/dist/cjs/components/cookie-consent.js +0 -35
- package/dist/cjs/components/cookie-consent.js.map +0 -1
- package/dist/cjs/components/divider.js +0 -24
- package/dist/cjs/components/divider.js.map +0 -1
- package/dist/cjs/components/dot.js +0 -70
- package/dist/cjs/components/dot.js.map +0 -1
- package/dist/cjs/components/footer.js +0 -39
- package/dist/cjs/components/footer.js.map +0 -1
- package/dist/cjs/components/forms.js +0 -225
- package/dist/cjs/components/forms.js.map +0 -1
- package/dist/cjs/components/header.js +0 -34
- package/dist/cjs/components/header.js.map +0 -1
- package/dist/cjs/components/icon-button.js +0 -17
- package/dist/cjs/components/icon-button.js.map +0 -1
- package/dist/cjs/components/icon.js +0 -20
- package/dist/cjs/components/icon.js.map +0 -1
- package/dist/cjs/components/kbd.js +0 -21
- package/dist/cjs/components/kbd.js.map +0 -1
- package/dist/cjs/components/link.js +0 -29
- package/dist/cjs/components/link.js.map +0 -1
- package/dist/cjs/components/message.js +0 -63
- package/dist/cjs/components/message.js.map +0 -1
- package/dist/cjs/components/modal.js +0 -35
- package/dist/cjs/components/modal.js.map +0 -1
- package/dist/cjs/components/notification.js +0 -58
- package/dist/cjs/components/notification.js.map +0 -1
- package/dist/cjs/components/pagination.js +0 -66
- package/dist/cjs/components/pagination.js.map +0 -1
- package/dist/cjs/components/radio.js +0 -95
- package/dist/cjs/components/radio.js.map +0 -1
- package/dist/cjs/components/switch.js +0 -107
- package/dist/cjs/components/switch.js.map +0 -1
- package/dist/cjs/components/table.js +0 -23
- package/dist/cjs/components/table.js.map +0 -1
- package/dist/cjs/components/tag.js +0 -88
- package/dist/cjs/components/tag.js.map +0 -1
- package/dist/cjs/components/types.js +0 -10
- package/dist/cjs/components/types.js.map +0 -1
- package/dist/cjs/components/user-menu.js +0 -33
- package/dist/cjs/components/user-menu.js.map +0 -1
- package/dist/cjs/components/zebratable.js +0 -70
- package/dist/cjs/components/zebratable.js.map +0 -1
- package/dist/cjs/index.js +0 -282
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/with-opacity.js +0 -15
- package/dist/cjs/with-opacity.js.map +0 -1
- package/dist/esm/colors.js +0 -137
- package/dist/esm/colors.js.map +0 -1
- package/dist/esm/components/accordion.js +0 -76
- package/dist/esm/components/accordion.js.map +0 -1
- package/dist/esm/components/alert.js +0 -67
- package/dist/esm/components/alert.js.map +0 -1
- package/dist/esm/components/avatar.js +0 -68
- package/dist/esm/components/avatar.js.map +0 -1
- package/dist/esm/components/badge.js +0 -48
- package/dist/esm/components/badge.js.map +0 -1
- package/dist/esm/components/breadcrumb.js +0 -13
- package/dist/esm/components/breadcrumb.js.map +0 -1
- package/dist/esm/components/button-group.js +0 -40
- package/dist/esm/components/button-group.js.map +0 -1
- package/dist/esm/components/button.js +0 -197
- package/dist/esm/components/button.js.map +0 -1
- package/dist/esm/components/calendar.js +0 -66
- package/dist/esm/components/calendar.js.map +0 -1
- package/dist/esm/components/card.js +0 -49
- package/dist/esm/components/card.js.map +0 -1
- package/dist/esm/components/checkbox.js +0 -110
- package/dist/esm/components/checkbox.js.map +0 -1
- package/dist/esm/components/code.js +0 -11
- package/dist/esm/components/code.js.map +0 -1
- package/dist/esm/components/cookie-consent.js +0 -25
- package/dist/esm/components/cookie-consent.js.map +0 -1
- package/dist/esm/components/divider.js +0 -14
- package/dist/esm/components/divider.js.map +0 -1
- package/dist/esm/components/dot.js +0 -61
- package/dist/esm/components/dot.js.map +0 -1
- package/dist/esm/components/footer.js +0 -29
- package/dist/esm/components/footer.js.map +0 -1
- package/dist/esm/components/forms.js +0 -217
- package/dist/esm/components/forms.js.map +0 -1
- package/dist/esm/components/header.js +0 -29
- package/dist/esm/components/header.js.map +0 -1
- package/dist/esm/components/icon-button.js +0 -7
- package/dist/esm/components/icon-button.js.map +0 -1
- package/dist/esm/components/icon.js +0 -10
- package/dist/esm/components/icon.js.map +0 -1
- package/dist/esm/components/kbd.js +0 -11
- package/dist/esm/components/kbd.js.map +0 -1
- package/dist/esm/components/link.js +0 -19
- package/dist/esm/components/link.js.map +0 -1
- package/dist/esm/components/message.js +0 -53
- package/dist/esm/components/message.js.map +0 -1
- package/dist/esm/components/modal.js +0 -25
- package/dist/esm/components/modal.js.map +0 -1
- package/dist/esm/components/notification.js +0 -48
- package/dist/esm/components/notification.js.map +0 -1
- package/dist/esm/components/pagination.js +0 -56
- package/dist/esm/components/pagination.js.map +0 -1
- package/dist/esm/components/radio.js +0 -88
- package/dist/esm/components/radio.js.map +0 -1
- package/dist/esm/components/switch.js +0 -98
- package/dist/esm/components/switch.js.map +0 -1
- package/dist/esm/components/table.js +0 -13
- package/dist/esm/components/table.js.map +0 -1
- package/dist/esm/components/tag.js +0 -84
- package/dist/esm/components/tag.js.map +0 -1
- package/dist/esm/components/types.js +0 -3
- package/dist/esm/components/types.js.map +0 -1
- package/dist/esm/components/user-menu.js +0 -23
- package/dist/esm/components/user-menu.js.map +0 -1
- package/dist/esm/components/zebratable.js +0 -60
- package/dist/esm/components/zebratable.js.map +0 -1
- package/dist/esm/index.js +0 -327
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/with-opacity.js +0 -10
- package/dist/esm/with-opacity.js.map +0 -1
- package/dist/types/accordion/index.d.ts +0 -1
- package/dist/types/accordion/src/accordion.d.ts +0 -17
- package/dist/types/accordion/src/index.d.ts +0 -1
- package/dist/types/accordion/src/styles.d.ts +0 -1
- package/dist/types/accordion/stories/accordion.stories.d.ts +0 -40
- package/dist/types/alert/index.d.ts +0 -1
- package/dist/types/alert/src/alert.d.ts +0 -15
- package/dist/types/alert/src/index.d.ts +0 -8
- package/dist/types/alert/src/styles.d.ts +0 -2
- package/dist/types/breadcrumb/index.d.ts +0 -1
- package/dist/types/breadcrumb/src/breadcrumb.d.ts +0 -34
- package/dist/types/breadcrumb/src/index.d.ts +0 -10
- package/dist/types/breadcrumb/stories/breadcrumb.stories.d.ts +0 -28
- package/dist/types/button/index.d.ts +0 -1
- package/dist/types/button/src/button-group.d.ts +0 -20
- package/dist/types/button/src/button.d.ts +0 -21
- package/dist/types/button/src/icon-button.d.ts +0 -17
- package/dist/types/button/src/index.d.ts +0 -10
- package/dist/types/button/src/styles.d.ts +0 -1
- package/dist/types/button/stories/announcement.d.ts +0 -6
- package/dist/types/button/stories/button-group.stories.d.ts +0 -14
- package/dist/types/button/stories/button.stories.d.ts +0 -127
- package/dist/types/button/stories/icon-button.stories.d.ts +0 -16
- package/dist/types/card/index.d.ts +0 -1
- package/dist/types/card/src/card.d.ts +0 -38
- package/dist/types/card/src/index.d.ts +0 -1
- package/dist/types/card/src/styles.d.ts +0 -1
- package/dist/types/card/stories/card.stories.d.ts +0 -56
- package/dist/types/checkbox/index.d.ts +0 -1
- package/dist/types/checkbox/src/checkbox-group.d.ts +0 -36
- package/dist/types/checkbox/src/checkbox.d.ts +0 -46
- package/dist/types/checkbox/src/index.d.ts +0 -9
- package/dist/types/checkbox/src/styles.d.ts +0 -2
- package/dist/types/checkbox/stories/checkbox.stories.d.ts +0 -103
- package/dist/types/cookie-consent/index.d.ts +0 -1
- package/dist/types/cookie-consent/src/cookie-consent.d.ts +0 -37
- package/dist/types/cookie-consent/src/index.d.ts +0 -1
- package/dist/types/cookie-consent/src/styles.d.ts +0 -1
- package/dist/types/core/src/colors.d.ts +0 -1
- package/dist/types/core/src/components/accordion.d.ts +0 -3
- package/dist/types/core/src/components/alert.d.ts +0 -3
- package/dist/types/core/src/components/avatar.d.ts +0 -3
- package/dist/types/core/src/components/badge.d.ts +0 -3
- package/dist/types/core/src/components/breadcrumb.d.ts +0 -3
- package/dist/types/core/src/components/button-group.d.ts +0 -3
- package/dist/types/core/src/components/button.d.ts +0 -3
- package/dist/types/core/src/components/calendar.d.ts +0 -3
- package/dist/types/core/src/components/card.d.ts +0 -3
- package/dist/types/core/src/components/checkbox.d.ts +0 -3
- package/dist/types/core/src/components/code.d.ts +0 -3
- package/dist/types/core/src/components/cookie-consent.d.ts +0 -3
- package/dist/types/core/src/components/divider.d.ts +0 -3
- package/dist/types/core/src/components/dot.d.ts +0 -3
- package/dist/types/core/src/components/footer.d.ts +0 -3
- package/dist/types/core/src/components/forms.d.ts +0 -3
- package/dist/types/core/src/components/header.d.ts +0 -3
- package/dist/types/core/src/components/icon-button.d.ts +0 -3
- package/dist/types/core/src/components/icon.d.ts +0 -3
- package/dist/types/core/src/components/kbd.d.ts +0 -3
- package/dist/types/core/src/components/link.d.ts +0 -3
- package/dist/types/core/src/components/message.d.ts +0 -3
- package/dist/types/core/src/components/modal.d.ts +0 -3
- package/dist/types/core/src/components/notification.d.ts +0 -3
- package/dist/types/core/src/components/pagination.d.ts +0 -3
- package/dist/types/core/src/components/radio.d.ts +0 -3
- package/dist/types/core/src/components/switch.d.ts +0 -3
- package/dist/types/core/src/components/table.d.ts +0 -3
- package/dist/types/core/src/components/tag.d.ts +0 -3
- package/dist/types/core/src/components/types.d.ts +0 -5
- package/dist/types/core/src/components/user-menu.d.ts +0 -3
- package/dist/types/core/src/components/zebratable.d.ts +0 -3
- package/dist/types/core/src/index.d.ts +0 -1
- package/dist/types/core/src/with-opacity.d.ts +0 -3
- package/dist/types/divider/index.d.ts +0 -1
- package/dist/types/divider/src/divider.d.ts +0 -9
- package/dist/types/divider/src/index.d.ts +0 -1
- package/dist/types/divider/stories/divider.stories.d.ts +0 -33
- package/dist/types/dot/index.d.ts +0 -1
- package/dist/types/dot/src/dot.d.ts +0 -12
- package/dist/types/dot/src/index.d.ts +0 -1
- package/dist/types/dot/src/styles.d.ts +0 -1
- package/dist/types/dot/stories/dot.stories.d.ts +0 -15
- package/dist/types/footer/index.d.ts +0 -1
- package/dist/types/footer/src/footer.d.ts +0 -11
- package/dist/types/footer/src/index.d.ts +0 -1
- package/dist/types/footer/stories/footer.stories.d.ts +0 -95
- package/dist/types/forms/index.d.ts +0 -1
- package/dist/types/forms/src/calendar/index.d.ts +0 -12
- package/dist/types/forms/src/calendar/styles.d.ts +0 -1
- package/dist/types/forms/src/form-control/index.d.ts +0 -27
- package/dist/types/forms/src/form-error-message/index.d.ts +0 -9
- package/dist/types/forms/src/form-helper-text/index.d.ts +0 -9
- package/dist/types/forms/src/form-label/index.d.ts +0 -13
- package/dist/types/forms/src/index.d.ts +0 -8
- package/dist/types/forms/src/input/index.d.ts +0 -15
- package/dist/types/forms/src/input/input.d.ts +0 -30
- package/dist/types/forms/src/input/styles.d.ts +0 -1
- package/dist/types/forms/src/input-addon/index.d.ts +0 -13
- package/dist/types/forms/src/input-element/index.d.ts +0 -15
- package/dist/types/forms/src/input-group/index.d.ts +0 -11
- package/dist/types/forms/src/select/index.d.ts +0 -6
- package/dist/types/forms/src/select/styles.d.ts +0 -1
- package/dist/types/forms/src/textarea/index.d.ts +0 -13
- package/dist/types/forms/stories/calendar.stories.d.ts +0 -58
- package/dist/types/forms/stories/check.d.ts +0 -6
- package/dist/types/forms/stories/form-control.stories.d.ts +0 -16
- package/dist/types/forms/stories/input.stories.d.ts +0 -32
- package/dist/types/forms/stories/select.stories.d.ts +0 -118
- package/dist/types/forms/stories/textarea.stories.d.ts +0 -23
- package/dist/types/header/index.d.ts +0 -1
- package/dist/types/header/src/header.d.ts +0 -13
- package/dist/types/header/src/index.d.ts +0 -1
- package/dist/types/header/stories/header.stories.d.ts +0 -118
- package/dist/types/icon/index.d.ts +0 -1
- package/dist/types/icon/src/core.d.ts +0 -10
- package/dist/types/icon/src/icon.d.ts +0 -14
- package/dist/types/icon/src/index.d.ts +0 -2
- package/dist/types/icon/stories/icon.stories.d.ts +0 -12
- package/dist/types/image/index.d.ts +0 -1
- package/dist/types/image/src/image.d.ts +0 -28
- package/dist/types/image/src/index.d.ts +0 -2
- package/dist/types/image/src/use-image.d.ts +0 -52
- package/dist/types/image/stories/image.stories.d.ts +0 -12
- package/dist/types/link/index.d.ts +0 -1
- package/dist/types/link/src/index.d.ts +0 -1
- package/dist/types/link/src/link.d.ts +0 -12
- package/dist/types/link/stories/link.stories.d.ts +0 -46
- package/dist/types/message/index.d.ts +0 -1
- package/dist/types/message/src/index.d.ts +0 -1
- package/dist/types/message/src/message.d.ts +0 -2
- package/dist/types/message/stories/message.stories.d.ts +0 -11
- package/dist/types/notification/index.d.ts +0 -1
- package/dist/types/notification/src/index.d.ts +0 -1
- package/dist/types/notification/src/notification.d.ts +0 -5
- package/dist/types/notification/stories/notification.stories.d.ts +0 -11
- package/dist/types/pagination/index.d.ts +0 -1
- package/dist/types/pagination/src/index.d.ts +0 -1
- package/dist/types/pagination/src/pagination.d.ts +0 -11
- package/dist/types/pagination/src/styles.d.ts +0 -1
- package/dist/types/pagination/stories/pagination.stories.d.ts +0 -75
- package/dist/types/radio/index.d.ts +0 -1
- package/dist/types/radio/src/index.d.ts +0 -9
- package/dist/types/radio/src/radio-group.d.ts +0 -41
- package/dist/types/radio/src/radio.d.ts +0 -45
- package/dist/types/radio/src/styles.d.ts +0 -2
- package/dist/types/radio/stories/radio-group.stories.d.ts +0 -75
- package/dist/types/radio/stories/radio.stories.d.ts +0 -104
- package/dist/types/react/index.d.ts +0 -1
- package/dist/types/react/src/index.d.ts +0 -26
- package/dist/types/spinner/index.d.ts +0 -1
- package/dist/types/spinner/src/index.d.ts +0 -1
- package/dist/types/spinner/src/spinner.d.ts +0 -8
- package/dist/types/spinner/src/styles.d.ts +0 -2
- package/dist/types/spinner/stories/spinner.stories.d.ts +0 -13
- package/dist/types/switch/index.d.ts +0 -1
- package/dist/types/switch/src/index.d.ts +0 -1
- package/dist/types/switch/src/styles.d.ts +0 -2
- package/dist/types/switch/src/switch.d.ts +0 -42
- package/dist/types/switch/stories/switch.stories.d.ts +0 -76
- package/dist/types/table/index.d.ts +0 -1
- package/dist/types/table/src/index.d.ts +0 -1
- package/dist/types/table/src/styles.d.ts +0 -1
- package/dist/types/table/src/zebratable.d.ts +0 -33
- package/dist/types/table/stories/zebratable.stories.d.ts +0 -69
- package/dist/types/tag/index.d.ts +0 -1
- package/dist/types/tag/src/index.d.ts +0 -1
- package/dist/types/tag/src/styles.d.ts +0 -1
- package/dist/types/tag/src/tag.d.ts +0 -13
- package/dist/types/tag/stories/tag.stories.d.ts +0 -86
- package/dist/types/theme/index.d.ts +0 -1
- package/dist/types/theme/src/colors.d.ts +0 -272
- package/dist/types/theme/src/create-memo-class.d.ts +0 -1
- package/dist/types/theme/src/create-theme-vars/calc.d.ts +0 -19
- package/dist/types/theme/src/create-theme-vars/create-theme-vars.d.ts +0 -9
- package/dist/types/theme/src/create-theme-vars/css-var.d.ts +0 -7
- package/dist/types/theme/src/create-theme-vars/index.d.ts +0 -4
- package/dist/types/theme/src/create-theme-vars/theme-tokens.d.ts +0 -10
- package/dist/types/theme/src/create-theme-vars/to-css-var.d.ts +0 -2
- package/dist/types/theme/src/default-theme.d.ts +0 -4
- package/dist/types/theme/src/gui-provider.d.ts +0 -16
- package/dist/types/theme/src/index.d.ts +0 -6
- package/dist/types/theme/src/types.d.ts +0 -56
- package/dist/types/theme/src/use-safe-effect.d.ts +0 -2
- package/dist/types/theme/src/utils.d.ts +0 -1
- package/dist/types/toast/index.d.ts +0 -1
- package/dist/types/toast/src/index.d.ts +0 -1
- package/dist/types/toast/src/toast.d.ts +0 -62
- package/dist/types/toasted-notes/index.d.ts +0 -1
- package/dist/types/toasted-notes/src/Alert.d.ts +0 -8
- package/dist/types/toasted-notes/src/Message.d.ts +0 -26
- package/dist/types/toasted-notes/src/Positions.d.ts +0 -9
- package/dist/types/toasted-notes/src/Toast.d.ts +0 -13
- package/dist/types/toasted-notes/src/ToastManager.d.ts +0 -45
- package/dist/types/toasted-notes/src/index.d.ts +0 -4
- package/dist/types/toasted-notes/src/useTimeout.d.ts +0 -3
- package/dist/types/user-menu/index.d.ts +0 -1
- package/dist/types/user-menu/src/index.d.ts +0 -6
- package/dist/types/user-menu/src/styles.d.ts +0 -1
- package/dist/types/user-menu/src/user-menu.d.ts +0 -21
- package/dist/types/user-menu/stories/announcement.d.ts +0 -6
- package/dist/types/user-menu/stories/user-menu.stories.d.ts +0 -5
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/src/assertion.d.ts +0 -4
- package/dist/types/utils/src/children.d.ts +0 -8
- package/dist/types/utils/src/color.d.ts +0 -9
- package/dist/types/utils/src/index.d.ts +0 -10
- package/dist/types/utils/src/object.d.ts +0 -6
- package/dist/types/utils/src/refs.d.ts +0 -5
- package/dist/types/utils/src/slug.d.ts +0 -1
- package/dist/types/utils/src/types.d.ts +0 -13
- package/dist/types/utils/src/walk-object.d.ts +0 -5
- package/dist/types/visually-hidden/index.d.ts +0 -1
- package/dist/types/visually-hidden/src/index.d.ts +0 -32
package/src/components/button.js
CHANGED
|
@@ -1,304 +1,304 @@
|
|
|
1
|
-
function buttonSolid(colors) {
|
|
2
|
-
return {
|
|
3
|
-
'&-solid': {
|
|
4
|
-
//"@apply text-": {},
|
|
5
|
-
'@apply font-semibold border border-gray-stroke': {},
|
|
6
|
-
'@apply text-body bg-white': {},
|
|
7
|
-
/* hover */
|
|
8
|
-
'@apply hover:text-white hover:bg-hover hover:border-primary-active': {},
|
|
9
|
-
/* focus */
|
|
10
|
-
'@apply focus-visible:z-base': {},
|
|
11
|
-
'@apply focus-visible:border-primary': {},
|
|
12
|
-
'@apply focus-visible:ring-4 focus-visible:ring-black': {},
|
|
13
|
-
/* active */
|
|
14
|
-
'@apply active:bg-hover active:text-white': {},
|
|
15
|
-
|
|
16
|
-
/* dark mode */
|
|
17
|
-
'@apply dark:border-neutral-600': {},
|
|
18
|
-
'@apply dark:text-neutral-100 dark:bg-neutral-700': {},
|
|
19
|
-
/* dark hover */
|
|
20
|
-
'@apply dark:hover:border-hover dark:hover:bg-neutral-600': {},
|
|
21
|
-
/* dark focus */
|
|
22
|
-
'@apply dark:focus-visible:border-primary-500': {},
|
|
23
|
-
/* dark active */
|
|
24
|
-
'@apply dark:active:bg-neutral-900 dark:active:border-neutral-600': {},
|
|
25
|
-
|
|
26
|
-
...colors.reduce(
|
|
27
|
-
(styles, color) => ({
|
|
28
|
-
...styles,
|
|
29
|
-
[`&[data-color="${color}"]`]: {
|
|
30
|
-
//[`@apply border-${color}`]: {},
|
|
31
|
-
[`@apply text-white bg-${color}`]: {},
|
|
32
|
-
// hover
|
|
33
|
-
[`@apply hover:text-white hover:bg-${color}-active`]: {},
|
|
34
|
-
|
|
35
|
-
[`@apply active:text-white active:bg-${color}-active`]: {},
|
|
36
|
-
[`@apply focus-visible:ring-4 focus-visible:ring-black`]: {},
|
|
37
|
-
|
|
38
|
-
// focus
|
|
39
|
-
//[`@apply focus-visible:bg-${color}-700`]: {},
|
|
40
|
-
//[`@apply focus-visible:border-${color}-500`]: {},
|
|
41
|
-
//[`@apply focus-visible:ring-${color}-500`]: {},
|
|
42
|
-
// active
|
|
43
|
-
//[`@apply active:bg-${color}-600`]: {},
|
|
44
|
-
// dark mode
|
|
45
|
-
//[`@apply dark:border-${color}-500`]: {},
|
|
46
|
-
//[`@apply dark:bg-${color}-600`]: {},
|
|
47
|
-
// dark hover
|
|
48
|
-
//[`@apply dark:hover:border-${color}-400 dark:hover:bg-${color}-500`]: {},
|
|
49
|
-
// dark focus
|
|
50
|
-
//[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
51
|
-
//[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
52
|
-
// dark active
|
|
53
|
-
//[`@apply dark:active:bg-${color}-800 dark:active:border-${color}-600`]: {},
|
|
54
|
-
},
|
|
55
|
-
}),
|
|
56
|
-
{}
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
"&[data-color='primary']": {
|
|
60
|
-
'@apply border-primary hover:border-primary-active': {},
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
'&.btn': {
|
|
64
|
-
'&-disabled': {
|
|
65
|
-
'@apply disabled:border-gray-stroke hover:border-gray-stroke': {},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function buttonOutline(colors) {
|
|
73
|
-
return {
|
|
74
|
-
'&-outline': {
|
|
75
|
-
'@apply font-semibold border border-gray-stroke': {},
|
|
76
|
-
'@apply text-body bg-transparent': {},
|
|
77
|
-
/* hover */
|
|
78
|
-
'@apply hover:text-white hover:bg-primary-active hover:border-primary-active': {},
|
|
79
|
-
/* focus */
|
|
80
|
-
'@apply focus-visible:z-base': {},
|
|
81
|
-
'@apply focus-visible:border-primary-500': {},
|
|
82
|
-
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
83
|
-
/* active */
|
|
84
|
-
'@apply active:bg-neutral-200': {},
|
|
85
|
-
/* dark mode */
|
|
86
|
-
'@apply dark:border-neutral-600': {},
|
|
87
|
-
'@apply dark:text-neutral-100 dark:bg-transparent': {},
|
|
88
|
-
/* dark hover */
|
|
89
|
-
'@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700': {},
|
|
90
|
-
/* dark focus */
|
|
91
|
-
'@apply dark:focus-visible:border-primary-500': {},
|
|
92
|
-
/* dark active */
|
|
93
|
-
'@apply dark:active:bg-neutral-600 dark:active:border-neutral-600': {},
|
|
94
|
-
|
|
95
|
-
...colors.reduce(
|
|
96
|
-
(styles, color) => ({
|
|
97
|
-
...styles,
|
|
98
|
-
[`&[data-color="${color}"]`]: {
|
|
99
|
-
[`@apply border-current`]: {},
|
|
100
|
-
[`@apply text-${color}-600 bg-transparent`]: {},
|
|
101
|
-
/* hover */
|
|
102
|
-
[`@apply hover:text-white hover:bg-${color}-active hover:border-${color}-active`]: {},
|
|
103
|
-
/* focus */
|
|
104
|
-
[`@apply focus-visible:border-${color}-500`]: {},
|
|
105
|
-
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
106
|
-
/* active */
|
|
107
|
-
[`@apply active:bg-${color}-100`]: {},
|
|
108
|
-
/* dark mode */
|
|
109
|
-
[`@apply dark:border-${color}-200`]: {},
|
|
110
|
-
[`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
|
|
111
|
-
[`@apply dark:border-${color}-300`]: {},
|
|
112
|
-
/* dark hover */
|
|
113
|
-
[`@apply dark:hover:bg-${color}-200`]: {},
|
|
114
|
-
[`@apply dark:hover:bg-opacity-15`]: {},
|
|
115
|
-
/* dark focus */
|
|
116
|
-
[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
117
|
-
[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
118
|
-
/* dark active */
|
|
119
|
-
[`@apply dark:active:bg-${color}-200`]: {},
|
|
120
|
-
[`@apply dark:active:bg-opacity-25`]: {},
|
|
121
|
-
},
|
|
122
|
-
}),
|
|
123
|
-
{}
|
|
124
|
-
),
|
|
125
|
-
|
|
126
|
-
'&.btn': {
|
|
127
|
-
'&-disabled': {
|
|
128
|
-
'@apply disabled:border-gray-stroke hover:border-gray-stroke': {},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function buttonGhost(colors) {
|
|
136
|
-
return {
|
|
137
|
-
'&-ghost': {
|
|
138
|
-
'@apply text-body bg-transparent': {},
|
|
139
|
-
'@apply hover:bg-neutral-100': {},
|
|
140
|
-
/* focus */
|
|
141
|
-
'@apply focus-visible:z-base': {},
|
|
142
|
-
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
143
|
-
/* active */
|
|
144
|
-
'@apply active:bg-neutral-200': {},
|
|
145
|
-
/* dark mode */
|
|
146
|
-
'@apply dark:text-neutral-100 dark:bg-transparent': {},
|
|
147
|
-
/* dark hover */
|
|
148
|
-
'@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700': {},
|
|
149
|
-
/* dark active */
|
|
150
|
-
'@apply dark:active:bg-neutral-600 dark:active:border-neutral-400': {},
|
|
151
|
-
|
|
152
|
-
...colors.reduce(
|
|
153
|
-
(styles, color) => ({
|
|
154
|
-
...styles,
|
|
155
|
-
[`&[data-color="${color}"]`]: {
|
|
156
|
-
[`@apply text-${color}-600`]: {},
|
|
157
|
-
[`@apply hover:bg-${color}-50`]: {},
|
|
158
|
-
/* focus */
|
|
159
|
-
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
160
|
-
[`@apply active:bg-${color}-100`]: {},
|
|
161
|
-
// dark colors
|
|
162
|
-
[`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
|
|
163
|
-
[`@apply dark:border-${color}-300 dark:hover:bg-${color}-200`]: {},
|
|
164
|
-
[`@apply dark:hover:bg-opacity-15`]: {},
|
|
165
|
-
[`@apply dark:active:bg-${color}-200`]: {},
|
|
166
|
-
[`@apply dark:active:bg-opacity-25`]: {},
|
|
167
|
-
},
|
|
168
|
-
}),
|
|
169
|
-
{}
|
|
170
|
-
),
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function buttonLight(colors) {
|
|
176
|
-
return {
|
|
177
|
-
'&-light': {
|
|
178
|
-
'@apply shadow-sm': {},
|
|
179
|
-
'@apply border border-transparent': {},
|
|
180
|
-
'@apply text-body bg-neutral-100': {},
|
|
181
|
-
/* hover */
|
|
182
|
-
'@apply hover:bg-neutral-200': {},
|
|
183
|
-
/* focus */
|
|
184
|
-
'@apply focus-visible:z-base': {},
|
|
185
|
-
'@apply focus-visible:border-primary-500': {},
|
|
186
|
-
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
187
|
-
/* active */
|
|
188
|
-
'@apply active:bg-neutral-300': {},
|
|
189
|
-
/* dark mode */
|
|
190
|
-
'@apply dark:border-transparent': {},
|
|
191
|
-
'@apply dark:text-neutral-100 dark:bg-neutral-700': {},
|
|
192
|
-
/* dark hover */
|
|
193
|
-
'@apply dark:hover:bg-neutral-600': {},
|
|
194
|
-
/* dark focus */
|
|
195
|
-
'@apply dark:focus-visible:border-primary-500': {},
|
|
196
|
-
/* dark active */
|
|
197
|
-
'@apply dark:active:bg-neutral-600': {},
|
|
198
|
-
|
|
199
|
-
...colors.reduce(
|
|
200
|
-
(styles, color) => ({
|
|
201
|
-
...styles,
|
|
202
|
-
[`&[data-color="${color}"]`]: {
|
|
203
|
-
[`@apply text-${color}-600 bg-${color}-50`]: {},
|
|
204
|
-
/* hover */
|
|
205
|
-
[`@apply hover:bg-${color}-100`]: {},
|
|
206
|
-
/* focus */
|
|
207
|
-
[`@apply focus-visible:border-${color}-500`]: {},
|
|
208
|
-
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
209
|
-
/* active */
|
|
210
|
-
[`@apply active:bg-${color}-200`]: {},
|
|
211
|
-
/* dark mode */
|
|
212
|
-
[`@apply dark:text-${color}-300 dark:bg-${color}-500`]: {},
|
|
213
|
-
[`@apply dark:bg-opacity-15`]: {},
|
|
214
|
-
/* dark hover */
|
|
215
|
-
[`@apply dark:hover:bg-${color}-500`]: {},
|
|
216
|
-
[`@apply dark:hover:bg-opacity-25`]: {},
|
|
217
|
-
/* dark focus */
|
|
218
|
-
[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
219
|
-
[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
220
|
-
/* dark active */
|
|
221
|
-
[`@apply dark:active:bg-${color}-500`]: {},
|
|
222
|
-
[`@apply dark:active:bg-opacity-30`]: {},
|
|
223
|
-
},
|
|
224
|
-
}),
|
|
225
|
-
{}
|
|
226
|
-
),
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function buttonLink(colors) {
|
|
232
|
-
return {
|
|
233
|
-
'&-link': {
|
|
234
|
-
'@apply h-auto p-0 leading-normal text-neutral-600 hover:underline active:text-neutral-700': {},
|
|
235
|
-
'@apply focus-visible:z-base focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
236
|
-
// dark colors
|
|
237
|
-
'@apply dark:text-neutral-200': {},
|
|
238
|
-
'@apply dark:active:text-neutral-500': {},
|
|
239
|
-
|
|
240
|
-
...colors.reduce(
|
|
241
|
-
(styles, color) => ({
|
|
242
|
-
...styles,
|
|
243
|
-
[`&[data-color="${color}"]`]: {
|
|
244
|
-
[`@apply text-${color}-600 active:text-${color}-700`]: {},
|
|
245
|
-
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
246
|
-
// dark colors
|
|
247
|
-
[`@apply dark:text-${color}-200`]: {},
|
|
248
|
-
[`@apply dark:active:text-${color}-500`]: {},
|
|
249
|
-
},
|
|
250
|
-
}),
|
|
251
|
-
{}
|
|
252
|
-
),
|
|
253
|
-
},
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
module.exports = Button = (colors) => ({
|
|
258
|
-
'.btn': {
|
|
259
|
-
'@apply relative': {},
|
|
260
|
-
'@apply m-0': {},
|
|
261
|
-
'@apply rounded-lg inline-flex items-center justify-center flex-shrink-0 align-middle': {},
|
|
262
|
-
'@apply font-medium leading-tight': {},
|
|
263
|
-
transitionProperty: 'background-color, border-color, color, fill, stroke, box-shadow',
|
|
264
|
-
'@apply duration-75 ease-out': {},
|
|
265
|
-
'@apply outline-none appearance-none cursor-base select-none whitespace-nowrap': {},
|
|
266
|
-
'@apply focus-visible:outline-none': {},
|
|
267
|
-
|
|
268
|
-
padding: '1.2rem 3.2rem',
|
|
269
|
-
|
|
270
|
-
"&[data-rounded='true']": {
|
|
271
|
-
borderRadius: '3.2rem',
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
// sizing
|
|
275
|
-
'&-sm': {
|
|
276
|
-
'@apply text-xs': {},
|
|
277
|
-
// minWidth: "1.75rem",
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
'&-md': {
|
|
281
|
-
'@apply text-sm': {},
|
|
282
|
-
// minWidth: "2rem",
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
'&-lg': {
|
|
286
|
-
'@apply text-base': {},
|
|
287
|
-
// minWidth: "2.5rem",
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
// State
|
|
291
|
-
|
|
292
|
-
'&-disabled': {
|
|
293
|
-
'@apply disabled:shadow-none disabled:cursor-not-allowed': {},
|
|
294
|
-
'@apply disabled:text-gray disabled:bg-gray-light !important': {},
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
// variants
|
|
298
|
-
...buttonSolid(colors),
|
|
299
|
-
...buttonOutline(colors),
|
|
300
|
-
//...buttonGhost(colors),
|
|
301
|
-
//...buttonLight(colors),
|
|
302
|
-
...buttonLink(colors),
|
|
303
|
-
},
|
|
304
|
-
});
|
|
1
|
+
function buttonSolid(colors) {
|
|
2
|
+
return {
|
|
3
|
+
'&-solid': {
|
|
4
|
+
//"@apply text-": {},
|
|
5
|
+
'@apply font-semibold border border-gray-stroke': {},
|
|
6
|
+
'@apply text-body bg-white': {},
|
|
7
|
+
/* hover */
|
|
8
|
+
'@apply hover:text-white hover:bg-hover hover:border-primary-active': {},
|
|
9
|
+
/* focus */
|
|
10
|
+
'@apply focus-visible:z-base': {},
|
|
11
|
+
'@apply focus-visible:border-primary': {},
|
|
12
|
+
'@apply focus-visible:ring-4 focus-visible:ring-black': {},
|
|
13
|
+
/* active */
|
|
14
|
+
'@apply active:bg-hover active:text-white': {},
|
|
15
|
+
|
|
16
|
+
/* dark mode */
|
|
17
|
+
'@apply dark:border-neutral-600': {},
|
|
18
|
+
'@apply dark:text-neutral-100 dark:bg-neutral-700': {},
|
|
19
|
+
/* dark hover */
|
|
20
|
+
'@apply dark:hover:border-hover dark:hover:bg-neutral-600': {},
|
|
21
|
+
/* dark focus */
|
|
22
|
+
'@apply dark:focus-visible:border-primary-500': {},
|
|
23
|
+
/* dark active */
|
|
24
|
+
'@apply dark:active:bg-neutral-900 dark:active:border-neutral-600': {},
|
|
25
|
+
|
|
26
|
+
...colors.reduce(
|
|
27
|
+
(styles, color) => ({
|
|
28
|
+
...styles,
|
|
29
|
+
[`&[data-color="${color}"]`]: {
|
|
30
|
+
//[`@apply border-${color}`]: {},
|
|
31
|
+
[`@apply text-white bg-${color}`]: {},
|
|
32
|
+
// hover
|
|
33
|
+
[`@apply hover:text-white hover:bg-${color}-active`]: {},
|
|
34
|
+
|
|
35
|
+
[`@apply active:text-white active:bg-${color}-active`]: {},
|
|
36
|
+
[`@apply focus-visible:ring-4 focus-visible:ring-black`]: {},
|
|
37
|
+
|
|
38
|
+
// focus
|
|
39
|
+
//[`@apply focus-visible:bg-${color}-700`]: {},
|
|
40
|
+
//[`@apply focus-visible:border-${color}-500`]: {},
|
|
41
|
+
//[`@apply focus-visible:ring-${color}-500`]: {},
|
|
42
|
+
// active
|
|
43
|
+
//[`@apply active:bg-${color}-600`]: {},
|
|
44
|
+
// dark mode
|
|
45
|
+
//[`@apply dark:border-${color}-500`]: {},
|
|
46
|
+
//[`@apply dark:bg-${color}-600`]: {},
|
|
47
|
+
// dark hover
|
|
48
|
+
//[`@apply dark:hover:border-${color}-400 dark:hover:bg-${color}-500`]: {},
|
|
49
|
+
// dark focus
|
|
50
|
+
//[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
51
|
+
//[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
52
|
+
// dark active
|
|
53
|
+
//[`@apply dark:active:bg-${color}-800 dark:active:border-${color}-600`]: {},
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
{}
|
|
57
|
+
),
|
|
58
|
+
|
|
59
|
+
"&[data-color='primary']": {
|
|
60
|
+
'@apply border-primary hover:border-primary-active': {},
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
'&.btn': {
|
|
64
|
+
'&-disabled': {
|
|
65
|
+
'@apply disabled:border-gray-stroke hover:border-gray-stroke': {},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function buttonOutline(colors) {
|
|
73
|
+
return {
|
|
74
|
+
'&-outline': {
|
|
75
|
+
'@apply font-semibold border border-gray-stroke': {},
|
|
76
|
+
'@apply text-body bg-transparent': {},
|
|
77
|
+
/* hover */
|
|
78
|
+
'@apply hover:text-white hover:bg-primary-active hover:border-primary-active': {},
|
|
79
|
+
/* focus */
|
|
80
|
+
'@apply focus-visible:z-base': {},
|
|
81
|
+
'@apply focus-visible:border-primary-500': {},
|
|
82
|
+
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
83
|
+
/* active */
|
|
84
|
+
'@apply active:bg-neutral-200': {},
|
|
85
|
+
/* dark mode */
|
|
86
|
+
'@apply dark:border-neutral-600': {},
|
|
87
|
+
'@apply dark:text-neutral-100 dark:bg-transparent': {},
|
|
88
|
+
/* dark hover */
|
|
89
|
+
'@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700': {},
|
|
90
|
+
/* dark focus */
|
|
91
|
+
'@apply dark:focus-visible:border-primary-500': {},
|
|
92
|
+
/* dark active */
|
|
93
|
+
'@apply dark:active:bg-neutral-600 dark:active:border-neutral-600': {},
|
|
94
|
+
|
|
95
|
+
...colors.reduce(
|
|
96
|
+
(styles, color) => ({
|
|
97
|
+
...styles,
|
|
98
|
+
[`&[data-color="${color}"]`]: {
|
|
99
|
+
[`@apply border-current`]: {},
|
|
100
|
+
[`@apply text-${color}-600 bg-transparent`]: {},
|
|
101
|
+
/* hover */
|
|
102
|
+
[`@apply hover:text-white hover:bg-${color}-active hover:border-${color}-active`]: {},
|
|
103
|
+
/* focus */
|
|
104
|
+
[`@apply focus-visible:border-${color}-500`]: {},
|
|
105
|
+
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
106
|
+
/* active */
|
|
107
|
+
[`@apply active:bg-${color}-100`]: {},
|
|
108
|
+
/* dark mode */
|
|
109
|
+
[`@apply dark:border-${color}-200`]: {},
|
|
110
|
+
[`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
|
|
111
|
+
[`@apply dark:border-${color}-300`]: {},
|
|
112
|
+
/* dark hover */
|
|
113
|
+
[`@apply dark:hover:bg-${color}-200`]: {},
|
|
114
|
+
[`@apply dark:hover:bg-opacity-15`]: {},
|
|
115
|
+
/* dark focus */
|
|
116
|
+
[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
117
|
+
[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
118
|
+
/* dark active */
|
|
119
|
+
[`@apply dark:active:bg-${color}-200`]: {},
|
|
120
|
+
[`@apply dark:active:bg-opacity-25`]: {},
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
{}
|
|
124
|
+
),
|
|
125
|
+
|
|
126
|
+
'&.btn': {
|
|
127
|
+
'&-disabled': {
|
|
128
|
+
'@apply disabled:border-gray-stroke hover:border-gray-stroke': {},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function buttonGhost(colors) {
|
|
136
|
+
return {
|
|
137
|
+
'&-ghost': {
|
|
138
|
+
'@apply text-body bg-transparent': {},
|
|
139
|
+
'@apply hover:bg-neutral-100': {},
|
|
140
|
+
/* focus */
|
|
141
|
+
'@apply focus-visible:z-base': {},
|
|
142
|
+
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
143
|
+
/* active */
|
|
144
|
+
'@apply active:bg-neutral-200': {},
|
|
145
|
+
/* dark mode */
|
|
146
|
+
'@apply dark:text-neutral-100 dark:bg-transparent': {},
|
|
147
|
+
/* dark hover */
|
|
148
|
+
'@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700': {},
|
|
149
|
+
/* dark active */
|
|
150
|
+
'@apply dark:active:bg-neutral-600 dark:active:border-neutral-400': {},
|
|
151
|
+
|
|
152
|
+
...colors.reduce(
|
|
153
|
+
(styles, color) => ({
|
|
154
|
+
...styles,
|
|
155
|
+
[`&[data-color="${color}"]`]: {
|
|
156
|
+
[`@apply text-${color}-600`]: {},
|
|
157
|
+
[`@apply hover:bg-${color}-50`]: {},
|
|
158
|
+
/* focus */
|
|
159
|
+
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
160
|
+
[`@apply active:bg-${color}-100`]: {},
|
|
161
|
+
// dark colors
|
|
162
|
+
[`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
|
|
163
|
+
[`@apply dark:border-${color}-300 dark:hover:bg-${color}-200`]: {},
|
|
164
|
+
[`@apply dark:hover:bg-opacity-15`]: {},
|
|
165
|
+
[`@apply dark:active:bg-${color}-200`]: {},
|
|
166
|
+
[`@apply dark:active:bg-opacity-25`]: {},
|
|
167
|
+
},
|
|
168
|
+
}),
|
|
169
|
+
{}
|
|
170
|
+
),
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function buttonLight(colors) {
|
|
176
|
+
return {
|
|
177
|
+
'&-light': {
|
|
178
|
+
'@apply shadow-sm': {},
|
|
179
|
+
'@apply border border-transparent': {},
|
|
180
|
+
'@apply text-body bg-neutral-100': {},
|
|
181
|
+
/* hover */
|
|
182
|
+
'@apply hover:bg-neutral-200': {},
|
|
183
|
+
/* focus */
|
|
184
|
+
'@apply focus-visible:z-base': {},
|
|
185
|
+
'@apply focus-visible:border-primary-500': {},
|
|
186
|
+
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
187
|
+
/* active */
|
|
188
|
+
'@apply active:bg-neutral-300': {},
|
|
189
|
+
/* dark mode */
|
|
190
|
+
'@apply dark:border-transparent': {},
|
|
191
|
+
'@apply dark:text-neutral-100 dark:bg-neutral-700': {},
|
|
192
|
+
/* dark hover */
|
|
193
|
+
'@apply dark:hover:bg-neutral-600': {},
|
|
194
|
+
/* dark focus */
|
|
195
|
+
'@apply dark:focus-visible:border-primary-500': {},
|
|
196
|
+
/* dark active */
|
|
197
|
+
'@apply dark:active:bg-neutral-600': {},
|
|
198
|
+
|
|
199
|
+
...colors.reduce(
|
|
200
|
+
(styles, color) => ({
|
|
201
|
+
...styles,
|
|
202
|
+
[`&[data-color="${color}"]`]: {
|
|
203
|
+
[`@apply text-${color}-600 bg-${color}-50`]: {},
|
|
204
|
+
/* hover */
|
|
205
|
+
[`@apply hover:bg-${color}-100`]: {},
|
|
206
|
+
/* focus */
|
|
207
|
+
[`@apply focus-visible:border-${color}-500`]: {},
|
|
208
|
+
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
209
|
+
/* active */
|
|
210
|
+
[`@apply active:bg-${color}-200`]: {},
|
|
211
|
+
/* dark mode */
|
|
212
|
+
[`@apply dark:text-${color}-300 dark:bg-${color}-500`]: {},
|
|
213
|
+
[`@apply dark:bg-opacity-15`]: {},
|
|
214
|
+
/* dark hover */
|
|
215
|
+
[`@apply dark:hover:bg-${color}-500`]: {},
|
|
216
|
+
[`@apply dark:hover:bg-opacity-25`]: {},
|
|
217
|
+
/* dark focus */
|
|
218
|
+
[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
219
|
+
[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
220
|
+
/* dark active */
|
|
221
|
+
[`@apply dark:active:bg-${color}-500`]: {},
|
|
222
|
+
[`@apply dark:active:bg-opacity-30`]: {},
|
|
223
|
+
},
|
|
224
|
+
}),
|
|
225
|
+
{}
|
|
226
|
+
),
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function buttonLink(colors) {
|
|
232
|
+
return {
|
|
233
|
+
'&-link': {
|
|
234
|
+
'@apply h-auto p-0 leading-normal text-neutral-600 hover:underline active:text-neutral-700': {},
|
|
235
|
+
'@apply focus-visible:z-base focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
236
|
+
// dark colors
|
|
237
|
+
'@apply dark:text-neutral-200': {},
|
|
238
|
+
'@apply dark:active:text-neutral-500': {},
|
|
239
|
+
|
|
240
|
+
...colors.reduce(
|
|
241
|
+
(styles, color) => ({
|
|
242
|
+
...styles,
|
|
243
|
+
[`&[data-color="${color}"]`]: {
|
|
244
|
+
[`@apply text-${color}-600 active:text-${color}-700`]: {},
|
|
245
|
+
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
246
|
+
// dark colors
|
|
247
|
+
[`@apply dark:text-${color}-200`]: {},
|
|
248
|
+
[`@apply dark:active:text-${color}-500`]: {},
|
|
249
|
+
},
|
|
250
|
+
}),
|
|
251
|
+
{}
|
|
252
|
+
),
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
module.exports = Button = (colors) => ({
|
|
258
|
+
'.btn': {
|
|
259
|
+
'@apply relative': {},
|
|
260
|
+
'@apply m-0': {},
|
|
261
|
+
'@apply rounded-lg inline-flex items-center justify-center flex-shrink-0 align-middle': {},
|
|
262
|
+
'@apply font-medium leading-tight': {},
|
|
263
|
+
transitionProperty: 'background-color, border-color, color, fill, stroke, box-shadow',
|
|
264
|
+
'@apply duration-75 ease-out': {},
|
|
265
|
+
'@apply outline-none appearance-none cursor-base select-none whitespace-nowrap': {},
|
|
266
|
+
'@apply focus-visible:outline-none': {},
|
|
267
|
+
|
|
268
|
+
padding: '1.2rem 3.2rem',
|
|
269
|
+
|
|
270
|
+
"&[data-rounded='true']": {
|
|
271
|
+
borderRadius: '3.2rem',
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
// sizing
|
|
275
|
+
'&-sm': {
|
|
276
|
+
'@apply text-xs': {},
|
|
277
|
+
// minWidth: "1.75rem",
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
'&-md': {
|
|
281
|
+
'@apply text-sm': {},
|
|
282
|
+
// minWidth: "2rem",
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
'&-lg': {
|
|
286
|
+
'@apply text-base': {},
|
|
287
|
+
// minWidth: "2.5rem",
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
// State
|
|
291
|
+
|
|
292
|
+
'&-disabled': {
|
|
293
|
+
'@apply disabled:shadow-none disabled:cursor-not-allowed': {},
|
|
294
|
+
'@apply disabled:text-gray disabled:bg-gray-light !important': {},
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
// variants
|
|
298
|
+
...buttonSolid(colors),
|
|
299
|
+
...buttonOutline(colors),
|
|
300
|
+
//...buttonGhost(colors),
|
|
301
|
+
//...buttonLight(colors),
|
|
302
|
+
...buttonLink(colors),
|
|
303
|
+
},
|
|
304
|
+
});
|