pxd 0.0.60 → 0.0.62
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 -0
- package/dist/components/_internal/dismiss-container.d.vue.ts +28 -0
- package/dist/components/_internal/dismiss-container.vue +162 -0
- package/dist/components/_internal/popover-arrow.d.vue.ts +9 -0
- package/dist/components/_internal/popover-arrow.vue +38 -0
- package/dist/components/active-graph/index.vue +5 -5
- package/dist/components/avatar/index.vue +5 -7
- package/dist/components/avatar-group/index.d.vue.ts +0 -1
- package/dist/components/avatar-group/index.vue +1 -1
- package/dist/components/backtop/index.vue +1 -1
- package/dist/components/badge/index.d.vue.ts +6 -2
- package/dist/components/badge/index.vue +19 -5
- package/dist/components/badge/types.d.ts +5 -0
- package/dist/components/book/index.vue +1 -1
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.d.vue.ts +22 -0
- package/dist/components/bubble/index.vue +59 -0
- package/dist/components/bubble/types.d.ts +6 -0
- package/dist/components/button/index.d.vue.ts +0 -2
- package/dist/components/button/index.vue +31 -22
- package/dist/components/button/types.d.ts +3 -2
- package/dist/components/button-group/index.d.vue.ts +14 -0
- package/dist/components/button-group/index.vue +26 -0
- package/dist/components/button-group/types.d.ts +9 -0
- package/dist/components/carousel/index.d.vue.ts +3 -3
- package/dist/components/carousel/index.vue +146 -113
- package/dist/components/carousel/types.d.ts +1 -1
- package/dist/components/carousel-item/index.vue +22 -17
- package/dist/components/checkbox/index.vue +7 -7
- package/dist/components/checkbox-group/index.d.vue.ts +1 -1
- package/dist/components/chip/index.d.vue.ts +1 -5
- package/dist/components/chip/index.vue +5 -5
- package/dist/components/choicebox/index.vue +1 -1
- package/dist/components/collapse-group/index.vue +1 -1
- package/dist/components/color-selector/index.d.vue.ts +12 -0
- package/dist/components/color-selector/index.vue +64 -0
- package/dist/components/color-selector/types.d.ts +12 -0
- package/dist/components/command-menu/index.d.vue.ts +6 -6
- package/dist/components/command-menu/index.vue +24 -33
- package/dist/components/command-menu/types.d.ts +1 -1
- package/dist/components/command-menu-group/index.vue +15 -6
- package/dist/components/command-menu-group/types.d.ts +1 -1
- package/dist/components/config-provider/index.d.vue.ts +1 -1
- package/dist/components/countdown/index.d.vue.ts +11 -11
- package/dist/components/drawer/index.d.vue.ts +8 -8
- package/dist/components/drawer/index.vue +13 -10
- package/dist/components/drawer/types.d.ts +4 -3
- package/dist/components/ellipsis-text/index.d.vue.ts +4 -1
- package/dist/components/ellipsis-text/index.vue +86 -109
- package/dist/components/ellipsis-text/types.d.ts +2 -1
- package/dist/components/error/index.vue +2 -2
- package/dist/components/fader/index.vue +5 -9
- package/dist/components/gauge/index.vue +34 -29
- package/dist/components/grid/index.vue +1 -1
- package/dist/components/grid-item/index.vue +1 -1
- package/dist/components/hold-button/index.d.vue.ts +8 -10
- package/dist/components/hold-button/index.vue +15 -27
- package/dist/components/hold-button/types.d.ts +5 -6
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/input/index.d.vue.ts +8 -8
- package/dist/components/input/index.vue +7 -6
- package/dist/components/intersection-observer/index.vue +4 -4
- package/dist/components/kbd/index.vue +2 -2
- package/dist/components/link-button/index.d.vue.ts +4 -4
- package/dist/components/link-button/index.vue +5 -7
- package/dist/components/link-button/types.d.ts +0 -3
- package/dist/components/list/index.d.vue.ts +10 -15
- package/dist/components/list/index.vue +58 -131
- package/dist/components/list/types.d.ts +4 -4
- package/dist/components/list-item/index.d.vue.ts +2 -2
- package/dist/components/list-item/index.vue +45 -40
- package/dist/components/loading-bar/index.vue +9 -8
- package/dist/components/material/index.vue +24 -46
- package/dist/components/menu/index.d.vue.ts +6 -8
- package/dist/components/menu/index.vue +18 -24
- package/dist/components/menu/types.d.ts +1 -2
- package/dist/components/message/composables/use-group-expand.d.ts +13 -0
- package/dist/components/message/composables/use-group-expand.js +50 -0
- package/dist/components/message/composables/use-message-timer.d.ts +9 -0
- package/dist/components/message/composables/use-message-timer.js +61 -0
- package/dist/components/message/composables/use-promise-message.d.ts +4 -0
- package/dist/components/message/composables/use-promise-message.js +49 -0
- package/dist/components/message/index.d.vue.ts +6 -33
- package/dist/components/message/index.vue +33 -185
- package/dist/components/message/types.d.ts +2 -2
- package/dist/components/message-item/index.vue +26 -2
- package/dist/components/modal/index.d.vue.ts +7 -7
- package/dist/components/modal/index.vue +7 -3
- package/dist/components/modal/types.d.ts +7 -3
- package/dist/components/note/index.vue +3 -3
- package/dist/components/number-input/index.d.vue.ts +5 -4
- package/dist/components/number-input/index.vue +3 -0
- package/dist/components/number-input/types.d.ts +1 -0
- package/dist/components/overlay/index.d.vue.ts +6 -3
- package/dist/components/overlay/index.vue +63 -68
- package/dist/components/overlay/types.d.ts +5 -4
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pin-input/index.d.vue.ts +2 -2
- package/dist/components/pin-input/index.vue +9 -8
- package/dist/components/placeholder/index.vue +14 -12
- package/dist/components/popover/index.d.vue.ts +8 -9
- package/dist/components/popover/index.vue +150 -240
- package/dist/components/popover/types.d.ts +6 -7
- package/dist/components/progress/index.vue +3 -3
- package/dist/components/project-banner/index.vue +1 -1
- package/dist/components/radio/index.vue +3 -3
- package/dist/components/radio-group/index.vue +1 -1
- package/dist/components/resizable/index.vue +43 -51
- package/dist/components/resizable/types.d.ts +1 -1
- package/dist/components/resizable-handle/index.d.vue.ts +4 -1
- package/dist/components/resizable-handle/index.vue +29 -3
- package/dist/components/resizable-panel/index.vue +3 -7
- package/dist/components/scalable-text/index.d.vue.ts +9 -0
- package/dist/components/scalable-text/index.vue +147 -0
- package/dist/components/scalable-text/types.d.ts +12 -0
- package/dist/components/scrollable/index.d.vue.ts +2 -2
- package/dist/components/scrollable/index.vue +4 -3
- package/dist/components/scrollable/types.d.ts +1 -2
- package/dist/components/separator/index.d.vue.ts +6 -0
- package/dist/components/separator/index.vue +18 -0
- package/dist/components/separator/types.d.ts +5 -0
- package/dist/components/skeleton/index.d.vue.ts +1 -1
- package/dist/components/skeleton/index.vue +1 -1
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +41 -9
- package/dist/components/snippet/index.vue +18 -15
- package/dist/components/spinner/index.vue +3 -1
- package/dist/components/stack/index.d.vue.ts +1 -1
- package/dist/components/stack/index.vue +2 -2
- package/dist/components/switch/index.d.vue.ts +1 -1
- package/dist/components/switch/index.vue +5 -4
- package/dist/components/switch-item/index.vue +3 -3
- package/dist/components/tabs/index.d.vue.ts +12 -0
- package/dist/components/tabs/index.vue +270 -0
- package/dist/components/tabs/types.d.ts +12 -0
- package/dist/components/tabs-item/index.d.vue.ts +4 -0
- package/dist/components/tabs-item/index.vue +16 -0
- package/dist/components/tabs-item/types.d.ts +10 -0
- package/dist/components/text/index.vue +2 -2
- package/dist/components/textarea/index.d.vue.ts +2 -2
- package/dist/components/textarea/index.vue +3 -3
- package/dist/components/time-picker/index.d.vue.ts +3 -5
- package/dist/components/time-picker/index.vue +54 -46
- package/dist/components/time-picker/types.d.ts +1 -2
- package/dist/components/toggle/index.d.vue.ts +0 -2
- package/dist/components/toggle/index.vue +7 -7
- package/dist/components/toggle-button/index.vue +11 -9
- package/dist/components/toggle-button-group/index.vue +3 -3
- package/dist/components/tooltip/index.d.vue.ts +1 -1
- package/dist/components/tooltip/index.vue +19 -11
- package/dist/components/tooltip/types.d.ts +2 -3
- package/dist/components/virtual-list/index.d.vue.ts +8 -8
- package/dist/components/virtual-list/index.vue +29 -7
- package/dist/components/virtual-list/types.d.ts +3 -0
- package/dist/composables/index.d.ts +4 -1
- package/dist/composables/index.js +4 -1
- package/dist/composables/use-browser-observer.d.ts +1 -1
- package/dist/composables/use-browser-observer.js +2 -2
- package/dist/composables/use-client-online.js +2 -2
- package/dist/composables/use-color-scheme.js +2 -2
- package/dist/composables/use-countdown.js +3 -2
- package/dist/composables/use-deferred-value.js +2 -2
- package/dist/composables/use-delay-destroy.d.ts +1 -1
- package/dist/composables/use-delay-destroy.js +11 -6
- package/dist/composables/use-document-hidden.js +2 -2
- package/dist/composables/use-focus-trap.d.ts +1 -1
- package/dist/composables/use-focus-trap.js +2 -2
- package/dist/composables/use-list-filter.d.ts +11 -0
- package/dist/composables/use-list-filter.js +56 -0
- package/dist/composables/use-list-navigation.d.ts +27 -0
- package/dist/composables/use-list-navigation.js +159 -0
- package/dist/composables/use-lock-scroll.js +12 -12
- package/dist/composables/use-media-query.js +2 -2
- package/dist/composables/use-message.d.ts +1 -1
- package/dist/composables/use-outside-click.d.ts +1 -1
- package/dist/composables/use-outside-click.js +8 -11
- package/dist/composables/use-overlay-manager.d.ts +18 -0
- package/dist/composables/use-overlay-manager.js +80 -0
- package/dist/composables/use-popover-responsive.d.ts +6 -8
- package/dist/composables/use-popover-responsive.js +9 -12
- package/dist/composables/use-repeat-action.d.ts +1 -1
- package/dist/composables/use-repeat-action.js +2 -2
- package/dist/composables/use-swipe-gesture.d.ts +65 -0
- package/dist/composables/use-swipe-gesture.js +99 -0
- package/dist/composables/use-virtual-list.d.ts +6 -4
- package/dist/composables/use-virtual-list.js +25 -14
- package/dist/composables/use-window-size.js +2 -2
- package/dist/constants/size.d.ts +12 -0
- package/dist/constants/size.js +12 -0
- package/dist/contexts/button.d.ts +5 -0
- package/dist/contexts/button.js +5 -0
- package/dist/contexts/carousel.d.ts +3 -2
- package/dist/contexts/checkbox.d.ts +1 -1
- package/dist/contexts/choicebox.d.ts +1 -1
- package/dist/contexts/collapse.d.ts +1 -1
- package/dist/contexts/list.d.ts +23 -3
- package/dist/contexts/list.js +6 -2
- package/dist/contexts/radio.d.ts +1 -1
- package/dist/contexts/resizable.d.ts +3 -11
- package/dist/contexts/switch.d.ts +1 -1
- package/dist/contexts/tabs.d.ts +15 -0
- package/dist/contexts/tabs.js +2 -0
- package/dist/contexts/toggle-button.d.ts +1 -1
- package/dist/locales/en-us.d.ts +4 -4
- package/dist/locales/en-us.js +4 -4
- package/dist/locales/zh-cn.d.ts +4 -4
- package/dist/locales/zh-cn.js +4 -4
- package/dist/plugins/dayjs-millisecond-token.js +1 -1
- package/dist/styles/source.css +133 -128
- package/dist/styles/styles.css +2 -2
- package/dist/styles/tw.css +133 -128
- package/dist/types/shared/props.d.ts +1 -0
- package/dist/types/shared/utils.d.ts +1 -4
- package/dist/utils/date.d.ts +3 -3
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.js +4 -0
- package/dist/utils/event.d.ts +2 -1
- package/dist/utils/event.js +7 -1
- package/dist/utils/format.d.ts +3 -3
- package/dist/utils/format.js +5 -4
- package/dist/utils/fuzzy-search.d.ts +7 -0
- package/dist/utils/fuzzy-search.js +61 -0
- package/dist/utils/get.d.ts +2 -0
- package/dist/utils/get.js +15 -1
- package/dist/utils/index.d.ts +10 -11
- package/dist/utils/index.js +2 -3
- package/dist/utils/ref.d.ts +2 -2
- package/dist/utils/{throttle.d.ts → timing.d.ts} +1 -0
- package/dist/utils/{throttle.js → timing.js} +4 -2
- package/package.json +67 -63
- package/volar.d.ts +7 -0
- package/dist/components/overlay/overlay-stack.d.ts +0 -3
- package/dist/components/overlay/overlay-stack.js +0 -17
- package/dist/composables/use-pointer-gesture.d.ts +0 -180
- package/dist/composables/use-pointer-gesture.js +0 -406
- package/dist/utils/debounce.d.ts +0 -1
- package/dist/utils/debounce.js +0 -1
- package/dist/utils/regexp.d.ts +0 -8
- package/dist/utils/regexp.js +0 -8
- package/dist/utils/responsive.d.ts +0 -3
- package/dist/utils/responsive.js +0 -14
package/dist/styles/tw.css
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
--background-100-value: 0, 0%, 100%;
|
|
5
5
|
--background-200-value: 0, 0%, 97%;
|
|
6
6
|
|
|
7
|
-
--color-gray-alpha-100-value:
|
|
8
|
-
--color-gray-alpha-200-value:
|
|
9
|
-
--color-gray-alpha-300-value:
|
|
10
|
-
--color-gray-alpha-400-value:
|
|
11
|
-
--color-gray-alpha-500-value:
|
|
12
|
-
--color-gray-alpha-600-value:
|
|
13
|
-
--color-gray-alpha-700-value:
|
|
14
|
-
--color-gray-alpha-800-value:
|
|
15
|
-
--color-gray-alpha-900-value:
|
|
16
|
-
--color-gray-alpha-1000-value:
|
|
7
|
+
--color-gray-alpha-100-value: #0000000d;
|
|
8
|
+
--color-gray-alpha-200-value: #00000015;
|
|
9
|
+
--color-gray-alpha-300-value: #0000001f;
|
|
10
|
+
--color-gray-alpha-400-value: #0000002b;
|
|
11
|
+
--color-gray-alpha-500-value: #00000036;
|
|
12
|
+
--color-gray-alpha-600-value: #00000057;
|
|
13
|
+
--color-gray-alpha-700-value: #00000070;
|
|
14
|
+
--color-gray-alpha-800-value: #00000082;
|
|
15
|
+
--color-gray-alpha-900-value: #0000009c;
|
|
16
|
+
--color-gray-alpha-1000-value: #000000e8;
|
|
17
17
|
|
|
18
18
|
--color-gray-100-value: 0, 0%, 95%;
|
|
19
19
|
--color-gray-200-value: 0, 0%, 93%;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
--color-gray-600-value: 0, 0%, 66%;
|
|
24
24
|
--color-gray-700-value: 0, 0%, 56%;
|
|
25
25
|
--color-gray-800-value: 0, 0%, 49%;
|
|
26
|
-
--color-gray-900-value: 0, 0%,
|
|
26
|
+
--color-gray-900-value: 0, 0%, 30%;
|
|
27
27
|
--color-gray-1000-value: 0, 0%, 9%;
|
|
28
28
|
|
|
29
29
|
--color-blue-100-value: 212, 100%, 97%;
|
|
@@ -108,29 +108,42 @@
|
|
|
108
108
|
--primary-active: hsla(var(--primary), 90%);
|
|
109
109
|
|
|
110
110
|
--radius: 0.5rem;
|
|
111
|
-
--duration: 0.
|
|
111
|
+
--duration: 0.2s;
|
|
112
112
|
--timing-function: ease-out;
|
|
113
113
|
--ring: var(--primary);
|
|
114
114
|
|
|
115
|
-
--shadow-border
|
|
116
|
-
--shadow-border-
|
|
117
|
-
--shadow-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
--shadow-
|
|
121
|
-
|
|
122
|
-
0px 8px
|
|
123
|
-
--shadow-
|
|
124
|
-
|
|
125
|
-
--shadow-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
--
|
|
132
|
-
|
|
133
|
-
|
|
115
|
+
--shadow-background-border: 0 0 0 1px hsl(var(--background-200-value));
|
|
116
|
+
--shadow-border-value: 0 0 0 1px #00000014;
|
|
117
|
+
--shadow-small-value: 0px 2px 2px #0000000a;
|
|
118
|
+
--shadow-medium-value: 0px 2px 2px #0000000a, 0px 8px 8px -8px #0000000a;
|
|
119
|
+
--shadow-large-value: 0px 2px 2px #0000000a, 0px 8px 16px -4px #0000000a;
|
|
120
|
+
--shadow-tooltip-value: 0px 1px 1px #00000005, 0px 4px 8px #0000000a;
|
|
121
|
+
--shadow-menu-value:
|
|
122
|
+
0px 1px 1px #00000005, 0px 4px 8px -4px #0000000a, 0px 16px 24px -8px #0000000f;
|
|
123
|
+
--shadow-modal-value:
|
|
124
|
+
0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
|
|
125
|
+
--shadow-fullscreen-value:
|
|
126
|
+
0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
|
|
127
|
+
|
|
128
|
+
/* component variables defaults */
|
|
129
|
+
--pxd-initial-index: 10;
|
|
130
|
+
--active-graph-item-radius: 0.125rem;
|
|
131
|
+
--avatar-size: 2rem;
|
|
132
|
+
--chip-size: 0.75rem;
|
|
133
|
+
--fader-size: 1rem;
|
|
134
|
+
--fader-color: var(--color-gray-100);
|
|
135
|
+
--hold-button-durations: 2000ms;
|
|
136
|
+
--hold-button-progress-color: var(--color-gray-alpha-600);
|
|
137
|
+
--popover-arrow-color: var(--color-gray-1000);
|
|
138
|
+
--popover-offset: 8;
|
|
139
|
+
--popover-scale: 0.95;
|
|
140
|
+
--popover-index: max(var(--pxd-initial-index), 10);
|
|
141
|
+
--overlay-index: calc(var(--popover-index) - 5);
|
|
142
|
+
--modal-index: calc(var(--overlay-index) + 5);
|
|
143
|
+
--modal-width: 33.75rem;
|
|
144
|
+
--placeholder-gap: 0.75rem;
|
|
145
|
+
--toggle-active-color: var(--color-primary);
|
|
146
|
+
--toggle-inactive-color: var(--color-gray-alpha-100);
|
|
134
147
|
|
|
135
148
|
-webkit-tap-highlight-color: transparent;
|
|
136
149
|
text-rendering: optimizeLegibility;
|
|
@@ -150,16 +163,16 @@
|
|
|
150
163
|
--background-100-value: 0, 0%, 5%;
|
|
151
164
|
--background-200-value: 0, 0%, 0%;
|
|
152
165
|
|
|
153
|
-
--color-gray-alpha-100-value:
|
|
154
|
-
--color-gray-alpha-200-value:
|
|
155
|
-
--color-gray-alpha-300-value:
|
|
156
|
-
--color-gray-alpha-400-value:
|
|
157
|
-
--color-gray-alpha-500-value:
|
|
158
|
-
--color-gray-alpha-600-value:
|
|
159
|
-
--color-gray-alpha-700-value:
|
|
160
|
-
--color-gray-alpha-800-value:
|
|
161
|
-
--color-gray-alpha-900-value:
|
|
162
|
-
--color-gray-alpha-1000-value:
|
|
166
|
+
--color-gray-alpha-100-value: #ffffff0f;
|
|
167
|
+
--color-gray-alpha-200-value: #ffffff17;
|
|
168
|
+
--color-gray-alpha-300-value: #ffffff21;
|
|
169
|
+
--color-gray-alpha-400-value: #ffffff24;
|
|
170
|
+
--color-gray-alpha-500-value: #ffffff3d;
|
|
171
|
+
--color-gray-alpha-600-value: #ffffff82;
|
|
172
|
+
--color-gray-alpha-700-value: #ffffff8a;
|
|
173
|
+
--color-gray-alpha-800-value: #ffffff78;
|
|
174
|
+
--color-gray-alpha-900-value: #ffffff9c;
|
|
175
|
+
--color-gray-alpha-1000-value: #ffffffeb;
|
|
163
176
|
|
|
164
177
|
--color-gray-100-value: 0, 0%, 10%;
|
|
165
178
|
--color-gray-200-value: 0, 0%, 12%;
|
|
@@ -249,27 +262,17 @@
|
|
|
249
262
|
--color-pink-900-value: 341, 90%, 67%;
|
|
250
263
|
--color-pink-1000-value: 333, 90%, 96%;
|
|
251
264
|
|
|
252
|
-
--shadow-border-
|
|
253
|
-
--shadow-
|
|
254
|
-
|
|
255
|
-
--shadow-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
0px 8px 16px -4px
|
|
261
|
-
--shadow-
|
|
262
|
-
|
|
263
|
-
0px 4px 8px rgba(0, 0, 0, 0.04);
|
|
264
|
-
--shadow-border-menu-value:
|
|
265
|
-
0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
|
|
266
|
-
0px 4px 8px -4px rgba(0, 0, 0, 0.04), 0px 16px 24px -8px rgba(0, 0, 0, 0.06);
|
|
267
|
-
--shadow-border-modal-value:
|
|
268
|
-
0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
|
|
269
|
-
0px 8px 16px -4px rgba(0, 0, 0, 0.04), 0px 24px 32px -8px rgba(0, 0, 0, 0.06);
|
|
270
|
-
--shadow-border-fullscreen-value:
|
|
271
|
-
0 0 0 1px rgba(255, 255, 255, 0.145), 0px 1px 1px rgba(0, 0, 0, 0.02),
|
|
272
|
-
0px 8px 16px -4px rgba(0, 0, 0, 0.04), 0px 24px 32px -8px rgba(0, 0, 0, 0.06);
|
|
265
|
+
--shadow-border-value: 0 0 0 1px #ffffff25;
|
|
266
|
+
--shadow-small-value: 0px 1px 2px #00000029;
|
|
267
|
+
--shadow-medium-value: 0px 2px 2px #00000052, 0px 8px 8px -8px #00000029;
|
|
268
|
+
--shadow-large-value: 0px 2px 2px #0000000a, 0px 8px 16px -4px #0000000a;
|
|
269
|
+
--shadow-tooltip-value: 0px 1px 1px #00000005, 0px 4px 8px #0000000a;
|
|
270
|
+
--shadow-menu-value:
|
|
271
|
+
0px 1px 1px #00000005, 0px 4px 8px -4px #0000000a, 0px 16px 24px -8px #0000000f;
|
|
272
|
+
--shadow-modal-value:
|
|
273
|
+
0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
|
|
274
|
+
--shadow-fullscreen-value:
|
|
275
|
+
0px 1px 1px #00000005, 0px 8px 16px -4px #0000000a, 0px 24px 32px -8px #0000000f;
|
|
273
276
|
|
|
274
277
|
color-scheme: dark;
|
|
275
278
|
}
|
|
@@ -284,15 +287,14 @@
|
|
|
284
287
|
|
|
285
288
|
@theme inline {
|
|
286
289
|
--font-sans:
|
|
287
|
-
'Inter', 'Inter Fallback', 'Geist', ui-sans-serif, system-ui, sans-serif,
|
|
288
|
-
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
290
|
+
'Inter', 'Inter Fallback', 'Geist', Arial, ui-sans-serif, system-ui, sans-serif,
|
|
291
|
+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
289
292
|
|
|
290
293
|
--color-primary: hsl(var(--primary));
|
|
291
294
|
--color-primary-hover: var(--primary-hover);
|
|
292
295
|
--color-primary-active: var(--primary-active);
|
|
293
296
|
|
|
294
|
-
--color-
|
|
295
|
-
--color-border: hsl(var(--color-gray-300-value));
|
|
297
|
+
--color-border: var(--color-gray-alpha-300-value);
|
|
296
298
|
--color-border-hover: hsl(var(--color-gray-500-value));
|
|
297
299
|
--color-border-active: hsl(var(--color-gray-600-value));
|
|
298
300
|
|
|
@@ -301,7 +303,7 @@
|
|
|
301
303
|
--color-background-100: hsl(var(--background-100-value));
|
|
302
304
|
--color-background-200: hsl(var(--background-200-value));
|
|
303
305
|
--color-background-hover: hsl(var(--color-gray-200-value));
|
|
304
|
-
--color-background-active: hsl(var(--color-gray-
|
|
306
|
+
--color-background-active: hsl(var(--color-gray-300-value));
|
|
305
307
|
|
|
306
308
|
--color-gray-alpha-100: var(--color-gray-alpha-100-value);
|
|
307
309
|
--color-gray-alpha-200: var(--color-gray-alpha-200-value);
|
|
@@ -404,6 +406,7 @@
|
|
|
404
406
|
|
|
405
407
|
--default-transition-duration: var(--duration);
|
|
406
408
|
--default-transition-timing-function: var(--timing-function);
|
|
409
|
+
--faster-transition-duration: calc(var(--duration) * 0.7);
|
|
407
410
|
|
|
408
411
|
--z-1: 1;
|
|
409
412
|
--spacing-em: 1em;
|
|
@@ -415,17 +418,32 @@
|
|
|
415
418
|
--radius-xl: calc(var(--radius) + 4px);
|
|
416
419
|
--radius-inherit: inherit;
|
|
417
420
|
|
|
418
|
-
--shadow-
|
|
419
|
-
--shadow-
|
|
420
|
-
--shadow-
|
|
421
|
-
--shadow-
|
|
422
|
-
--shadow-
|
|
423
|
-
--shadow-
|
|
424
|
-
--shadow-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
--
|
|
428
|
-
|
|
421
|
+
--shadow-small: var(--shadow-small-value);
|
|
422
|
+
--shadow-medium: var(--shadow-medium-value);
|
|
423
|
+
--shadow-large: var(--shadow-large-value);
|
|
424
|
+
--shadow-tooltip: var(--shadow-tooltip-value);
|
|
425
|
+
--shadow-menu: var(--shadow-menu-value);
|
|
426
|
+
--shadow-modal: var(--shadow-modal-value);
|
|
427
|
+
--shadow-fullscreen: var(--shadow-fullscreen-value);
|
|
428
|
+
|
|
429
|
+
--shadow-border-base: var(--shadow-border-value);
|
|
430
|
+
--shadow-border-small:
|
|
431
|
+
var(--shadow-border-value), var(--shadow-small-value), var(--shadow-background-border);
|
|
432
|
+
--shadow-border-medium:
|
|
433
|
+
var(--shadow-border-value), var(--shadow-medium-value), var(--shadow-background-border);
|
|
434
|
+
--shadow-border-large:
|
|
435
|
+
var(--shadow-border-value), var(--shadow-large-value), var(--shadow-background-border);
|
|
436
|
+
--shadow-border-tooltip:
|
|
437
|
+
var(--shadow-border-value), var(--shadow-tooltip-value), var(--shadow-background-border);
|
|
438
|
+
--shadow-border-menu:
|
|
439
|
+
var(--shadow-border-value), var(--shadow-menu-value), var(--shadow-background-border);
|
|
440
|
+
--shadow-border-modal:
|
|
441
|
+
var(--shadow-border-value), var(--shadow-modal-value), var(--shadow-background-border);
|
|
442
|
+
--shadow-border-fullscreen:
|
|
443
|
+
var(--shadow-border-value), var(--shadow-fullscreen-value), var(--shadow-background-border);
|
|
444
|
+
|
|
445
|
+
--text-13: 13px;
|
|
446
|
+
--text-15: 15px;
|
|
429
447
|
}
|
|
430
448
|
|
|
431
449
|
@utility default-animation-duration {
|
|
@@ -456,20 +474,30 @@
|
|
|
456
474
|
}
|
|
457
475
|
}
|
|
458
476
|
|
|
477
|
+
@utility self-focus-ring {
|
|
478
|
+
& {
|
|
479
|
+
outline-offset: 2px;
|
|
480
|
+
}
|
|
481
|
+
&:focus-visible {
|
|
482
|
+
outline: 2px solid hsl(var(--ring));
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
459
486
|
@utility peer-focus-ring {
|
|
487
|
+
& {
|
|
488
|
+
outline-offset: 2px;
|
|
489
|
+
}
|
|
490
|
+
|
|
460
491
|
.peer:focus-visible ~ & {
|
|
461
|
-
|
|
462
|
-
0 0 0 2px var(--color-background-100),
|
|
463
|
-
0 0 0 4px hsl(var(--ring));
|
|
492
|
+
outline: 2px solid hsl(var(--ring));
|
|
464
493
|
}
|
|
465
494
|
}
|
|
466
495
|
|
|
467
|
-
@utility
|
|
468
|
-
|
|
469
|
-
box-shadow
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
496
|
+
@utility transition-appearance {
|
|
497
|
+
transition-property:
|
|
498
|
+
opacity, transform, translate, background-color, box-shadow, font-size, border, color;
|
|
499
|
+
transition-duration: var(--default-transition-duration);
|
|
500
|
+
transition-timing-function: var(--default-transition-timing-function);
|
|
473
501
|
}
|
|
474
502
|
|
|
475
503
|
@utility visually-hidden {
|
|
@@ -481,7 +509,6 @@
|
|
|
481
509
|
overflow: hidden;
|
|
482
510
|
clip: rect(0, 0, 0, 0);
|
|
483
511
|
white-space: nowrap;
|
|
484
|
-
visibility: hidden;
|
|
485
512
|
border-width: 0;
|
|
486
513
|
opacity: 0;
|
|
487
514
|
}
|
|
@@ -498,39 +525,24 @@
|
|
|
498
525
|
font-family: inherit;
|
|
499
526
|
}
|
|
500
527
|
|
|
501
|
-
@utility dvh-* {
|
|
502
|
-
height: calc(--value(integer) * 1vh);
|
|
503
|
-
|
|
504
|
-
@supports (height: 1dvh) {
|
|
505
|
-
height: calc(--value(integer) * 1dvh);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
@utility max-dvh-* {
|
|
510
|
-
max-height: calc(--value(integer) * 1vh);
|
|
511
|
-
|
|
512
|
-
@supports (height: 1dvh) {
|
|
513
|
-
max-height: calc(--value(integer) * 1dvh);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
528
|
@layer base {
|
|
518
529
|
* {
|
|
519
|
-
|
|
530
|
+
border-color: var(--color-gray-300);
|
|
520
531
|
}
|
|
521
532
|
}
|
|
522
533
|
|
|
523
534
|
@layer components {
|
|
524
535
|
.pxd-input--border {
|
|
525
|
-
border: 1px
|
|
536
|
+
border-width: 1px;
|
|
537
|
+
border-style: solid;
|
|
526
538
|
|
|
527
539
|
&:not(.is-disabled, .is-readonly):hover {
|
|
528
|
-
|
|
540
|
+
border-color: hsla(var(--primary), 0.5);
|
|
529
541
|
}
|
|
530
542
|
|
|
531
543
|
&:not(.is-disabled, .is-readonly)[data-focusing='true'],
|
|
532
544
|
&:not(.is-disabled, .is-readonly):focus-within {
|
|
533
|
-
|
|
545
|
+
border-color: var(--color-primary);
|
|
534
546
|
box-shadow: 0 0 0 3px hsla(var(--primary), 0.2);
|
|
535
547
|
}
|
|
536
548
|
|
|
@@ -542,43 +554,28 @@
|
|
|
542
554
|
&,
|
|
543
555
|
&:focus-within,
|
|
544
556
|
&[data-focusing='true'] {
|
|
545
|
-
|
|
557
|
+
border-color: hsl(var(--color-red-900-value));
|
|
546
558
|
box-shadow: 0 0 0 3px hsl(var(--color-red-300-value));
|
|
547
559
|
}
|
|
548
560
|
|
|
549
561
|
&:focus-within,
|
|
550
562
|
&[data-focusing='true'],
|
|
551
563
|
&:not(.is-disabled, .is-readonly):hover {
|
|
552
|
-
|
|
564
|
+
border-color: hsl(var(--color-red-900-value));
|
|
553
565
|
box-shadow: 0 0 0 3px hsl(var(--color-red-500-value));
|
|
554
566
|
}
|
|
555
567
|
}
|
|
556
568
|
}
|
|
557
569
|
}
|
|
558
570
|
|
|
559
|
-
.pxd-container-mask::after {
|
|
560
|
-
content: '';
|
|
561
|
-
position: absolute;
|
|
562
|
-
inset: 0;
|
|
563
|
-
background: rgba(0, 0, 0, 0.4);
|
|
564
|
-
transition: opacity var(--default-transition-duration) var(--default-transition-timing-function);
|
|
565
|
-
pointer-events: none;
|
|
566
|
-
will-change: opacity;
|
|
567
|
-
z-index: 0;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
[class*='pxd-transition--'] {
|
|
571
|
-
transition-duration: var(--default-transition-duration);
|
|
572
|
-
transition-timing-function: var(--default-transition-timing-function);
|
|
573
|
-
}
|
|
574
|
-
|
|
575
571
|
.pxd-transition--fade-enter-active,
|
|
576
572
|
.pxd-transition--fade-leave-active {
|
|
577
573
|
transition-property: opacity;
|
|
574
|
+
transition-duration: var(--default-transition-duration);
|
|
575
|
+
transition-timing-function: var(--default-transition-timing-function);
|
|
578
576
|
will-change: opacity;
|
|
579
577
|
}
|
|
580
578
|
|
|
581
|
-
.pxd-container-mask[data-visible='false']::after,
|
|
582
579
|
.pxd-transition--fade-enter-from,
|
|
583
580
|
.pxd-transition--fade-leave-to {
|
|
584
581
|
opacity: 0;
|
|
@@ -588,13 +585,21 @@
|
|
|
588
585
|
.pxd-transition--fade-scale-enter-active,
|
|
589
586
|
.pxd-transition--fade-scale-leave-active {
|
|
590
587
|
transition-property: opacity, transform, filter;
|
|
588
|
+
transition-duration: var(--default-transition-duration);
|
|
589
|
+
transition-timing-function: var(--default-transition-timing-function);
|
|
591
590
|
will-change: opacity, transform, filter;
|
|
592
591
|
}
|
|
593
592
|
|
|
594
593
|
.pxd-transition--fade-scale-enter-from,
|
|
595
594
|
.pxd-transition--fade-scale-leave-to {
|
|
596
595
|
opacity: 0;
|
|
597
|
-
|
|
596
|
+
filter: blur(5px);
|
|
597
|
+
transform: scale(0.75);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/* Make exit faster than enter */
|
|
601
|
+
[class*='pxd-transition--'][class*='-leave-active'] {
|
|
602
|
+
transition-duration: var(--faster-transition-duration) !important;
|
|
598
603
|
}
|
|
599
604
|
|
|
600
605
|
/*
|
|
@@ -16,6 +16,7 @@ export type ComponentValue = string | number | boolean
|
|
|
16
16
|
|
|
17
17
|
export type ComponentClass = string | any[] | Record<string, any>
|
|
18
18
|
|
|
19
|
+
export type ComponentAlign = 'left' | 'center' | 'right'
|
|
19
20
|
export type ComponentDirection = 'horizontal' | 'vertical'
|
|
20
21
|
|
|
21
22
|
export type BasePosition = 'top' | 'bottom' | 'left' | 'right'
|
|
@@ -3,10 +3,7 @@ import type { ComponentPublicInstance, MaybeRefOrGetter } from 'vue'
|
|
|
3
3
|
export type Awaitable<T> = T | PromiseLike<T>
|
|
4
4
|
export type Callback = (...args: any[]) => any
|
|
5
5
|
export type Nullable<T> = T | null | undefined
|
|
6
|
-
export type Numeric = number | `${number}`
|
|
7
|
-
|
|
8
|
-
// e.g.: 10 | '10' | '10px' | '-10px'
|
|
9
|
-
export type CSSValue = Numeric | CSSUnitValue
|
|
6
|
+
// export type Numeric = number | `${number}`
|
|
10
7
|
|
|
11
8
|
export type MaybeElement = Nullable<HTMLElement | SVGElement | ComponentPublicInstance>
|
|
12
9
|
export type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<Nullable<T>>
|
package/dist/utils/date.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare function getAllDatesBetween(startDate: Date | string, endDate: Da
|
|
|
20
20
|
* @returns 天数、第一天是周几、最后一天是周几
|
|
21
21
|
*/
|
|
22
22
|
export declare function getMonthDays(year: number, month: number): {
|
|
23
|
-
days:
|
|
24
|
-
firstDay:
|
|
25
|
-
lastDay:
|
|
23
|
+
days: number;
|
|
24
|
+
firstDay: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
25
|
+
lastDay: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
26
26
|
};
|
package/dist/utils/dom.d.ts
CHANGED
|
@@ -39,3 +39,4 @@ export interface ScrollbarSize {
|
|
|
39
39
|
export declare function getScrollbarSize(element?: HTMLElement): ScrollbarSize;
|
|
40
40
|
export declare function getViewportRect(): DOMRect;
|
|
41
41
|
export declare function isOverflowScrollable(ele: Element): boolean;
|
|
42
|
+
export declare function awaitAnimationEnd(element?: Element): Promise<void>;
|
package/dist/utils/dom.js
CHANGED
|
@@ -113,3 +113,7 @@ export function isOverflowScrollable(ele) {
|
|
|
113
113
|
}
|
|
114
114
|
return isOverflowScrollable(parent);
|
|
115
115
|
}
|
|
116
|
+
export async function awaitAnimationEnd(element) {
|
|
117
|
+
const animations = element?.getAnimations?.() ?? [];
|
|
118
|
+
await Promise.allSettled(animations.map((a) => a.finished));
|
|
119
|
+
}
|
package/dist/utils/event.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export declare function cachedOff<E extends Event = Event>(el: Nullable<EventTar
|
|
|
9
9
|
export declare function sleep(ms: number): Promise<unknown>;
|
|
10
10
|
export declare function preventDefaultScroll(ev: Event): boolean;
|
|
11
11
|
export declare function raf(fn: FrameRequestCallback): number;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function caf(id: number): void;
|
|
13
|
+
export declare function doubleRaf(fn: FrameRequestCallback): number;
|
|
13
14
|
export {};
|
package/dist/utils/event.js
CHANGED
|
@@ -103,6 +103,12 @@ export function preventDefaultScroll(ev) {
|
|
|
103
103
|
export function raf(fn) {
|
|
104
104
|
return isServer() ? -1 : requestAnimationFrame(fn);
|
|
105
105
|
}
|
|
106
|
+
export function caf(id) {
|
|
107
|
+
if (isServer()) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
cancelAnimationFrame(id);
|
|
111
|
+
}
|
|
106
112
|
export function doubleRaf(fn) {
|
|
107
|
-
raf(() => raf(fn));
|
|
113
|
+
return raf(() => raf(fn));
|
|
108
114
|
}
|
package/dist/utils/format.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Nullable } from '../types/shared/utils';
|
|
2
2
|
/** string -> String */
|
|
3
3
|
export declare function capitalize(text: string): string;
|
|
4
4
|
/** kabab-case -> kababCase */
|
|
@@ -12,8 +12,8 @@ export declare function humanize(text: string): string;
|
|
|
12
12
|
export declare function isTruthyProp(value: unknown): boolean;
|
|
13
13
|
export declare function clampValue(n: number, min: number, max: number): number;
|
|
14
14
|
export declare function isExternalLink(href: string): boolean;
|
|
15
|
-
export declare function toArray(value: unknown
|
|
16
|
-
export declare function getCssUnitValue(value: Nullable<
|
|
15
|
+
export declare function toArray(value: unknown): any[];
|
|
16
|
+
export declare function getCssUnitValue(value: Nullable<string | number>, fallbackValue?: string): string;
|
|
17
17
|
/**
|
|
18
18
|
* Increase string a value with unit
|
|
19
19
|
*
|
package/dist/utils/format.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
const INTEGER_REGEX = /^-?\d+$/;
|
|
2
|
+
const FLOATING_REGEX = /^-?\d+\.?\d*/;
|
|
2
3
|
export function capitalize(text) {
|
|
3
4
|
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
|
|
4
5
|
}
|
|
@@ -47,10 +48,10 @@ export function getCssUnitValue(value, fallbackValue) {
|
|
|
47
48
|
if (value == null || value === "") {
|
|
48
49
|
return fallbackValue;
|
|
49
50
|
}
|
|
50
|
-
if (typeof value === "number" || INTEGER_REGEX.test(value)) {
|
|
51
|
-
return `${value}px`;
|
|
51
|
+
if (typeof value === "number" || INTEGER_REGEX.test(String(value))) {
|
|
52
|
+
return `${String(value)}px`;
|
|
52
53
|
}
|
|
53
|
-
return value;
|
|
54
|
+
return String(value);
|
|
54
55
|
}
|
|
55
56
|
export function increaseWithUnit(target, delta) {
|
|
56
57
|
if (typeof target === "number") {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether `text` or `keywords` matches a user-typed `search` query.
|
|
3
|
+
*
|
|
4
|
+
* Matching is intentionally order-preserving: this helper is used only to
|
|
5
|
+
* decide visibility, not ranking.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isMatch(text: string, search: string, keywords?: string[]): boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export function isMatch(text, search, keywords) {
|
|
2
|
+
if (!search) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
const needle = search.toLowerCase().trim();
|
|
6
|
+
if (!needle) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (text && matchesOne(text.toLowerCase(), needle)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (keywords && keywords.length > 0) {
|
|
13
|
+
for (const kw of keywords) {
|
|
14
|
+
if (kw && matchesOne(kw.toLowerCase(), needle)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
function matchesOne(haystack, needle) {
|
|
22
|
+
if (!haystack) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (haystack === needle) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (haystack.startsWith(needle)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (hasWordBoundaryMatch(haystack, needle)) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (haystack.includes(needle)) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return hasFuzzySubsequenceMatch(haystack, needle);
|
|
38
|
+
}
|
|
39
|
+
function hasWordBoundaryMatch(haystack, needle) {
|
|
40
|
+
let from = 0;
|
|
41
|
+
while (from <= haystack.length) {
|
|
42
|
+
const idx = haystack.indexOf(needle, from);
|
|
43
|
+
if (idx === -1) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (idx === 0 || /\W/.test(haystack[idx - 1])) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
from = idx + 1;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
function hasFuzzySubsequenceMatch(haystack, needle) {
|
|
54
|
+
let ni = 0;
|
|
55
|
+
for (let hi = 0; hi < haystack.length && ni < needle.length; hi++) {
|
|
56
|
+
if (haystack[hi] === needle[ni]) {
|
|
57
|
+
ni++;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return ni >= needle.length;
|
|
61
|
+
}
|
package/dist/utils/get.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { ResponsiveValue } from '../types/shared/props';
|
|
1
2
|
import type { Nullable } from '../types/shared/utils';
|
|
2
3
|
export declare function getFallbackValue<Variants extends Record<string, any>>(variant: Nullable<string>, variants: Variants, defaultVariant?: keyof Variants): any;
|
|
3
4
|
export declare function getColorByThreshold(value: number, colors: Record<string, string>): string;
|
|
4
5
|
type DocumentDirection = 'rtl' | 'ltr' | 'auto';
|
|
5
6
|
export declare function getDocumentDirection(): DocumentDirection;
|
|
6
7
|
export declare function getPlatform(): "linux" | "mac" | "windows";
|
|
8
|
+
export declare function getResponsiveValue<V extends string | number>(prop: ResponsiveValue<V> | undefined, xsValue: Nullable<V>, valueSetter: (acc: Record<string, V>, bp: any, v: V) => void): Record<string, V>;
|
|
7
9
|
export {};
|
package/dist/utils/get.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNil } from "es-toolkit";
|
|
1
2
|
import { isServer } from "./is.js";
|
|
2
3
|
export function getFallbackValue(variant, variants, defaultVariant = "default") {
|
|
3
4
|
return (variant ? variants[variant] : null) ?? variants[defaultVariant];
|
|
@@ -13,7 +14,7 @@ export function getColorByThreshold(value, colors) {
|
|
|
13
14
|
return colors[keys[i - 1]];
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
return colors[keys
|
|
17
|
+
return colors[keys.at(-1)];
|
|
17
18
|
}
|
|
18
19
|
export function getDocumentDirection() {
|
|
19
20
|
if (isServer()) {
|
|
@@ -39,3 +40,16 @@ export function getPlatform() {
|
|
|
39
40
|
}
|
|
40
41
|
return "linux";
|
|
41
42
|
}
|
|
43
|
+
export function getResponsiveValue(prop, xsValue, valueSetter) {
|
|
44
|
+
const formatted = Object.assign(
|
|
45
|
+
isNil(xsValue) ? {} : { xs: xsValue },
|
|
46
|
+
typeof prop === "object" ? prop : {}
|
|
47
|
+
);
|
|
48
|
+
return Object.entries(formatted).reduce(
|
|
49
|
+
(acc, [bp, value]) => {
|
|
50
|
+
valueSetter(acc, bp, value);
|
|
51
|
+
return acc;
|
|
52
|
+
},
|
|
53
|
+
{}
|
|
54
|
+
);
|
|
55
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export * from './context';
|
|
2
|
-
export * from './date';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './uid';
|
|
1
|
+
export * from './context.js';
|
|
2
|
+
export * from './date.js';
|
|
3
|
+
export * from './dom.js';
|
|
4
|
+
export * from './event.js';
|
|
5
|
+
export * from './format.js';
|
|
6
|
+
export * from './get.js';
|
|
7
|
+
export * from './is.js';
|
|
8
|
+
export * from './fuzzy-search.js';
|
|
9
|
+
export * from './uid.js';
|
|
10
|
+
export * from './timing.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export * from "./context.js";
|
|
2
2
|
export * from "./date.js";
|
|
3
|
-
export * from "./debounce.js";
|
|
4
3
|
export * from "./dom.js";
|
|
5
4
|
export * from "./event.js";
|
|
6
5
|
export * from "./format.js";
|
|
7
6
|
export * from "./get.js";
|
|
8
7
|
export * from "./is.js";
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./throttle.js";
|
|
8
|
+
export * from "./fuzzy-search.js";
|
|
11
9
|
export * from "./uid.js";
|
|
10
|
+
export * from "./timing.js";
|