revotech-ui-kit 0.0.2 → 0.0.3-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/deploy-storybook.yml +107 -0
- package/.storybook/main.ts +3 -3
- package/assume_role.sh +18 -0
- package/dist/183c6c38.js +1 -0
- package/dist/f28fd4b1.js +1 -0
- package/dist/index.ts +1 -0
- package/dist/public/globals.css +2215 -0
- package/dist/public/tailwind-lib.css +115 -0
- package/dist/src/assets/icons/arrows.icon.js +20 -0
- package/dist/src/assets/icons/arrows.icon.js.map +1 -0
- package/dist/src/assets/icons/index.js +4 -0
- package/dist/src/assets/icons/index.js.map +1 -0
- package/dist/src/assets/icons/search.icon.js +19 -0
- package/dist/src/assets/icons/search.icon.js.map +1 -0
- package/dist/src/assets/icons/tick.icon.js +20 -0
- package/dist/src/assets/icons/tick.icon.js.map +1 -0
- package/dist/src/components/atoms/alert/alert-description.js +18 -0
- package/dist/src/components/atoms/alert/alert-description.js.map +1 -0
- package/dist/src/components/atoms/alert/alert-title.js +20 -0
- package/dist/src/components/atoms/alert/alert-title.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.atom.js +55 -0
- package/dist/src/components/atoms/alert/alert.atom.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.stories.js +62 -0
- package/dist/src/components/atoms/alert/alert.stories.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.styles.js +21 -0
- package/dist/src/components/atoms/alert/alert.styles.js.map +1 -0
- package/dist/src/components/atoms/alert/alert.types.js +2 -0
- package/dist/src/components/atoms/alert/alert.types.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.atom.js +43 -0
- package/dist/src/components/atoms/badge/badge.atom.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.stories.js +110 -0
- package/dist/src/components/atoms/badge/badge.stories.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.style.js +17 -0
- package/dist/src/components/atoms/badge/badge.style.js.map +1 -0
- package/dist/src/components/atoms/badge/badge.type.js +2 -0
- package/dist/src/components/atoms/badge/badge.type.js.map +1 -0
- package/dist/src/components/atoms/button/button.atom.js +67 -0
- package/dist/src/components/atoms/button/button.atom.js.map +1 -0
- package/dist/src/components/atoms/button/button.stories.js +204 -0
- package/dist/src/components/atoms/button/button.stories.js.map +1 -0
- package/dist/src/components/atoms/button/button.style.js +24 -0
- package/dist/src/components/atoms/button/button.style.js.map +1 -0
- package/dist/src/components/atoms/button/button.type.js +2 -0
- package/dist/src/components/atoms/button/button.type.js.map +1 -0
- package/dist/src/components/atoms/card/card-content.js +17 -0
- package/dist/src/components/atoms/card/card-content.js.map +1 -0
- package/dist/src/components/atoms/card/card-description.js +17 -0
- package/dist/src/components/atoms/card/card-description.js.map +1 -0
- package/dist/src/components/atoms/card/card-footer.js +17 -0
- package/dist/src/components/atoms/card/card-footer.js.map +1 -0
- package/dist/src/components/atoms/card/card-header.js +17 -0
- package/dist/src/components/atoms/card/card-header.js.map +1 -0
- package/dist/src/components/atoms/card/card-title.js +17 -0
- package/dist/src/components/atoms/card/card-title.js.map +1 -0
- package/dist/src/components/atoms/card/card.atom.js +25 -0
- package/dist/src/components/atoms/card/card.atom.js.map +1 -0
- package/dist/src/components/atoms/card/card.stories.js +136 -0
- package/dist/src/components/atoms/card/card.stories.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.atom.js +87 -0
- package/dist/src/components/atoms/checkbox/checkbox.atom.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.stories.js +244 -0
- package/dist/src/components/atoms/checkbox/checkbox.stories.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.style.js +3 -0
- package/dist/src/components/atoms/checkbox/checkbox.style.js.map +1 -0
- package/dist/src/components/atoms/checkbox/checkbox.type.js +2 -0
- package/dist/src/components/atoms/checkbox/checkbox.type.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box-input.js +47 -0
- package/dist/src/components/atoms/combo-box/combo-box-input.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box-item.js +85 -0
- package/dist/src/components/atoms/combo-box/combo-box-item.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box-list.js +67 -0
- package/dist/src/components/atoms/combo-box/combo-box-list.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box.atom.js +199 -0
- package/dist/src/components/atoms/combo-box/combo-box.atom.js.map +1 -0
- package/dist/src/components/atoms/combo-box/combo-box.stories.js +86 -0
- package/dist/src/components/atoms/combo-box/combo-box.stories.js.map +1 -0
- package/dist/src/components/atoms/command-empty/command-empty.atom.js +54 -0
- package/dist/src/components/atoms/command-empty/command-empty.atom.js.map +1 -0
- package/dist/src/components/atoms/command-group/command-group.atom.js +71 -0
- package/dist/src/components/atoms/command-group/command-group.atom.js.map +1 -0
- package/dist/src/components/atoms/command-item/command-item.atom.js +80 -0
- package/dist/src/components/atoms/command-item/command-item.atom.js.map +1 -0
- package/dist/src/components/atoms/command-list/command-list.atom.js +36 -0
- package/dist/src/components/atoms/command-list/command-list.atom.js.map +1 -0
- package/dist/src/components/atoms/command-separator/command-separator.atom.js +52 -0
- package/dist/src/components/atoms/command-separator/command-separator.atom.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-close.js +47 -0
- package/dist/src/components/atoms/dialog/dialog-close.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-content.js +72 -0
- package/dist/src/components/atoms/dialog/dialog-content.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-footer.js +22 -0
- package/dist/src/components/atoms/dialog/dialog-footer.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-header.js +40 -0
- package/dist/src/components/atoms/dialog/dialog-header.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-overly.js +20 -0
- package/dist/src/components/atoms/dialog/dialog-overly.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog-trigger.js +54 -0
- package/dist/src/components/atoms/dialog/dialog-trigger.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog.atom.js +79 -0
- package/dist/src/components/atoms/dialog/dialog.atom.js.map +1 -0
- package/dist/src/components/atoms/dialog/dialog.stories.js +88 -0
- package/dist/src/components/atoms/dialog/dialog.stories.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js +117 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js +81 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-content.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js +71 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-group.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js +80 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-item.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js +118 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js +52 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-seperator.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js +20 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js +79 -0
- package/dist/src/components/atoms/dropdownMenu/dropdown-menu.atom.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js +211 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.stories.js.map +1 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js +4 -0
- package/dist/src/components/atoms/dropdownMenu/dropdownMenu.style.js.map +1 -0
- package/dist/src/components/atoms/index.js +14 -0
- package/dist/src/components/atoms/index.js.map +1 -0
- package/dist/src/components/atoms/input/input.atom.js +93 -0
- package/dist/src/components/atoms/input/input.atom.js.map +1 -0
- package/dist/src/components/atoms/input/input.stories.js +382 -0
- package/dist/src/components/atoms/input/input.stories.js.map +1 -0
- package/dist/src/components/atoms/input/input.styles.js +2 -0
- package/dist/src/components/atoms/input/input.styles.js.map +1 -0
- package/dist/src/components/atoms/input/input.type.js +2 -0
- package/dist/src/components/atoms/input/input.type.js.map +1 -0
- package/dist/src/components/atoms/label/label.atom.js +68 -0
- package/dist/src/components/atoms/label/label.atom.js.map +1 -0
- package/dist/src/components/atoms/label/label.stories.js +85 -0
- package/dist/src/components/atoms/label/label.stories.js.map +1 -0
- package/dist/src/components/atoms/label/label.style.js +3 -0
- package/dist/src/components/atoms/label/label.style.js.map +1 -0
- package/dist/src/components/atoms/popover/popover-content.js +64 -0
- package/dist/src/components/atoms/popover/popover-content.js.map +1 -0
- package/dist/src/components/atoms/popover/popover-trigger.js +51 -0
- package/dist/src/components/atoms/popover/popover-trigger.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.atom.js +40 -0
- package/dist/src/components/atoms/popover/popover.atom.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.stories.js +69 -0
- package/dist/src/components/atoms/popover/popover.stories.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.style.js +21 -0
- package/dist/src/components/atoms/popover/popover.style.js.map +1 -0
- package/dist/src/components/atoms/popover/popover.types.js +4 -0
- package/dist/src/components/atoms/popover/popover.types.js.map +1 -0
- package/dist/src/components/atoms/toggle/defs.js +30 -0
- package/dist/src/components/atoms/toggle/defs.js.map +1 -0
- package/dist/src/components/atoms/toggle/toggle.atom.js +72 -0
- package/dist/src/components/atoms/toggle/toggle.atom.js.map +1 -0
- package/dist/src/components/atoms/toggle/toggle.stories.js +189 -0
- package/dist/src/components/atoms/toggle/toggle.stories.js.map +1 -0
- package/dist/src/components/atoms/toggle/toggle.style.js +19 -0
- package/dist/src/components/atoms/toggle/toggle.style.js.map +1 -0
- package/dist/src/components/command/command.js +410 -0
- package/dist/src/components/command/command.js.map +1 -0
- package/dist/src/components/command/command.stories.js +153 -0
- package/dist/src/components/command/command.stories.js.map +1 -0
- package/dist/src/components/index.js +3 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/molecules/command/command.molecules.js +27 -0
- package/dist/src/components/molecules/command/command.molecules.js.map +1 -0
- package/dist/src/components/molecules/command-input/command-input.atom.js +127 -0
- package/dist/src/components/molecules/command-input/command-input.atom.js.map +1 -0
- package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js +2 -0
- package/dist/src/components/molecules/dropdownMenu/dropdownMenu.molecules.js.map +1 -0
- package/dist/src/components/molecules/index.js +2 -0
- package/dist/src/components/molecules/index.js.map +1 -0
- package/dist/src/helpers/base-element.js +64 -0
- package/dist/src/helpers/base-element.js.map +1 -0
- package/dist/src/helpers/index.js +4 -0
- package/dist/src/helpers/index.js.map +1 -0
- package/dist/src/helpers/mouse-conroller.helper.js +33 -0
- package/dist/src/helpers/mouse-conroller.helper.js.map +1 -0
- package/dist/src/helpers/style.helpers.js +6 -0
- package/dist/src/helpers/style.helpers.js.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/actionable.interface.js +2 -0
- package/dist/src/interfaces/actionable.interface.js.map +1 -0
- package/dist/src/interfaces/atomic.interface.js +2 -0
- package/dist/src/interfaces/atomic.interface.js.map +1 -0
- package/dist/src/interfaces/changeable.interface.js +2 -0
- package/dist/src/interfaces/changeable.interface.js.map +1 -0
- package/dist/src/interfaces/child-support-atomic.interface.js +2 -0
- package/dist/src/interfaces/child-support-atomic.interface.js.map +1 -0
- package/dist/src/interfaces/index.js +7 -0
- package/dist/src/interfaces/index.js.map +1 -0
- package/dist/src/interfaces/intractable.interface.js +2 -0
- package/dist/src/interfaces/intractable.interface.js.map +1 -0
- package/dist/src/interfaces/variant.interface.js +2 -0
- package/dist/src/interfaces/variant.interface.js.map +1 -0
- package/dist/src/lib/index.js +2 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/next/next.lib.js +2 -0
- package/dist/src/lib/next/next.lib.js.map +1 -0
- package/dist/src/lib/react/react.lib.js +16 -0
- package/dist/src/lib/react/react.lib.js.map +1 -0
- package/dist/src/lib/tw-styles.js +1956 -0
- package/dist/src/lib/tw-styles.js.map +1 -0
- package/dist/src/styles/index.js +2 -0
- package/dist/src/styles/index.js.map +1 -0
- package/dist/src/styles/tw.styles.js +2218 -0
- package/dist/src/styles/tw.styles.js.map +1 -0
- package/dist/src/wc-ui-app.js +88 -0
- package/dist/src/wc-ui-app.js.map +1 -0
- package/dist/sw.js +2 -0
- package/dist/sw.js.map +1 -0
- package/dist/test/wc-ui-app.test.js +18 -0
- package/dist/test/wc-ui-app.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/workbox-a523fd56.js +2 -0
- package/dist/workbox-a523fd56.js.map +1 -0
- package/index.html +18 -66
- package/package.json +41 -18
- package/rollup.config.js +25 -13
- package/src/assets/icons/arrows.icon.ts +20 -0
- package/src/assets/icons/index.ts +3 -0
- package/src/assets/icons/search.icon.ts +19 -0
- package/src/assets/icons/tick.icon.ts +20 -0
- package/src/chai-custom.d.ts +0 -0
- package/src/components/atoms/alert/alert-description.ts +15 -0
- package/src/components/atoms/alert/alert-title.ts +17 -0
- package/src/components/atoms/alert/alert.atom.ts +51 -0
- package/src/components/atoms/alert/alert.stories.ts +71 -0
- package/src/components/atoms/alert/alert.styles.ts +21 -0
- package/src/components/atoms/alert/alert.types.ts +1 -0
- package/src/components/atoms/badge/badge.atom.ts +40 -0
- package/src/components/atoms/badge/badge.stories.ts +118 -0
- package/src/components/atoms/badge/badge.style.ts +24 -0
- package/src/components/atoms/badge/badge.type.ts +7 -0
- package/src/components/atoms/button/button.atom.ts +22 -8
- package/src/components/atoms/button/button.stories.ts +177 -139
- package/src/components/atoms/card/card-content.ts +15 -0
- package/src/components/atoms/card/card-description.ts +15 -0
- package/src/components/atoms/card/card-footer.ts +15 -0
- package/src/components/atoms/card/card-header.ts +15 -0
- package/src/components/atoms/card/card-title.ts +15 -0
- package/src/components/atoms/card/card.atom.ts +31 -0
- package/src/components/atoms/card/card.stories.ts +149 -0
- package/src/components/atoms/checkbox/checkbox.atom.ts +30 -16
- package/src/components/atoms/checkbox/checkbox.stories.ts +292 -25
- package/src/components/atoms/checkbox/checkbox.style.ts +5 -0
- package/src/components/atoms/checkbox/checkbox.type.ts +24 -0
- package/src/components/atoms/combo-box/combo-box-input.ts +33 -0
- package/src/components/atoms/combo-box/combo-box-item.ts +59 -0
- package/src/components/atoms/combo-box/combo-box-list.ts +57 -0
- package/src/components/atoms/combo-box/combo-box.atom.ts +187 -0
- package/src/components/atoms/combo-box/combo-box.stories.ts +95 -0
- package/src/components/atoms/command-empty/command-empty.atom.ts +2 -2
- package/src/components/atoms/command-group/command-group.atom.ts +1 -1
- package/src/components/atoms/command-item/command-item.atom.ts +2 -2
- package/src/components/atoms/command-list/command-list.atom.ts +2 -2
- package/src/components/atoms/command-separator/command-separator.atom.ts +2 -2
- package/src/components/atoms/dialog/dialog-close.ts +50 -0
- package/src/components/atoms/dialog/dialog-content.ts +71 -0
- package/src/components/atoms/dialog/dialog-footer.ts +22 -0
- package/src/components/atoms/dialog/dialog-header.ts +36 -0
- package/src/components/atoms/dialog/dialog-overly.ts +20 -0
- package/src/components/atoms/dialog/dialog-trigger.ts +54 -0
- package/src/components/atoms/dialog/dialog.atom.ts +3 -226
- package/src/components/atoms/dialog/dialog.stories.ts +11 -4
- package/src/components/atoms/dropdownMenu/dropdown-menu-checkbox-Item.ts +106 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu-content.ts +79 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu-group.ts +60 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu-item.ts +74 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu-radio-item.ts +107 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu-seperator.ts +44 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu-shortcut.ts +17 -0
- package/src/components/atoms/dropdownMenu/dropdown-menu.atom.ts +84 -0
- package/src/components/atoms/dropdownMenu/dropdownMenu.stories.ts +220 -0
- package/src/components/atoms/dropdownMenu/dropdownMenu.style.ts +7 -0
- package/src/components/atoms/index.ts +3 -0
- package/src/components/atoms/input/input.atom.ts +64 -10
- package/src/components/atoms/input/input.stories.ts +426 -64
- package/src/components/atoms/input/input.styles.ts +2 -0
- package/src/components/atoms/input/input.type.ts +42 -8
- package/src/components/atoms/label/label.atom.ts +31 -7
- package/src/components/atoms/label/label.stories.ts +87 -3
- package/src/components/atoms/popover/popover-content.ts +58 -0
- package/src/components/atoms/popover/popover-trigger.ts +50 -0
- package/src/components/atoms/popover/popover.atom.ts +34 -0
- package/src/components/atoms/popover/popover.stories.ts +79 -0
- package/src/components/atoms/popover/popover.style.ts +25 -0
- package/src/components/atoms/popover/popover.types.ts +3 -0
- package/src/components/atoms/toggle/defs.ts +29 -0
- package/src/components/atoms/toggle/toggle.atom.ts +58 -0
- package/src/components/atoms/toggle/toggle.stories.ts +204 -0
- package/src/components/atoms/toggle/toggle.style.ts +22 -0
- package/src/components/molecules/command/command.molecules.ts +2 -2
- package/src/components/molecules/command-input/command-input.atom.ts +3 -3
- package/src/components/molecules/dropdownMenu/dropdownMenu.molecules.ts +0 -0
- package/src/globals.css +475 -66
- package/src/helpers/base-element.ts +79 -0
- package/src/helpers/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/lib/react/react.lib.ts +18 -0
- package/src/lib/tw-styles.ts +1957 -0
- package/src/styles/tw.styles.ts +2051 -1699
- package/src/tailwind-lib.css +26 -6
- package/tailwind.config.js +174 -38
- package/tsconfig.json +6 -1
- package/src/components/popover.ts +0 -247
package/src/tailwind-lib.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
@font-face {
|
2
|
-
font-family:
|
2
|
+
font-family: 'GeistSans';
|
3
3
|
src: url('assets/fonts/Geist/Geist-Regular.woff2') format('woff2');
|
4
4
|
}
|
5
5
|
|
@@ -7,8 +7,6 @@
|
|
7
7
|
@tailwind components;
|
8
8
|
@tailwind utilities;
|
9
9
|
|
10
|
-
|
11
|
-
|
12
10
|
@layer base {
|
13
11
|
:root {
|
14
12
|
--background: 0 0% 100%;
|
@@ -31,6 +29,18 @@
|
|
31
29
|
--input: 240 5.9% 90%;
|
32
30
|
--ring: 240 5.9% 10%;
|
33
31
|
--radius: 0.5rem;
|
32
|
+
--green-100: #d4f8e8;
|
33
|
+
--green-200: #bbf7d0;
|
34
|
+
--green-800: #166534;
|
35
|
+
--red-100: #fddddd;
|
36
|
+
--red-200: #fecaca;
|
37
|
+
--red-800: #991b1b;
|
38
|
+
--yellow-100: #fef4d9;
|
39
|
+
--yellow-200: #fef08a;
|
40
|
+
--yellow-800: #854d0e;
|
41
|
+
--blue-100: #dbeafe;
|
42
|
+
--blue-200: #bfdbfe;
|
43
|
+
--blue-800: #1e40af;
|
34
44
|
}
|
35
45
|
|
36
46
|
.dark {
|
@@ -53,10 +63,21 @@
|
|
53
63
|
--border: 240 3.7% 15.9%;
|
54
64
|
--input: 240 3.7% 15.9%;
|
55
65
|
--ring: 240 4.9% 83.9%;
|
66
|
+
--green-100: #d4f8e8;
|
67
|
+
--green-200: #bbf7d0;
|
68
|
+
--green-800: #166534;
|
69
|
+
--red-100: #fddddd;
|
70
|
+
--red-200: #fecaca;
|
71
|
+
--red-800: #991b1b;
|
72
|
+
--yellow-100: #fef4d9;
|
73
|
+
--yellow-200: #fef08a;
|
74
|
+
--yellow-800: #854d0e;
|
75
|
+
--blue-100: #dbeafe;
|
76
|
+
--blue-200: #bfdbfe;
|
77
|
+
--blue-800: #1e40af;
|
56
78
|
}
|
57
79
|
}
|
58
80
|
|
59
|
-
|
60
81
|
@layer base {
|
61
82
|
* {
|
62
83
|
@apply border-border;
|
@@ -73,7 +94,6 @@
|
|
73
94
|
margin-top: 6px;
|
74
95
|
margin-block-start: 6px;
|
75
96
|
} */
|
76
|
-
|
77
97
|
}
|
78
98
|
|
79
99
|
@layer utilities {
|
@@ -92,4 +112,4 @@
|
|
92
112
|
.container {
|
93
113
|
@apply px-4;
|
94
114
|
}
|
95
|
-
}
|
115
|
+
}
|
package/tailwind.config.js
CHANGED
@@ -1,81 +1,217 @@
|
|
1
1
|
/* eslint-disable global-require */
|
2
|
-
const { fontFamily } = require(
|
3
|
-
|
2
|
+
const { fontFamily } = require('tailwindcss/defaultTheme');
|
4
3
|
|
5
4
|
/** @type {import('tailwindcss').Config} */
|
6
5
|
module.exports = {
|
7
|
-
darkMode: [
|
8
|
-
content: [
|
6
|
+
darkMode: ['class'],
|
7
|
+
content: ['src/**/*.{ts,tsx}', 'index.html'],
|
9
8
|
theme: {
|
10
9
|
container: {
|
11
10
|
center: true,
|
12
|
-
padding:
|
11
|
+
padding: '2rem',
|
13
12
|
screens: {
|
14
|
-
|
13
|
+
'2xl': '1400px',
|
15
14
|
},
|
16
15
|
},
|
17
16
|
extend: {
|
17
|
+
transform: {
|
18
|
+
translateY: [
|
19
|
+
'0',
|
20
|
+
'0.25rem',
|
21
|
+
'0.5rem',
|
22
|
+
'0.75rem',
|
23
|
+
'1rem',
|
24
|
+
'1.25rem',
|
25
|
+
'1.5rem',
|
26
|
+
'2rem',
|
27
|
+
],
|
28
|
+
translateX: [
|
29
|
+
'0',
|
30
|
+
'0.25rem',
|
31
|
+
'0.5rem',
|
32
|
+
'0.75rem',
|
33
|
+
'1rem',
|
34
|
+
'1.25rem',
|
35
|
+
'1.5rem',
|
36
|
+
'2rem',
|
37
|
+
],
|
38
|
+
},
|
39
|
+
spacing: {
|
40
|
+
1: '0.25rem',
|
41
|
+
2: '0.5rem',
|
42
|
+
3: '0.75rem',
|
43
|
+
4: '1rem',
|
44
|
+
5: '1.25rem',
|
45
|
+
6: '1.5rem',
|
46
|
+
8: '2rem',
|
47
|
+
10: '2.5rem',
|
48
|
+
12: '3rem',
|
49
|
+
14: '3.5rem',
|
50
|
+
16: '4rem',
|
51
|
+
20: '5rem',
|
52
|
+
24: '6rem',
|
53
|
+
28: '7rem',
|
54
|
+
32: '8rem',
|
55
|
+
36: '9rem',
|
56
|
+
40: '10rem',
|
57
|
+
44: '11rem',
|
58
|
+
48: '12rem',
|
59
|
+
52: '13rem',
|
60
|
+
56: '14rem',
|
61
|
+
60: '15rem',
|
62
|
+
64: '16rem',
|
63
|
+
72: '18rem',
|
64
|
+
80: '20rem',
|
65
|
+
96: '24rem',
|
66
|
+
112: '28rem',
|
67
|
+
128: '32rem',
|
68
|
+
},
|
69
|
+
padding: {
|
70
|
+
0: '0',
|
71
|
+
'1/2': '0.125rem',
|
72
|
+
1: '0.25rem',
|
73
|
+
2: '0.5rem',
|
74
|
+
3: '0.75rem',
|
75
|
+
4: '1rem',
|
76
|
+
5: '1.25rem',
|
77
|
+
6: '1.5rem',
|
78
|
+
8: '2rem',
|
79
|
+
10: '2.5rem',
|
80
|
+
12: '3rem',
|
81
|
+
14: '3.5rem',
|
82
|
+
16: '4rem',
|
83
|
+
20: '5rem',
|
84
|
+
24: '6rem',
|
85
|
+
28: '7rem',
|
86
|
+
32: '8rem',
|
87
|
+
36: '9rem',
|
88
|
+
40: '10rem',
|
89
|
+
44: '11rem',
|
90
|
+
48: '12rem',
|
91
|
+
52: '13rem',
|
92
|
+
56: '14rem',
|
93
|
+
60: '15rem',
|
94
|
+
64: '16rem',
|
95
|
+
72: '18rem',
|
96
|
+
80: '20rem',
|
97
|
+
96: '24rem',
|
98
|
+
112: '28rem',
|
99
|
+
128: '32rem',
|
100
|
+
},
|
101
|
+
margin: {
|
102
|
+
0: '0',
|
103
|
+
'1/2': '0.125rem',
|
104
|
+
1: '0.25rem',
|
105
|
+
2: '0.5rem',
|
106
|
+
3: '0.75rem',
|
107
|
+
4: '1rem',
|
108
|
+
5: '1.25rem',
|
109
|
+
6: '1.5rem',
|
110
|
+
8: '2rem',
|
111
|
+
10: '2.5rem',
|
112
|
+
12: '3rem',
|
113
|
+
14: '3.5rem',
|
114
|
+
16: '4rem',
|
115
|
+
20: '5rem',
|
116
|
+
24: '6rem',
|
117
|
+
28: '7rem',
|
118
|
+
32: '8rem',
|
119
|
+
36: '9rem',
|
120
|
+
40: '10rem',
|
121
|
+
44: '11rem',
|
122
|
+
48: '12rem',
|
123
|
+
52: '13rem',
|
124
|
+
56: '14rem',
|
125
|
+
60: '15rem',
|
126
|
+
64: '16rem',
|
127
|
+
72: '18rem',
|
128
|
+
80: '20rem',
|
129
|
+
96: '24rem',
|
130
|
+
112: '28rem',
|
131
|
+
128: '32rem',
|
132
|
+
},
|
18
133
|
colors: {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
134
|
+
green: {
|
135
|
+
100: 'var(--green-100)',
|
136
|
+
200: 'var(--green-200)',
|
137
|
+
800: 'var(--green-800)',
|
138
|
+
},
|
139
|
+
red: {
|
140
|
+
100: 'var(--red-100)',
|
141
|
+
200: 'var(--red-200)',
|
142
|
+
800: 'var(--red-800)',
|
143
|
+
},
|
144
|
+
yellow: {
|
145
|
+
100: 'var(--yellow-100)',
|
146
|
+
200: 'var(--yellow-200)',
|
147
|
+
800: 'var(--yellow-800)',
|
148
|
+
},
|
149
|
+
blue: {
|
150
|
+
100: 'var(--blue-100)',
|
151
|
+
200: 'var(--blue-200)',
|
152
|
+
800: 'var(--blue-800)',
|
153
|
+
},
|
154
|
+
border: 'hsl(var(--border))',
|
155
|
+
input: 'hsl(var(--input))',
|
156
|
+
ring: 'hsl(var(--ring))',
|
157
|
+
background: 'hsl(var(--background))',
|
158
|
+
foreground: 'hsl(var(--foreground))',
|
24
159
|
primary: {
|
25
|
-
DEFAULT:
|
26
|
-
foreground:
|
160
|
+
DEFAULT: 'hsl(var(--primary))',
|
161
|
+
foreground: 'hsl(var(--primary-foreground))',
|
27
162
|
},
|
28
163
|
secondary: {
|
29
|
-
DEFAULT:
|
30
|
-
foreground:
|
164
|
+
DEFAULT: 'hsl(var(--secondary))',
|
165
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
31
166
|
},
|
32
167
|
destructive: {
|
33
|
-
DEFAULT:
|
34
|
-
foreground:
|
168
|
+
DEFAULT: 'hsl(var(--destructive))',
|
169
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
35
170
|
},
|
36
171
|
muted: {
|
37
|
-
DEFAULT:
|
38
|
-
foreground:
|
172
|
+
DEFAULT: 'hsl(var(--muted))',
|
173
|
+
foreground: 'hsl(var(--muted-foreground))',
|
39
174
|
},
|
40
175
|
accent: {
|
41
|
-
DEFAULT:
|
42
|
-
foreground:
|
176
|
+
DEFAULT: 'hsl(var(--accent))',
|
177
|
+
foreground: 'hsl(var(--accent-foreground))',
|
43
178
|
},
|
44
179
|
popover: {
|
45
|
-
DEFAULT:
|
46
|
-
foreground:
|
180
|
+
DEFAULT: 'hsl(var(--popover))',
|
181
|
+
foreground: 'hsl(var(--popover-foreground))',
|
47
182
|
},
|
48
183
|
card: {
|
49
|
-
DEFAULT:
|
50
|
-
foreground:
|
184
|
+
DEFAULT: 'hsl(var(--card))',
|
185
|
+
foreground: 'hsl(var(--card-foreground))',
|
51
186
|
},
|
52
187
|
},
|
53
188
|
borderRadius: {
|
54
189
|
lg: `var(--radius)`,
|
55
190
|
md: `calc(var(--radius) - 2px)`,
|
56
|
-
sm:
|
191
|
+
sm: 'calc(var(--radius) - 4px)',
|
192
|
+
full: '9999px',
|
57
193
|
},
|
58
194
|
fontFamily: {
|
59
|
-
sans: [
|
60
|
-
geist: [
|
195
|
+
sans: ['var(--font-sans)', ...fontFamily.sans],
|
196
|
+
geist: ['GeistSans', ...fontFamily.sans],
|
61
197
|
// serif: ["var(--font-serif)", ...fontFamily.serif],
|
62
198
|
// mono: ["var(--font-mono)", ...fontFamily.mono],
|
63
199
|
},
|
64
200
|
keyframes: {
|
65
|
-
|
66
|
-
from: { height:
|
67
|
-
to: { height:
|
201
|
+
'accordion-down': {
|
202
|
+
from: { height: '0' },
|
203
|
+
to: { height: 'var(--radix-accordion-content-height)' },
|
68
204
|
},
|
69
|
-
|
70
|
-
from: { height:
|
71
|
-
to: { height:
|
205
|
+
'accordion-up': {
|
206
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
207
|
+
to: { height: '0' },
|
72
208
|
},
|
73
209
|
},
|
74
210
|
animation: {
|
75
|
-
|
76
|
-
|
211
|
+
'accordion-down': 'accordion-down 0.2s ease-out',
|
212
|
+
'accordion-up': 'accordion-up 0.2s ease-out',
|
77
213
|
},
|
78
214
|
},
|
79
215
|
},
|
80
|
-
plugins: [require(
|
81
|
-
}
|
216
|
+
plugins: [require('tailwindcss-animate')],
|
217
|
+
};
|
package/tsconfig.json
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
"moduleResolution": "node",
|
6
6
|
"noEmitOnError": true,
|
7
7
|
"lib": ["es2017", "dom"],
|
8
|
+
"skipLibCheck": true,
|
9
|
+
"types": ["jest"],
|
8
10
|
"strict": true,
|
9
11
|
"allowArbitraryExtensions": false,
|
10
12
|
"esModuleInterop": false,
|
@@ -21,5 +23,8 @@
|
|
21
23
|
"@/*": ["./src/*"]
|
22
24
|
}
|
23
25
|
},
|
24
|
-
"include": ["**/*.ts", "tailwind.config.js"
|
26
|
+
"include": ["**/*.ts", "tailwind.config.js",
|
27
|
+
"node_modules/@types/chai",
|
28
|
+
"node_modules/@types/mocha",
|
29
|
+
"node_modules/@types/jest"]
|
25
30
|
}
|
@@ -1,247 +0,0 @@
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
2
|
-
import {
|
3
|
-
LitElement,
|
4
|
-
html,
|
5
|
-
css,
|
6
|
-
nothing,
|
7
|
-
PropertyValues,
|
8
|
-
PropertyValueMap,
|
9
|
-
ReactiveControllerHost,
|
10
|
-
} from 'lit';
|
11
|
-
import { customElement, property } from 'lit/decorators.js';
|
12
|
-
import { cn } from '@/helpers';
|
13
|
-
import { TWStyles } from '@/styles';
|
14
|
-
|
15
|
-
const STATE_OPEN = 'open';
|
16
|
-
const STATE_CLOSED = 'closed';
|
17
|
-
|
18
|
-
class PopoverController {
|
19
|
-
private host: ReactiveControllerHost;
|
20
|
-
|
21
|
-
pos = { x: 0, y: 0 };
|
22
|
-
|
23
|
-
_onMouseMove = ({ clientX, clientY }: MouseEvent) => {
|
24
|
-
this.pos = { x: clientX, y: clientY };
|
25
|
-
this.host.requestUpdate();
|
26
|
-
};
|
27
|
-
|
28
|
-
_onClick = (e: MouseEvent) => {
|
29
|
-
console.log(`click: ${e.target}`);
|
30
|
-
console.log(`pos: ${this.pos.x}`);
|
31
|
-
if (e.y < 100) {
|
32
|
-
const popover = (this.host as PopoverContent)?._popover;
|
33
|
-
if (popover && popover.state === STATE_OPEN) {
|
34
|
-
popover.state = STATE_CLOSED;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
// this.host.requestUpdate();
|
38
|
-
};
|
39
|
-
|
40
|
-
_onScroll = (e: Event) => {
|
41
|
-
console.log(`scroll: ${e.target}`);
|
42
|
-
console.log(`pos: ${this.pos.y}`);
|
43
|
-
console.log(`pos: ${window.scrollY} ${window.innerHeight}`);
|
44
|
-
this.host.requestUpdate();
|
45
|
-
};
|
46
|
-
|
47
|
-
_onResize = (e: UIEvent) => {
|
48
|
-
console.log(`resize: ${e.target}`);
|
49
|
-
console.log(`pos: ${window.innerWidth} ${window.innerHeight}`);
|
50
|
-
this.host.requestUpdate();
|
51
|
-
};
|
52
|
-
|
53
|
-
constructor(host: ReactiveControllerHost) {
|
54
|
-
this.host = host;
|
55
|
-
host.addController(this);
|
56
|
-
}
|
57
|
-
|
58
|
-
hostConnected() {
|
59
|
-
window.addEventListener('mousemove', this._onMouseMove);
|
60
|
-
window.addEventListener('click', this._onClick);
|
61
|
-
window.addEventListener('scroll', this._onScroll);
|
62
|
-
window.addEventListener('resize', this._onResize);
|
63
|
-
}
|
64
|
-
|
65
|
-
hostDisconnected() {
|
66
|
-
window.removeEventListener('mousemove', this._onMouseMove);
|
67
|
-
window.removeEventListener('click', this._onClick);
|
68
|
-
window.removeEventListener('scroll', this._onScroll);
|
69
|
-
window.removeEventListener('resize', this._onResize);
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
@customElement('rtg-popover')
|
74
|
-
export class Popover extends LitElement {
|
75
|
-
static styles = [css``, TWStyles];
|
76
|
-
|
77
|
-
@property({ attribute: 'data-state', type: String }) state = STATE_CLOSED;
|
78
|
-
|
79
|
-
@property({ type: String }) align = 'center';
|
80
|
-
|
81
|
-
@property({ type: Number }) sideOffset = 0;
|
82
|
-
|
83
|
-
get _content(): PopoverContent | null {
|
84
|
-
const slot = this.shadowRoot?.querySelector('slot');
|
85
|
-
const children = slot?.assignedElements();
|
86
|
-
if (children) {
|
87
|
-
for (let index = 0; index < children.length; index++) {
|
88
|
-
if (children[index] instanceof PopoverContent) {
|
89
|
-
return children[index] as PopoverContent;
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
return null;
|
95
|
-
}
|
96
|
-
|
97
|
-
get _trigger(): PopoverTrigger | null {
|
98
|
-
const slot = this.shadowRoot?.querySelector('slot');
|
99
|
-
const children = slot?.assignedElements();
|
100
|
-
if (children) {
|
101
|
-
for (let index = 0; index < children.length; index++) {
|
102
|
-
if (children[index] instanceof PopoverTrigger) {
|
103
|
-
return children[index] as PopoverTrigger;
|
104
|
-
}
|
105
|
-
}
|
106
|
-
}
|
107
|
-
|
108
|
-
return null;
|
109
|
-
}
|
110
|
-
|
111
|
-
protected updated(_changedProperties: PropertyValues): void {
|
112
|
-
super.updated(_changedProperties);
|
113
|
-
const content = this._content;
|
114
|
-
if (content) {
|
115
|
-
content.dataset.state = this.state;
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
render() {
|
120
|
-
return html`
|
121
|
-
<div rtgpop-root>
|
122
|
-
<slot></slot>
|
123
|
-
</div>
|
124
|
-
`;
|
125
|
-
}
|
126
|
-
}
|
127
|
-
|
128
|
-
@customElement('rtg-popover-content')
|
129
|
-
export class PopoverContent extends LitElement {
|
130
|
-
static styles = [css``, TWStyles];
|
131
|
-
|
132
|
-
@property({ attribute: 'data-state', type: String }) state = STATE_CLOSED;
|
133
|
-
|
134
|
-
@property({ attribute: 'data-side', type: String }) side = 'bottom';
|
135
|
-
|
136
|
-
private controller = new PopoverController(this);
|
137
|
-
|
138
|
-
public get _popover(): Popover | null {
|
139
|
-
let parent = this.parentElement;
|
140
|
-
|
141
|
-
while (parent) {
|
142
|
-
if (parent instanceof Popover) {
|
143
|
-
return parent;
|
144
|
-
}
|
145
|
-
parent = parent.parentElement;
|
146
|
-
}
|
147
|
-
return parent;
|
148
|
-
}
|
149
|
-
|
150
|
-
public get _box(): DOMRect {
|
151
|
-
return this.firstElementChild!.getBoundingClientRect();
|
152
|
-
}
|
153
|
-
|
154
|
-
public get _triggerBox(): DOMRect {
|
155
|
-
return this._popover!._trigger!.getBoundingClientRect();
|
156
|
-
}
|
157
|
-
|
158
|
-
private handleCloseButtonClick = () => {
|
159
|
-
const popover = this._popover;
|
160
|
-
if (popover) {
|
161
|
-
popover.dataset.state = STATE_CLOSED;
|
162
|
-
}
|
163
|
-
};
|
164
|
-
|
165
|
-
render() {
|
166
|
-
let top = 0;
|
167
|
-
const box = this._box;
|
168
|
-
const triggerBox = this._triggerBox;
|
169
|
-
if (this.side === 'bottom') {
|
170
|
-
top = triggerBox.top + triggerBox.height;
|
171
|
-
if (top + box.height > window.innerHeight) {
|
172
|
-
top = triggerBox.top - box.height;
|
173
|
-
}
|
174
|
-
}
|
175
|
-
|
176
|
-
if (this.side === 'top') {
|
177
|
-
top = triggerBox.top - box.height;
|
178
|
-
if (top < 0) {
|
179
|
-
top = triggerBox.top + triggerBox.height;
|
180
|
-
}
|
181
|
-
}
|
182
|
-
|
183
|
-
return html`${this.state === STATE_OPEN
|
184
|
-
? html`
|
185
|
-
<div
|
186
|
-
style="position: fixed; left: 0px; top: 0px; transform: translate(638px, ${top}px); min-width: max-content; --radix-popper-transform-origin: 50% 0px; z-index: 50; --radix-popper-available-width: ${window.innerWidth}px; --radix-popper-available-height: ${window.innerHeight}px; --radix-popper-anchor-width: 127.046875px; --radix-popper-anchor-height: 36px;"
|
187
|
-
>
|
188
|
-
<div
|
189
|
-
class="${cn(
|
190
|
-
'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
191
|
-
this.className
|
192
|
-
)}"
|
193
|
-
rtgpop-content
|
194
|
-
>
|
195
|
-
<slot></slot>
|
196
|
-
</div>
|
197
|
-
</div>
|
198
|
-
`
|
199
|
-
: nothing}`;
|
200
|
-
}
|
201
|
-
}
|
202
|
-
|
203
|
-
@customElement('rtg-popover-trigger')
|
204
|
-
export class PopoverTrigger extends LitElement {
|
205
|
-
static styles = [css``, TWStyles];
|
206
|
-
|
207
|
-
private get _popover(): Popover | null {
|
208
|
-
let parent = this.parentElement;
|
209
|
-
|
210
|
-
while (parent) {
|
211
|
-
if (parent instanceof Popover) {
|
212
|
-
return parent;
|
213
|
-
}
|
214
|
-
parent = parent.parentElement;
|
215
|
-
}
|
216
|
-
return parent;
|
217
|
-
}
|
218
|
-
|
219
|
-
protected firstUpdated(
|
220
|
-
_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>
|
221
|
-
): void {
|
222
|
-
super.firstUpdated(_changedProperties);
|
223
|
-
const slot = this.shadowRoot?.querySelector('slot');
|
224
|
-
const children = slot?.assignedElements();
|
225
|
-
if (children && children.length > 0) {
|
226
|
-
const button = children[0];
|
227
|
-
|
228
|
-
button.addEventListener('click', () => {
|
229
|
-
const popover = this._popover;
|
230
|
-
if (popover) {
|
231
|
-
popover._content!.dataset.side = 'top';
|
232
|
-
popover.dataset.state = STATE_OPEN;
|
233
|
-
popover.dataset.state = STATE_CLOSED;
|
234
|
-
popover.dataset.state = STATE_OPEN;
|
235
|
-
}
|
236
|
-
});
|
237
|
-
}
|
238
|
-
}
|
239
|
-
|
240
|
-
render() {
|
241
|
-
return html`
|
242
|
-
<div>
|
243
|
-
<slot></slot>
|
244
|
-
</div>
|
245
|
-
`;
|
246
|
-
}
|
247
|
-
}
|