@helpwave/hightide 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/branding/HelpwaveBadge.js +7 -7
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +7 -7
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.js +67 -39
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +56 -28
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js +3 -3
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +3 -3
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimePicker.js +4 -4
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/TimePicker.mjs +4 -4
- package/dist/components/date/TimePicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +48 -20
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +46 -18
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +32 -28
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +18 -14
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Ring.js +2 -2
- package/dist/components/icons-and-geometry/Ring.js.map +1 -1
- package/dist/components/icons-and-geometry/Ring.mjs +2 -2
- package/dist/components/icons-and-geometry/Ring.mjs.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.js.map +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs +1 -1
- package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +84 -15
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +76 -7
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Chip.js +1 -1
- package/dist/components/layout-and-navigation/Chip.js.map +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs +1 -1
- package/dist/components/layout-and-navigation/Chip.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +10 -1
- package/dist/components/layout-and-navigation/Expandable.d.ts +10 -1
- package/dist/components/layout-and-navigation/Expandable.js +38 -10
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +38 -11
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +36 -12
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +38 -14
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +92 -19
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +81 -8
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js +82 -9
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +79 -6
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +127 -25
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +126 -24
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +22 -16
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +19 -13
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +7 -3
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +7 -3
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +2 -2
- package/dist/components/layout-and-navigation/Tile.d.ts +2 -2
- package/dist/components/layout-and-navigation/Tile.js +7 -7
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +7 -7
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +5 -10
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +5 -10
- package/dist/components/loading-states/LoadingAndErrorComponent.js +14 -327
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +15 -318
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +5 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +5 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +8 -6
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +8 -6
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/loading-states/LoadingContainer.d.mts +8 -0
- package/dist/components/loading-states/LoadingContainer.d.ts +8 -0
- package/dist/components/loading-states/LoadingContainer.js +34 -0
- package/dist/components/loading-states/LoadingContainer.js.map +1 -0
- package/dist/components/loading-states/LoadingContainer.mjs +10 -0
- package/dist/components/loading-states/LoadingContainer.mjs.map +1 -0
- package/dist/components/modals/ConfirmModal.js +32 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +18 -14
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +28 -24
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +18 -14
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +32 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +18 -14
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +729 -434
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +729 -430
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +733 -438
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +732 -433
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +110 -35
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +110 -35
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +118 -41
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +114 -37
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +10 -3
- package/dist/components/properties/MultiSelectProperty.d.ts +10 -3
- package/dist/components/properties/MultiSelectProperty.js +916 -463
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +921 -464
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +101 -18
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +101 -18
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +103 -20
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +99 -16
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +9 -2
- package/dist/components/properties/SelectProperty.d.ts +9 -2
- package/dist/components/properties/SelectProperty.js +683 -243
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +687 -243
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +133 -46
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +133 -46
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.js +285 -185
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +270 -166
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js +179 -78
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +160 -55
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/TableSortButton.js +72 -3
- package/dist/components/table/TableSortButton.js.map +1 -1
- package/dist/components/table/TableSortButton.mjs +72 -3
- package/dist/components/table/TableSortButton.mjs.map +1 -1
- package/dist/components/user-action/Button.d.mts +15 -2
- package/dist/components/user-action/Button.d.ts +15 -2
- package/dist/components/user-action/Button.js +12 -12
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +12 -12
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +6 -15
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +6 -15
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs +6 -2
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +81 -49
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +67 -35
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +11 -6
- package/dist/components/user-action/Menu.d.ts +11 -6
- package/dist/components/user-action/Menu.js +128 -31
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +134 -33
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +17 -7
- package/dist/components/user-action/MultiSelect.d.ts +17 -7
- package/dist/components/user-action/MultiSelect.js +797 -375
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +782 -356
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +2 -2
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +2 -2
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.d.mts +14 -0
- package/dist/components/user-action/SearchBar.d.ts +14 -0
- package/dist/components/user-action/SearchBar.js +673 -0
- package/dist/components/user-action/SearchBar.js.map +1 -0
- package/dist/components/user-action/SearchBar.mjs +637 -0
- package/dist/components/user-action/SearchBar.mjs.map +1 -0
- package/dist/components/user-action/Select.d.mts +18 -5
- package/dist/components/user-action/Select.d.ts +18 -5
- package/dist/components/user-action/Select.js +765 -355
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +762 -349
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.d.mts +1 -1
- package/dist/components/user-action/Textarea.d.ts +1 -1
- package/dist/components/user-action/Textarea.js +13 -3
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +13 -3
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.js +2 -2
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +2 -2
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +284 -113
- package/dist/css/uncompiled/globals.css +19 -13
- package/dist/css/uncompiled/theme/colors-component.css +12 -3
- package/dist/css/uncompiled/theme/colors-semantic.css +10 -7
- package/dist/css/uncompiled/utitlity/animation.css +96 -1
- package/dist/css/uncompiled/utitlity/general.css +16 -0
- package/dist/hooks/usePopoverPosition.d.mts +15 -0
- package/dist/hooks/usePopoverPosition.d.ts +15 -0
- package/dist/hooks/usePopoverPosition.js +81 -0
- package/dist/hooks/usePopoverPosition.js.map +1 -0
- package/dist/hooks/usePopoverPosition.mjs +57 -0
- package/dist/hooks/usePopoverPosition.mjs.map +1 -0
- package/dist/hooks/useSearch.d.mts +7 -2
- package/dist/hooks/useSearch.d.ts +7 -2
- package/dist/hooks/useSearch.js +44 -15
- package/dist/hooks/useSearch.js.map +1 -1
- package/dist/hooks/useSearch.mjs +45 -16
- package/dist/hooks/useSearch.mjs.map +1 -1
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +1197 -902
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1048 -754
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +2 -0
- package/dist/localization/defaults/form.d.ts +2 -0
- package/dist/localization/defaults/form.js +4 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +4 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/simpleSearch.d.mts +1 -1
- package/dist/util/simpleSearch.d.ts +1 -1
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -27,43 +27,43 @@
|
|
|
27
27
|
/* Styles that can be overwritten by utils */
|
|
28
28
|
@layer components {
|
|
29
29
|
.btn-sm {
|
|
30
|
-
@apply row items-center justify-center
|
|
30
|
+
@apply flex-row-1 items-center justify-center px-1.5 py-1 rounded-1.5 h-8 min-h-8;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.btn-md {
|
|
34
|
-
@apply row items-center justify-center
|
|
34
|
+
@apply flex-row-2 items-center justify-center px-3 py-2 rounded-1.5 h-10 min-h-10;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.btn-lg {
|
|
38
|
-
@apply row items-center justify-center
|
|
38
|
+
@apply flex-row-2 items-center justify-center px-4 py-2.5 rounded-1.5 h-12 min-h-12;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.icon-btn-xs {
|
|
42
|
-
@apply row items-center justify-center
|
|
42
|
+
@apply flex-row-0 items-center justify-center p-1 rounded-1 h-6 min-h-6 w-6 min-w-6;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.icon-btn-sm {
|
|
46
|
-
@apply row items-center justify-center
|
|
46
|
+
@apply flex-row-0 items-center justify-center p-1.5 rounded-1.5 h-8 min-h-8 w-8 min-w-8;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.icon-btn-md {
|
|
50
|
-
@apply row items-center justify-center
|
|
50
|
+
@apply flex-row-0 items-center justify-center p-2 rounded-1.5 h-10 min-h-10 w-10 min-w-10;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.icon-btn-lg {
|
|
54
|
-
@apply row items-center justify-center
|
|
54
|
+
@apply flex-row-0 items-center justify-center p-3 rounded-1.5 h-12 min-h-12 w-12 min-w-12;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.card-sm {
|
|
58
|
-
@apply col
|
|
58
|
+
@apply flex-col-2 bg-surface text-on-surface px-2 py-1 rounded;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.card-md {
|
|
62
|
-
@apply col
|
|
62
|
+
@apply flex-col-2 bg-surface text-on-surface px-4 py-2 rounded-md;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.card-lg {
|
|
66
|
-
@apply col
|
|
66
|
+
@apply flex-col-2 bg-surface text-on-surface px-8 py-4 rounded-lg;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.chip {
|
|
@@ -113,7 +113,13 @@
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
*:focus-visible {
|
|
116
|
-
@apply ring-
|
|
116
|
+
@apply ring-1 ring-focus;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (prefers-reduced-motion: reduce) {
|
|
120
|
+
* {
|
|
121
|
+
@apply !transition-none !animate-none;
|
|
122
|
+
}
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
table {
|
|
@@ -121,7 +127,7 @@
|
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
th {
|
|
124
|
-
@apply px-3 first:pl-6 last:pr-6 py-2.5 border-y-1 first:border-l-1 last:border-r-
|
|
130
|
+
@apply px-3 first:pl-6 last:pr-6 py-2.5 border-y-1 first:border-l-1 last:border-r-2 first:rounded-tl-lg last:rounded-tr-lg bg-tabel-header-background text-text-label font-bold;
|
|
125
131
|
}
|
|
126
132
|
|
|
127
133
|
tbody > tr {
|
|
@@ -129,7 +135,7 @@
|
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
td {
|
|
132
|
-
@apply px-3 first:pl-6 last:pr-6 py-2.5 border-b-1 first:border-l-1 last:border-r-
|
|
138
|
+
@apply px-3 first:pl-6 last:pr-6 py-2.5 border-b-1 first:border-l-1 last:border-r-2 [nth-last-child(1)]:first:rounded-bl-lg [nth-last-child(1)]:last:rounded-br-lg;
|
|
133
139
|
}
|
|
134
140
|
|
|
135
141
|
tbody > tr:last-child > td {
|
|
@@ -54,14 +54,15 @@
|
|
|
54
54
|
/* Overlay */
|
|
55
55
|
--color-overlay-background: #FFFFFF;
|
|
56
56
|
--color-overlay-text: var(--color-text-dark);
|
|
57
|
+
--color-overlay-shadow: #00000039;
|
|
57
58
|
|
|
58
59
|
/* ProgressIndicator */
|
|
59
60
|
--color-progress-indicator-fill: var(--color-primary);
|
|
60
61
|
--color-progress-indicator-background: var(--color-gray-300);
|
|
61
62
|
|
|
62
63
|
/* Property */
|
|
63
|
-
--color-property-title-background: #
|
|
64
|
-
--color-property-title-text: var(--color-text-
|
|
64
|
+
--color-property-title-background: #EDEDED;
|
|
65
|
+
--color-property-title-text: var(--color-text-secondary);
|
|
65
66
|
|
|
66
67
|
/* Stepper Bar */
|
|
67
68
|
--color-stepperbar-dot-active: var(--color-primary);
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
--color-text-image-dark-text: var(--color-white);
|
|
103
104
|
|
|
104
105
|
/* Tooltip */
|
|
105
|
-
--color-tooltip-background:
|
|
106
|
+
--color-tooltip-background: #D9D9D9;
|
|
106
107
|
--color-tooltip-text: var(--color-description);
|
|
107
108
|
}
|
|
108
109
|
|
|
@@ -135,9 +136,17 @@
|
|
|
135
136
|
/* Overlay */
|
|
136
137
|
--color-overlay-background: #2A2A2A;
|
|
137
138
|
--color-overlay-text: var(--color-text-light);
|
|
139
|
+
--color-overlay-shadow: #00000055;
|
|
138
140
|
|
|
139
141
|
/* Table */
|
|
140
142
|
--color-tabel-header-background: #2F2F2F;
|
|
141
143
|
--color-table-row-hover-background: #2f2841;
|
|
144
|
+
|
|
145
|
+
/* Tag */
|
|
146
|
+
--color-tag-dark-background: #1A1A1A;
|
|
147
|
+
|
|
148
|
+
/* Tooltip */
|
|
149
|
+
--color-tooltip-background: #555555;
|
|
150
|
+
--color-tooltip-text: var(--color-description);
|
|
142
151
|
}
|
|
143
152
|
}
|
|
@@ -56,11 +56,13 @@
|
|
|
56
56
|
--color-description: #555555;
|
|
57
57
|
--color-outline: #E6E6E6;
|
|
58
58
|
--color-outline-variant: #CCCCCC;
|
|
59
|
-
|
|
60
|
-
--color-disabled-
|
|
61
|
-
--color-disabled-
|
|
62
|
-
--color-disabled-
|
|
63
|
-
--color-disabled-
|
|
59
|
+
|
|
60
|
+
--color-disabled-background: #E2E2E2;
|
|
61
|
+
--color-disabled-text: #888888;
|
|
62
|
+
--color-disabled-icon: var(--color-disabled-text);
|
|
63
|
+
--color-disabled-border: #CFCFCF;
|
|
64
|
+
--color-disabled-outline: var(--color-disabled-border);
|
|
65
|
+
|
|
64
66
|
--color-border: #CCCCCC;
|
|
65
67
|
|
|
66
68
|
--color-focus: var(--color-purple-400);
|
|
@@ -93,7 +95,8 @@
|
|
|
93
95
|
--color-text-highlight: #3272DF;
|
|
94
96
|
--color-description: #999999;
|
|
95
97
|
|
|
96
|
-
--color-disabled-background: #
|
|
97
|
-
--color-disabled-text: #
|
|
98
|
+
--color-disabled-background: #292929;
|
|
99
|
+
--color-disabled-text: #666666;
|
|
100
|
+
--color-disabled-border: #363636;
|
|
98
101
|
}
|
|
99
102
|
}
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
@-webkit-keyframes bigLeftUp {
|
|
25
|
+
0%, 25% {
|
|
26
|
+
stroke-dashoffset: 1000;
|
|
27
|
+
}
|
|
28
|
+
50%, 75%, 100% {
|
|
29
|
+
stroke-dashoffset: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
24
32
|
@keyframes bigLeftUp {
|
|
25
33
|
0%, 25% {
|
|
26
34
|
stroke-dashoffset: 1000;
|
|
@@ -30,6 +38,14 @@
|
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
|
|
41
|
+
@-webkit-keyframes bigRightDown {
|
|
42
|
+
0%, 25%, 50% {
|
|
43
|
+
stroke-dashoffset: 0;
|
|
44
|
+
}
|
|
45
|
+
75%, 100% {
|
|
46
|
+
stroke-dashoffset: -1000;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
33
49
|
@keyframes bigRightDown {
|
|
34
50
|
0%, 25%, 50% {
|
|
35
51
|
stroke-dashoffset: 0;
|
|
@@ -39,6 +55,14 @@
|
|
|
39
55
|
}
|
|
40
56
|
}
|
|
41
57
|
|
|
58
|
+
@-webkit-keyframes smallLeftUp {
|
|
59
|
+
0%, 25%, 50% {
|
|
60
|
+
stroke-dashoffset: 1000;
|
|
61
|
+
}
|
|
62
|
+
75%, 100% {
|
|
63
|
+
stroke-dashoffset: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
42
66
|
@keyframes smallLeftUp {
|
|
43
67
|
0%, 25%, 50% {
|
|
44
68
|
stroke-dashoffset: 1000;
|
|
@@ -48,6 +72,14 @@
|
|
|
48
72
|
}
|
|
49
73
|
}
|
|
50
74
|
|
|
75
|
+
@-webkit-keyframes smallRightDown {
|
|
76
|
+
0%, 25% {
|
|
77
|
+
stroke-dashoffset: 0;
|
|
78
|
+
}
|
|
79
|
+
50%, 75%, 100% {
|
|
80
|
+
stroke-dashoffset: -1000;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
51
83
|
@keyframes smallRightDown {
|
|
52
84
|
0%, 25% {
|
|
53
85
|
stroke-dashoffset: 0;
|
|
@@ -57,31 +89,94 @@
|
|
|
57
89
|
}
|
|
58
90
|
}
|
|
59
91
|
|
|
92
|
+
@keyframes pop-in {
|
|
93
|
+
0% {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
scale: 80%;
|
|
96
|
+
}
|
|
97
|
+
100% {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
scale: 100%;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes pop-out {
|
|
104
|
+
0% {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
scale: 100%;
|
|
107
|
+
}
|
|
108
|
+
100% {
|
|
109
|
+
opacity: 0;
|
|
110
|
+
scale: 80%;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes shimmer {
|
|
115
|
+
0% {
|
|
116
|
+
left: -100%;
|
|
117
|
+
}
|
|
118
|
+
100% {
|
|
119
|
+
left: 100%;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.animate-pop-in {
|
|
124
|
+
animation: pop-in 0.2s ease-in-out;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.animate-pop-out {
|
|
128
|
+
animation: pop-out 0.2s ease-in-out forwards;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.shimmer::before {
|
|
132
|
+
content: '';
|
|
133
|
+
position: absolute;
|
|
134
|
+
top: 0;
|
|
135
|
+
left: -100%;
|
|
136
|
+
height: 100%;
|
|
137
|
+
width: 200%;
|
|
138
|
+
background: linear-gradient(
|
|
139
|
+
120deg,
|
|
140
|
+
transparent 0%,
|
|
141
|
+
transparent 30%,
|
|
142
|
+
rgba(255, 255, 255, 0.1) 50%,
|
|
143
|
+
transparent 70%,
|
|
144
|
+
transparent 100%
|
|
145
|
+
);
|
|
146
|
+
animation: shimmer 2s infinite;
|
|
147
|
+
}
|
|
148
|
+
|
|
60
149
|
.animate-fade {
|
|
61
150
|
animation: fade-out 3s ease-in-out;
|
|
62
151
|
}
|
|
63
152
|
|
|
64
153
|
.animate-wave-big-left-up {
|
|
65
154
|
animation: bigLeftUp 1.7s ease-in infinite normal;
|
|
155
|
+
-webkit-animation: bigLeftUp 1.7s ease-in infinite normal;
|
|
66
156
|
}
|
|
67
157
|
|
|
68
158
|
.animate-wave-big-right-down {
|
|
69
159
|
animation: bigRightDown 1.7s ease-in infinite reverse;
|
|
160
|
+
-webkit-animation: bigRightDown 1.7s ease-in infinite reverse;
|
|
70
161
|
}
|
|
71
162
|
|
|
72
163
|
.animate-wave-small-left-up {
|
|
73
164
|
animation: smallLeftUp 1.7s ease-in infinite normal;
|
|
165
|
+
-webkit-animation: smallLeftUp 1.7s ease-in infinite normal;
|
|
74
166
|
}
|
|
75
167
|
|
|
76
168
|
.animate-wave-small-right-down {
|
|
77
169
|
animation: smallRightDown 1.7s ease-in infinite reverse;
|
|
170
|
+
-webkit-animation: smallRightDown 1.7s ease-in infinite reverse;
|
|
78
171
|
}
|
|
79
172
|
|
|
80
173
|
.animate-tooltip-fade-in {
|
|
81
174
|
animation: fade-in 0.2s ease-in-out forwards;
|
|
175
|
+
-webkit-animation: fade-in 0.2s ease-in-out forwards;
|
|
82
176
|
}
|
|
83
177
|
|
|
84
178
|
.animate-tooltip-fade-out {
|
|
85
179
|
animation: fade-in 0.2s ease-in-out forwards;
|
|
180
|
+
-webkit-animation: fade-in 0.2s ease-in-out forwards;
|
|
86
181
|
}
|
|
87
|
-
}
|
|
182
|
+
}
|
|
@@ -2,10 +2,26 @@
|
|
|
2
2
|
@apply flex flex-col gap-y-2;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
@utility flex-col-* {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
row-gap: calc(var(--spacing) * --value(number));
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
@utility row {
|
|
6
12
|
@apply flex flex-row gap-x-2;
|
|
7
13
|
}
|
|
8
14
|
|
|
15
|
+
@utility flex-row-* {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
column-gap: calc(var(--spacing) * --value(number));
|
|
19
|
+
}
|
|
20
|
+
|
|
9
21
|
@utility input-indicator-hidden {
|
|
10
22
|
@apply appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [-moz-appearance:textfield];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@utility fake-hidden {
|
|
26
|
+
@apply invisible pointer-events-none touch-none opacity-0;
|
|
11
27
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type PopoverHorizontalAlignment = 'leftOutside' | 'leftInside' | 'rightOutside' | 'rightInside' | 'center';
|
|
4
|
+
type PopoverVerticalAlignment = 'topOutside' | 'topInside' | 'bottomOutside' | 'bottomInside' | 'center';
|
|
5
|
+
type PopoverPositionOptionsResolved = {
|
|
6
|
+
edgePadding: number;
|
|
7
|
+
outerGap: number;
|
|
8
|
+
verticalAlignment: PopoverVerticalAlignment;
|
|
9
|
+
horizontalAlignment: PopoverHorizontalAlignment;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
type PopoverPositionOptions = Partial<PopoverPositionOptionsResolved>;
|
|
13
|
+
declare const usePopoverPosition: (trigger?: DOMRect, options?: PopoverPositionOptions) => CSSProperties;
|
|
14
|
+
|
|
15
|
+
export { type PopoverHorizontalAlignment, type PopoverVerticalAlignment, usePopoverPosition };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type PopoverHorizontalAlignment = 'leftOutside' | 'leftInside' | 'rightOutside' | 'rightInside' | 'center';
|
|
4
|
+
type PopoverVerticalAlignment = 'topOutside' | 'topInside' | 'bottomOutside' | 'bottomInside' | 'center';
|
|
5
|
+
type PopoverPositionOptionsResolved = {
|
|
6
|
+
edgePadding: number;
|
|
7
|
+
outerGap: number;
|
|
8
|
+
verticalAlignment: PopoverVerticalAlignment;
|
|
9
|
+
horizontalAlignment: PopoverHorizontalAlignment;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
type PopoverPositionOptions = Partial<PopoverPositionOptionsResolved>;
|
|
13
|
+
declare const usePopoverPosition: (trigger?: DOMRect, options?: PopoverPositionOptions) => CSSProperties;
|
|
14
|
+
|
|
15
|
+
export { type PopoverHorizontalAlignment, type PopoverVerticalAlignment, usePopoverPosition };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/hooks/usePopoverPosition.ts
|
|
20
|
+
var usePopoverPosition_exports = {};
|
|
21
|
+
__export(usePopoverPosition_exports, {
|
|
22
|
+
usePopoverPosition: () => usePopoverPosition
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(usePopoverPosition_exports);
|
|
25
|
+
var defaultPopoverPositionOptions = {
|
|
26
|
+
edgePadding: 16,
|
|
27
|
+
outerGap: 4,
|
|
28
|
+
horizontalAlignment: "leftInside",
|
|
29
|
+
verticalAlignment: "bottomOutside",
|
|
30
|
+
disabled: false
|
|
31
|
+
};
|
|
32
|
+
var usePopoverPosition = (trigger, options) => {
|
|
33
|
+
const {
|
|
34
|
+
edgePadding,
|
|
35
|
+
outerGap,
|
|
36
|
+
verticalAlignment,
|
|
37
|
+
horizontalAlignment,
|
|
38
|
+
disabled
|
|
39
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
40
|
+
if (disabled || !trigger) {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
const left = {
|
|
44
|
+
leftOutside: trigger.left - outerGap,
|
|
45
|
+
leftInside: trigger.left,
|
|
46
|
+
rightOutside: trigger.right + outerGap,
|
|
47
|
+
rightInside: trigger.right,
|
|
48
|
+
center: trigger.left + trigger.width / 2
|
|
49
|
+
}[horizontalAlignment];
|
|
50
|
+
const top = {
|
|
51
|
+
topOutside: trigger.top - outerGap,
|
|
52
|
+
topInside: trigger.top,
|
|
53
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
54
|
+
bottomInside: trigger.bottom,
|
|
55
|
+
center: trigger.top + trigger.height / 2
|
|
56
|
+
}[verticalAlignment];
|
|
57
|
+
const translateX = {
|
|
58
|
+
leftOutside: "-100%",
|
|
59
|
+
leftInside: void 0,
|
|
60
|
+
rightOutside: void 0,
|
|
61
|
+
rightInside: "-100%",
|
|
62
|
+
center: "-50%"
|
|
63
|
+
}[horizontalAlignment];
|
|
64
|
+
const translateY = {
|
|
65
|
+
topOutside: "-100%",
|
|
66
|
+
topInside: void 0,
|
|
67
|
+
bottomOutside: void 0,
|
|
68
|
+
bottomInside: "-100%",
|
|
69
|
+
center: "-50%"
|
|
70
|
+
}[verticalAlignment];
|
|
71
|
+
return {
|
|
72
|
+
left: Math.max(left, edgePadding),
|
|
73
|
+
top: Math.max(top, edgePadding),
|
|
74
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
+
0 && (module.exports = {
|
|
79
|
+
usePopoverPosition
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=usePopoverPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/usePopoverPosition.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\n\nexport type PopoverHorizontalAlignment = 'leftOutside' | 'leftInside' | 'rightOutside' | 'rightInside' | 'center'\nexport type PopoverVerticalAlignment = 'topOutside' | 'topInside' | 'bottomOutside' | 'bottomInside' | 'center'\n\ntype PopoverPositionOptionsResolved = {\n edgePadding: number,\n outerGap: number,\n verticalAlignment: PopoverVerticalAlignment,\n horizontalAlignment: PopoverHorizontalAlignment,\n disabled: boolean,\n}\n\ntype PopoverPositionOptions = Partial<PopoverPositionOptionsResolved>\n\nconst defaultPopoverPositionOptions: PopoverPositionOptionsResolved = {\n edgePadding: 16,\n outerGap: 4,\n horizontalAlignment: 'leftInside',\n verticalAlignment: 'bottomOutside',\n disabled: false,\n}\n\nexport const usePopoverPosition = (trigger?: DOMRect, options?: PopoverPositionOptions): CSSProperties => {\n const {\n edgePadding,\n outerGap,\n verticalAlignment,\n horizontalAlignment,\n disabled\n }: PopoverPositionOptionsResolved = { ...defaultPopoverPositionOptions, ...options }\n\n if (disabled || !trigger) {\n return {}\n }\n\n const left: number = {\n leftOutside: trigger.left - outerGap,\n leftInside: trigger.left,\n rightOutside: trigger.right + outerGap,\n rightInside: trigger.right,\n center: trigger.left + trigger.width / 2,\n }[horizontalAlignment]\n\n const top: number = {\n topOutside: trigger.top - outerGap,\n topInside: trigger.top,\n bottomOutside: trigger.bottom + outerGap,\n bottomInside: trigger.bottom,\n center: trigger.top + trigger.height / 2,\n }[verticalAlignment]\n\n const translateX: string | undefined = {\n leftOutside: '-100%',\n leftInside: undefined,\n rightOutside: undefined,\n rightInside: '-100%',\n center: '-50%',\n }[horizontalAlignment]\n\n const translateY: string | undefined = {\n topOutside: '-100%',\n topInside: undefined,\n bottomOutside: undefined,\n bottomInside: '-100%',\n center: '-50%',\n }[verticalAlignment]\n\n return {\n left: Math.max(left, edgePadding),\n top: Math.max(top, edgePadding),\n translate: [translateX ?? '0', translateY ?? '0'].join(' ')\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,IAAM,gCAAgE;AAAA,EACpE,aAAa;AAAA,EACb,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,UAAU;AACZ;AAEO,IAAM,qBAAqB,CAAC,SAAmB,YAAoD;AACxG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAoC,EAAE,GAAG,+BAA+B,GAAG,QAAQ;AAEnF,MAAI,YAAY,CAAC,SAAS;AACxB,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,OAAe;AAAA,IACnB,aAAa,QAAQ,OAAO;AAAA,IAC5B,YAAY,QAAQ;AAAA,IACpB,cAAc,QAAQ,QAAQ;AAAA,IAC9B,aAAa,QAAQ;AAAA,IACrB,QAAQ,QAAQ,OAAO,QAAQ,QAAQ;AAAA,EACzC,EAAE,mBAAmB;AAErB,QAAM,MAAc;AAAA,IAClB,YAAY,QAAQ,MAAM;AAAA,IAC1B,WAAW,QAAQ;AAAA,IACnB,eAAe,QAAQ,SAAS;AAAA,IAChC,cAAc,QAAQ;AAAA,IACtB,QAAQ,QAAQ,MAAM,QAAQ,SAAS;AAAA,EACzC,EAAE,iBAAiB;AAEnB,QAAM,aAAiC;AAAA,IACrC,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,IACb,QAAQ;AAAA,EACV,EAAE,mBAAmB;AAErB,QAAM,aAAiC;AAAA,IACrC,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,cAAc;AAAA,IACd,QAAQ;AAAA,EACV,EAAE,iBAAiB;AAEnB,SAAO;AAAA,IACL,MAAM,KAAK,IAAI,MAAM,WAAW;AAAA,IAChC,KAAK,KAAK,IAAI,KAAK,WAAW;AAAA,IAC9B,WAAW,CAAC,cAAc,KAAK,cAAc,GAAG,EAAE,KAAK,GAAG;AAAA,EAC5D;AACF;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/hooks/usePopoverPosition.ts
|
|
2
|
+
var defaultPopoverPositionOptions = {
|
|
3
|
+
edgePadding: 16,
|
|
4
|
+
outerGap: 4,
|
|
5
|
+
horizontalAlignment: "leftInside",
|
|
6
|
+
verticalAlignment: "bottomOutside",
|
|
7
|
+
disabled: false
|
|
8
|
+
};
|
|
9
|
+
var usePopoverPosition = (trigger, options) => {
|
|
10
|
+
const {
|
|
11
|
+
edgePadding,
|
|
12
|
+
outerGap,
|
|
13
|
+
verticalAlignment,
|
|
14
|
+
horizontalAlignment,
|
|
15
|
+
disabled
|
|
16
|
+
} = { ...defaultPopoverPositionOptions, ...options };
|
|
17
|
+
if (disabled || !trigger) {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
const left = {
|
|
21
|
+
leftOutside: trigger.left - outerGap,
|
|
22
|
+
leftInside: trigger.left,
|
|
23
|
+
rightOutside: trigger.right + outerGap,
|
|
24
|
+
rightInside: trigger.right,
|
|
25
|
+
center: trigger.left + trigger.width / 2
|
|
26
|
+
}[horizontalAlignment];
|
|
27
|
+
const top = {
|
|
28
|
+
topOutside: trigger.top - outerGap,
|
|
29
|
+
topInside: trigger.top,
|
|
30
|
+
bottomOutside: trigger.bottom + outerGap,
|
|
31
|
+
bottomInside: trigger.bottom,
|
|
32
|
+
center: trigger.top + trigger.height / 2
|
|
33
|
+
}[verticalAlignment];
|
|
34
|
+
const translateX = {
|
|
35
|
+
leftOutside: "-100%",
|
|
36
|
+
leftInside: void 0,
|
|
37
|
+
rightOutside: void 0,
|
|
38
|
+
rightInside: "-100%",
|
|
39
|
+
center: "-50%"
|
|
40
|
+
}[horizontalAlignment];
|
|
41
|
+
const translateY = {
|
|
42
|
+
topOutside: "-100%",
|
|
43
|
+
topInside: void 0,
|
|
44
|
+
bottomOutside: void 0,
|
|
45
|
+
bottomInside: "-100%",
|
|
46
|
+
center: "-50%"
|
|
47
|
+
}[verticalAlignment];
|
|
48
|
+
return {
|
|
49
|
+
left: Math.max(left, edgePadding),
|
|
50
|
+
top: Math.max(top, edgePadding),
|
|
51
|
+
translate: [translateX ?? "0", translateY ?? "0"].join(" ")
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
usePopoverPosition
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=usePopoverPosition.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/usePopoverPosition.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\n\nexport type PopoverHorizontalAlignment = 'leftOutside' | 'leftInside' | 'rightOutside' | 'rightInside' | 'center'\nexport type PopoverVerticalAlignment = 'topOutside' | 'topInside' | 'bottomOutside' | 'bottomInside' | 'center'\n\ntype PopoverPositionOptionsResolved = {\n edgePadding: number,\n outerGap: number,\n verticalAlignment: PopoverVerticalAlignment,\n horizontalAlignment: PopoverHorizontalAlignment,\n disabled: boolean,\n}\n\ntype PopoverPositionOptions = Partial<PopoverPositionOptionsResolved>\n\nconst defaultPopoverPositionOptions: PopoverPositionOptionsResolved = {\n edgePadding: 16,\n outerGap: 4,\n horizontalAlignment: 'leftInside',\n verticalAlignment: 'bottomOutside',\n disabled: false,\n}\n\nexport const usePopoverPosition = (trigger?: DOMRect, options?: PopoverPositionOptions): CSSProperties => {\n const {\n edgePadding,\n outerGap,\n verticalAlignment,\n horizontalAlignment,\n disabled\n }: PopoverPositionOptionsResolved = { ...defaultPopoverPositionOptions, ...options }\n\n if (disabled || !trigger) {\n return {}\n }\n\n const left: number = {\n leftOutside: trigger.left - outerGap,\n leftInside: trigger.left,\n rightOutside: trigger.right + outerGap,\n rightInside: trigger.right,\n center: trigger.left + trigger.width / 2,\n }[horizontalAlignment]\n\n const top: number = {\n topOutside: trigger.top - outerGap,\n topInside: trigger.top,\n bottomOutside: trigger.bottom + outerGap,\n bottomInside: trigger.bottom,\n center: trigger.top + trigger.height / 2,\n }[verticalAlignment]\n\n const translateX: string | undefined = {\n leftOutside: '-100%',\n leftInside: undefined,\n rightOutside: undefined,\n rightInside: '-100%',\n center: '-50%',\n }[horizontalAlignment]\n\n const translateY: string | undefined = {\n topOutside: '-100%',\n topInside: undefined,\n bottomOutside: undefined,\n bottomInside: '-100%',\n center: '-50%',\n }[verticalAlignment]\n\n return {\n left: Math.max(left, edgePadding),\n top: Math.max(top, edgePadding),\n translate: [translateX ?? '0', translateY ?? '0'].join(' ')\n }\n}"],"mappings":";AAeA,IAAM,gCAAgE;AAAA,EACpE,aAAa;AAAA,EACb,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,UAAU;AACZ;AAEO,IAAM,qBAAqB,CAAC,SAAmB,YAAoD;AACxG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAoC,EAAE,GAAG,+BAA+B,GAAG,QAAQ;AAEnF,MAAI,YAAY,CAAC,SAAS;AACxB,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,OAAe;AAAA,IACnB,aAAa,QAAQ,OAAO;AAAA,IAC5B,YAAY,QAAQ;AAAA,IACpB,cAAc,QAAQ,QAAQ;AAAA,IAC9B,aAAa,QAAQ;AAAA,IACrB,QAAQ,QAAQ,OAAO,QAAQ,QAAQ;AAAA,EACzC,EAAE,mBAAmB;AAErB,QAAM,MAAc;AAAA,IAClB,YAAY,QAAQ,MAAM;AAAA,IAC1B,WAAW,QAAQ;AAAA,IACnB,eAAe,QAAQ,SAAS;AAAA,IAChC,cAAc,QAAQ;AAAA,IACtB,QAAQ,QAAQ,MAAM,QAAQ,SAAS;AAAA,EACzC,EAAE,iBAAiB;AAEnB,QAAM,aAAiC;AAAA,IACrC,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,IACb,QAAQ;AAAA,EACV,EAAE,mBAAmB;AAErB,QAAM,aAAiC;AAAA,IACrC,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,cAAc;AAAA,IACd,QAAQ;AAAA,EACV,EAAE,iBAAiB;AAEnB,SAAO;AAAA,IACL,MAAM,KAAK,IAAI,MAAM,WAAW;AAAA,IAChC,KAAK,KAAK,IAAI,KAAK,WAAW;AAAA,IAC9B,WAAW,CAAC,cAAc,KAAK,cAAc,GAAG,EAAE,KAAK,GAAG;AAAA,EAC5D;AACF;","names":[]}
|
|
@@ -4,12 +4,17 @@ type UseSearchProps<T> = {
|
|
|
4
4
|
list: T[];
|
|
5
5
|
searchMapping: (item: T) => string[];
|
|
6
6
|
initialSearch?: string;
|
|
7
|
+
additionalSearchTags?: string[];
|
|
8
|
+
isSearchInstant?: boolean;
|
|
9
|
+
sortingFunction?: (a: T, b: T) => number;
|
|
10
|
+
filter?: (item: T) => boolean;
|
|
11
|
+
disabled?: boolean;
|
|
7
12
|
};
|
|
8
|
-
declare const useSearch: <T>({ list, initialSearch, searchMapping, }: UseSearchProps<T>) => {
|
|
13
|
+
declare const useSearch: <T>({ list, initialSearch, searchMapping, additionalSearchTags, isSearchInstant, sortingFunction, filter, disabled, }: UseSearchProps<T>) => {
|
|
9
14
|
result: T[];
|
|
10
15
|
hasResult: boolean;
|
|
11
16
|
allItems: T[];
|
|
12
|
-
|
|
17
|
+
updateSearch: (newSearch?: string) => void;
|
|
13
18
|
search: string;
|
|
14
19
|
setSearch: react.Dispatch<react.SetStateAction<string>>;
|
|
15
20
|
};
|
|
@@ -4,12 +4,17 @@ type UseSearchProps<T> = {
|
|
|
4
4
|
list: T[];
|
|
5
5
|
searchMapping: (item: T) => string[];
|
|
6
6
|
initialSearch?: string;
|
|
7
|
+
additionalSearchTags?: string[];
|
|
8
|
+
isSearchInstant?: boolean;
|
|
9
|
+
sortingFunction?: (a: T, b: T) => number;
|
|
10
|
+
filter?: (item: T) => boolean;
|
|
11
|
+
disabled?: boolean;
|
|
7
12
|
};
|
|
8
|
-
declare const useSearch: <T>({ list, initialSearch, searchMapping, }: UseSearchProps<T>) => {
|
|
13
|
+
declare const useSearch: <T>({ list, initialSearch, searchMapping, additionalSearchTags, isSearchInstant, sortingFunction, filter, disabled, }: UseSearchProps<T>) => {
|
|
9
14
|
result: T[];
|
|
10
15
|
hasResult: boolean;
|
|
11
16
|
allItems: T[];
|
|
12
|
-
|
|
17
|
+
updateSearch: (newSearch?: string) => void;
|
|
13
18
|
search: string;
|
|
14
19
|
setSearch: react.Dispatch<react.SetStateAction<string>>;
|
|
15
20
|
};
|
package/dist/hooks/useSearch.js
CHANGED
|
@@ -25,13 +25,13 @@ module.exports = __toCommonJS(useSearch_exports);
|
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
|
|
27
27
|
// src/util/simpleSearch.ts
|
|
28
|
-
var
|
|
28
|
+
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
29
29
|
return objects.filter((object) => {
|
|
30
30
|
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
31
31
|
if (!mappedSearchKeywords) {
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
|
-
return !!mappedSearchKeywords.find((value) => value.includes(
|
|
34
|
+
return search.every((searchValue) => !!mappedSearchKeywords.find((value) => !!value && value.includes(searchValue.toLowerCase().trim())));
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -39,22 +39,51 @@ var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
|
39
39
|
var useSearch = ({
|
|
40
40
|
list,
|
|
41
41
|
initialSearch,
|
|
42
|
-
searchMapping
|
|
42
|
+
searchMapping,
|
|
43
|
+
additionalSearchTags,
|
|
44
|
+
isSearchInstant = true,
|
|
45
|
+
sortingFunction,
|
|
46
|
+
filter,
|
|
47
|
+
disabled = false
|
|
43
48
|
}) => {
|
|
44
|
-
const [
|
|
45
|
-
const [
|
|
49
|
+
const [search, setSearch] = (0, import_react.useState)(initialSearch ?? "");
|
|
50
|
+
const [result, setResult] = (0, import_react.useState)(list);
|
|
51
|
+
const searchTags = (0, import_react.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
52
|
+
const updateSearch = (0, import_react.useCallback)((newSearch) => {
|
|
53
|
+
const usedSearch = newSearch ?? search;
|
|
54
|
+
if (newSearch) {
|
|
55
|
+
setSearch(search);
|
|
56
|
+
}
|
|
57
|
+
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
58
|
+
}, [searchTags, list, search, searchMapping]);
|
|
46
59
|
(0, import_react.useEffect)(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
if (isSearchInstant) {
|
|
61
|
+
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
62
|
+
}
|
|
63
|
+
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
64
|
+
const filteredResult = (0, import_react.useMemo)(() => {
|
|
65
|
+
if (!filter) {
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
return result.filter(filter);
|
|
69
|
+
}, [result, filter]);
|
|
70
|
+
const sortedAndFilteredResult = (0, import_react.useMemo)(() => {
|
|
71
|
+
if (!sortingFunction) {
|
|
72
|
+
return filteredResult;
|
|
73
|
+
}
|
|
74
|
+
return filteredResult.sort(sortingFunction);
|
|
75
|
+
}, [filteredResult, sortingFunction]);
|
|
76
|
+
const usedResult = (0, import_react.useMemo)(() => {
|
|
77
|
+
if (!disabled) {
|
|
78
|
+
return sortedAndFilteredResult;
|
|
79
|
+
}
|
|
80
|
+
return list;
|
|
81
|
+
}, [disabled, list, sortedAndFilteredResult]);
|
|
53
82
|
return {
|
|
54
|
-
result,
|
|
55
|
-
hasResult:
|
|
56
|
-
allItems:
|
|
57
|
-
|
|
83
|
+
result: usedResult,
|
|
84
|
+
hasResult: usedResult.length > 0,
|
|
85
|
+
allItems: list,
|
|
86
|
+
updateSearch,
|
|
58
87
|
search,
|
|
59
88
|
setSearch
|
|
60
89
|
};
|