@pathscale/ui 1.1.13 → 1.1.14
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/glass-panel/GlassPanel.js +5 -3
- package/dist/components/select/Select.css +244 -0
- package/dist/components/select/Select.d.ts +44 -13
- package/dist/components/select/Select.js +618 -41
- package/dist/components/select/index.d.ts +2 -1
- package/dist/components/table/EnhancedTable.js +79 -160
- package/dist/components/table/Table.css +50 -9
- package/dist/components/table/Table.d.ts +19 -1
- package/dist/components/table/Table.js +100 -18
- package/dist/components/table/hooks/helpers.d.ts +7 -0
- package/dist/components/table/hooks/helpers.js +26 -0
- package/dist/components/table/hooks/index.d.ts +9 -0
- package/dist/components/table/hooks/index.js +18 -0
- package/dist/components/table/hooks/useAnchoredOverlayPosition.d.ts +16 -0
- package/dist/components/table/hooks/useAnchoredOverlayPosition.js +61 -0
- package/dist/components/table/hooks/useTableExpansion.d.ts +13 -0
- package/dist/components/table/hooks/useTableExpansion.js +17 -0
- package/dist/components/table/hooks/useTableFiltering.d.ts +30 -0
- package/dist/components/table/hooks/useTableFiltering.js +67 -0
- package/dist/components/table/hooks/useTableModel.d.ts +27 -0
- package/dist/components/table/hooks/useTableModel.js +56 -0
- package/dist/components/table/hooks/useTablePagination.d.ts +20 -0
- package/dist/components/table/hooks/useTablePagination.js +48 -0
- package/dist/components/table/hooks/useTableSelection.d.ts +14 -0
- package/dist/components/table/hooks/useTableSelection.js +17 -0
- package/dist/components/table/hooks/useTableSorting.d.ts +19 -0
- package/dist/components/table/hooks/useTableSorting.js +21 -0
- package/dist/components/table/index.d.ts +4 -2
- package/dist/components/table/index.js +13 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -1
- package/package.json +2 -1
- package/dist/components/select/select.css +0 -351
|
@@ -2,7 +2,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web
|
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_clsx__ from "clsx";
|
|
5
|
-
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button class="flex w-full items-center justify-between gap-2 px-4 py-3 text-sm font-medium cursor-pointer select-none transition-colors duration-150 text-base-content/50 hover:text-base-content/80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"><span class="flex items-center gap-2"></span><svg fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=1.5><path stroke-linecap=round stroke-linejoin=round d="M19 9l-7 7-7-7">'), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div><div
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button class="flex w-full items-center justify-between gap-2 px-4 py-3 text-sm font-medium cursor-pointer select-none transition-colors duration-150 text-base-content/50 hover:text-base-content/80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"><span class="flex items-center gap-2"></span><svg fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=1.5><path stroke-linecap=round stroke-linejoin=round d="M19 9l-7 7-7-7">'), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div><div>");
|
|
6
6
|
const BLUR_MAP = {
|
|
7
7
|
none: "",
|
|
8
8
|
sm: "backdrop-blur-sm",
|
|
@@ -126,15 +126,17 @@ const GlassPanel = (props)=>{
|
|
|
126
126
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$5, "id", contentId);
|
|
127
127
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, ()=>local.children);
|
|
128
128
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
129
|
-
var _v$3 = `grid transition-[grid-template-rows,opacity] duration-200 ease-in-out overflow-hidden ${local.collapsible && !isOpen() ? "" : contentClasses()}`, _v$4 = !local.collapsible || isOpen() ? "1fr" : "0fr", _v$5 = !local.collapsible || isOpen() ? "1" : "0";
|
|
129
|
+
var _v$3 = `grid transition-[grid-template-rows,opacity] duration-200 ease-in-out ${local.collapsible ? "overflow-hidden" : ""} ${local.collapsible && !isOpen() ? "" : contentClasses()}`, _v$4 = !local.collapsible || isOpen() ? "1fr" : "0fr", _v$5 = !local.collapsible || isOpen() ? "1" : "0", _v$6 = local.collapsible ? "overflow-hidden" : "";
|
|
130
130
|
_v$3 !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$5, _p$.e = _v$3);
|
|
131
131
|
_v$4 !== _p$.t && (null != (_p$.t = _v$4) ? _el$5.style.setProperty("grid-template-rows", _v$4) : _el$5.style.removeProperty("grid-template-rows"));
|
|
132
132
|
_v$5 !== _p$.a && (null != (_p$.a = _v$5) ? _el$5.style.setProperty("opacity", _v$5) : _el$5.style.removeProperty("opacity"));
|
|
133
|
+
_v$6 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$6, _p$.o = _v$6);
|
|
133
134
|
return _p$;
|
|
134
135
|
}, {
|
|
135
136
|
e: void 0,
|
|
136
137
|
t: void 0,
|
|
137
|
-
a: void 0
|
|
138
|
+
a: void 0,
|
|
139
|
+
o: void 0
|
|
138
140
|
});
|
|
139
141
|
return _el$;
|
|
140
142
|
})();
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ui-select {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 0.25rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ui-select--full-width {
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ui-select__trigger {
|
|
14
|
+
position: relative;
|
|
15
|
+
isolation: isolate;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
min-height: 2.25rem;
|
|
18
|
+
width: fit-content;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
gap: 0.5rem;
|
|
22
|
+
border-radius: 1rem;
|
|
23
|
+
border: 1px solid var(--color-field-border, var(--color-base-300));
|
|
24
|
+
background-color: var(--color-field, var(--color-base-100));
|
|
25
|
+
padding: 0.5rem 0.75rem;
|
|
26
|
+
text-align: left;
|
|
27
|
+
font-size: 0.875rem;
|
|
28
|
+
line-height: 1.25;
|
|
29
|
+
color: var(--color-field-foreground, var(--color-base-content));
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
user-select: none;
|
|
32
|
+
outline: none;
|
|
33
|
+
box-shadow:
|
|
34
|
+
0 1px 2px oklch(0% 0 0 / 0.06),
|
|
35
|
+
0 1px 0 oklch(100% 0 0 / 0.04) inset;
|
|
36
|
+
transition:
|
|
37
|
+
background-color 150ms ease,
|
|
38
|
+
border-color 150ms ease,
|
|
39
|
+
box-shadow 150ms ease,
|
|
40
|
+
transform 150ms ease,
|
|
41
|
+
color 150ms ease;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ui-select__trigger--full-width {
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (hover: hover) {
|
|
49
|
+
.ui-select__trigger:hover:not(:disabled) {
|
|
50
|
+
background-color: var(--color-base-200);
|
|
51
|
+
border-color: color-mix(in oklch, var(--color-base-content) 10%, transparent);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ui-select__trigger:focus-visible,
|
|
56
|
+
.ui-select__trigger[data-focus-visible="true"] {
|
|
57
|
+
outline: 2px solid var(--color-accent);
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
border-color: var(--color-accent);
|
|
60
|
+
background-color: color-mix(in oklch, var(--color-accent) 8%, var(--color-base-100));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ui-select__trigger:active:not(:disabled) {
|
|
64
|
+
transform: scale(0.99);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ui-select__trigger:disabled,
|
|
68
|
+
.ui-select[data-disabled="true"] .ui-select__trigger,
|
|
69
|
+
.ui-select__trigger[aria-disabled="true"] {
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
opacity: 0.55;
|
|
72
|
+
background-color: var(--color-base-200);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ui-select--secondary .ui-select__trigger {
|
|
76
|
+
border-color: transparent;
|
|
77
|
+
background-color: var(--color-base-200);
|
|
78
|
+
box-shadow: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (hover: hover) {
|
|
82
|
+
.ui-select--secondary .ui-select__trigger:hover:not(:disabled) {
|
|
83
|
+
background-color: var(--color-base-300);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ui-select__value {
|
|
88
|
+
flex: 1;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ui-select__value[data-placeholder="true"] {
|
|
96
|
+
color: color-mix(in oklch, var(--color-base-content) 42%, transparent);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ui-select__indicator {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
width: 1rem;
|
|
102
|
+
height: 1rem;
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
color: color-mix(in oklch, var(--color-base-content) 55%, transparent);
|
|
107
|
+
transition:
|
|
108
|
+
transform 150ms ease,
|
|
109
|
+
color 150ms ease;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ui-select__indicator svg {
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ui-select__indicator[data-open="true"] {
|
|
118
|
+
transform: rotate(180deg);
|
|
119
|
+
color: var(--color-base-content);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ui-select__popover {
|
|
123
|
+
display: none;
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: 80;
|
|
126
|
+
top: calc(100% + 0.375rem);
|
|
127
|
+
inset-inline-start: 0;
|
|
128
|
+
min-width: max(100%, 14rem);
|
|
129
|
+
max-width: min(30rem, calc(100vw - 2rem));
|
|
130
|
+
max-height: min(24rem, 70vh);
|
|
131
|
+
overflow-y: auto;
|
|
132
|
+
overscroll-behavior: contain;
|
|
133
|
+
border-radius: 1.5rem;
|
|
134
|
+
border: 1px solid color-mix(in oklch, var(--color-base-content) 8%, transparent);
|
|
135
|
+
background-color: var(--color-base-100);
|
|
136
|
+
box-shadow:
|
|
137
|
+
0 20px 32px oklch(0% 0 0 / 0.16),
|
|
138
|
+
0 8px 18px oklch(0% 0 0 / 0.1);
|
|
139
|
+
visibility: hidden;
|
|
140
|
+
opacity: 0;
|
|
141
|
+
transform: translateY(-4px) scale(0.98);
|
|
142
|
+
transform-origin: top;
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
transition:
|
|
145
|
+
opacity 150ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
146
|
+
transform 150ms cubic-bezier(0.22, 1, 0.36, 1),
|
|
147
|
+
visibility 150ms ease;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ui-select__popover[data-open="true"] {
|
|
151
|
+
display: block;
|
|
152
|
+
visibility: visible;
|
|
153
|
+
opacity: 1;
|
|
154
|
+
transform: translateY(0) scale(1);
|
|
155
|
+
pointer-events: auto;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ui-select__listbox {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
gap: 0.125rem;
|
|
162
|
+
padding: 0.375rem;
|
|
163
|
+
outline: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ui-select__option {
|
|
167
|
+
display: flex;
|
|
168
|
+
min-height: 2.25rem;
|
|
169
|
+
width: 100%;
|
|
170
|
+
align-items: center;
|
|
171
|
+
justify-content: space-between;
|
|
172
|
+
gap: 0.75rem;
|
|
173
|
+
border: 0;
|
|
174
|
+
border-radius: 1rem;
|
|
175
|
+
background: transparent;
|
|
176
|
+
padding: 0.5rem 0.625rem;
|
|
177
|
+
text-align: start;
|
|
178
|
+
font-size: 0.875rem;
|
|
179
|
+
line-height: 1.2;
|
|
180
|
+
color: var(--color-base-content);
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
outline: none;
|
|
183
|
+
transition:
|
|
184
|
+
background-color 150ms ease,
|
|
185
|
+
color 120ms ease,
|
|
186
|
+
transform 150ms ease,
|
|
187
|
+
opacity 120ms ease;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ui-select__option-label {
|
|
191
|
+
min-width: 0;
|
|
192
|
+
flex: 1;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.ui-select__option-indicator {
|
|
196
|
+
display: inline-flex;
|
|
197
|
+
width: 1rem;
|
|
198
|
+
height: 1rem;
|
|
199
|
+
flex-shrink: 0;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
opacity: 0;
|
|
203
|
+
transform: scale(0.85);
|
|
204
|
+
transition:
|
|
205
|
+
opacity 120ms ease,
|
|
206
|
+
transform 150ms ease;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ui-select__option-indicator svg {
|
|
210
|
+
width: 100%;
|
|
211
|
+
height: 100%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ui-select__option[data-selected="true"] .ui-select__option-indicator {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
transform: scale(1);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.ui-select__option[data-focused="true"],
|
|
220
|
+
.ui-select__option:focus-visible {
|
|
221
|
+
background-color: var(--color-base-200);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@media (hover: hover) {
|
|
225
|
+
.ui-select__option:hover:not(:disabled):not([data-disabled="true"]) {
|
|
226
|
+
background-color: var(--color-base-200);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.ui-select__option:active:not(:disabled):not([data-disabled="true"]) {
|
|
231
|
+
transform: scale(0.99);
|
|
232
|
+
background-color: var(--color-base-300);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.ui-select__option[data-selected="true"] {
|
|
236
|
+
color: var(--color-base-content);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.ui-select__option:disabled,
|
|
240
|
+
.ui-select__option[data-disabled="true"] {
|
|
241
|
+
cursor: not-allowed;
|
|
242
|
+
opacity: 0.45;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
@@ -1,16 +1,47 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { type
|
|
3
|
-
import type {
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
style?: JSX.CSSProperties;
|
|
1
|
+
import "./Select.css";
|
|
2
|
+
import { type Component, type JSX } from "solid-js";
|
|
3
|
+
import type { IComponentBaseProps } from "../types";
|
|
4
|
+
type SelectKey = string | number;
|
|
5
|
+
export type SelectValueType = SelectKey | SelectKey[] | null;
|
|
6
|
+
export type SelectVariant = "primary" | "secondary";
|
|
7
|
+
export type SelectSelectionMode = "single" | "multiple";
|
|
8
|
+
export type SelectRootProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "onChange"> & IComponentBaseProps & {
|
|
9
|
+
children: JSX.Element;
|
|
11
10
|
placeholder?: string;
|
|
12
|
-
value?:
|
|
11
|
+
value?: SelectValueType;
|
|
12
|
+
defaultValue?: SelectValueType;
|
|
13
|
+
selectedKeys?: Iterable<SelectKey>;
|
|
14
|
+
defaultSelectedKeys?: Iterable<SelectKey>;
|
|
15
|
+
onChange?: (value: string | string[] | null) => void;
|
|
16
|
+
onSelectionChange?: (keys: Set<string>) => void;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
fullWidth?: boolean;
|
|
20
|
+
variant?: SelectVariant;
|
|
21
|
+
selectionMode?: SelectSelectionMode;
|
|
22
|
+
isOpen?: boolean;
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
25
|
};
|
|
14
|
-
export type
|
|
15
|
-
|
|
26
|
+
export type SelectTriggerProps = JSX.ButtonHTMLAttributes<HTMLButtonElement> & IComponentBaseProps;
|
|
27
|
+
export type SelectValueProps = JSX.HTMLAttributes<HTMLSpanElement> & IComponentBaseProps;
|
|
28
|
+
export type SelectIndicatorProps = JSX.HTMLAttributes<HTMLSpanElement> & IComponentBaseProps;
|
|
29
|
+
export type SelectPopoverProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
30
|
+
export type SelectListboxProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
31
|
+
export type SelectOptionProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "value"> & IComponentBaseProps & {
|
|
32
|
+
value: SelectKey;
|
|
33
|
+
textValue?: string;
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type SelectProps = SelectRootProps;
|
|
37
|
+
type SelectComponent = Component<SelectRootProps> & {
|
|
38
|
+
Root: Component<SelectRootProps>;
|
|
39
|
+
Trigger: Component<SelectTriggerProps>;
|
|
40
|
+
Value: Component<SelectValueProps>;
|
|
41
|
+
Indicator: Component<SelectIndicatorProps>;
|
|
42
|
+
Popover: Component<SelectPopoverProps>;
|
|
43
|
+
Listbox: Component<SelectListboxProps>;
|
|
44
|
+
Option: Component<SelectOptionProps>;
|
|
45
|
+
};
|
|
46
|
+
declare const Select: SelectComponent;
|
|
16
47
|
export default Select;
|