@pathscale/ui 1.1.45 → 1.1.47
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/drawer/Drawer.css +10 -18
- package/dist/components/drawer/Drawer.d.ts +3 -2
- package/dist/components/drawer/Drawer.js +8 -8
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/icon/Icon.js +1 -2
- package/dist/components/input/Input.css +4 -0
- package/dist/components/toggle/Toggle.css +9 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -172,33 +172,25 @@
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/* -------------------------------------------------------------------------------------------------
|
|
175
|
-
* Dialog — semantic prop: side (border indicator)
|
|
175
|
+
* Dialog — semantic prop: side (border indicator, parametric width & color)
|
|
176
176
|
* -----------------------------------------------------------------------------------------------*/
|
|
177
177
|
.drawer__dialog--side-left {
|
|
178
|
-
border-right:
|
|
178
|
+
border-right-width: var(--drawer-dialog-border-width, 1px);
|
|
179
|
+
border-right-style: solid;
|
|
180
|
+
border-right-color: var(--drawer-dialog-border-color, color-mix(in oklab, var(--color-base-content) 10%, transparent));
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
.drawer__dialog--side-right {
|
|
182
|
-
border-left:
|
|
184
|
+
border-left-width: var(--drawer-dialog-border-width, 1px);
|
|
185
|
+
border-left-style: solid;
|
|
186
|
+
border-left-color: var(--drawer-dialog-border-color, color-mix(in oklab, var(--color-base-content) 10%, transparent));
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
/* -------------------------------------------------------------------------------------------------
|
|
186
|
-
* Dialog — semantic prop: bg (
|
|
190
|
+
* Dialog — semantic prop: bg (any CSS color via custom property)
|
|
187
191
|
* -----------------------------------------------------------------------------------------------*/
|
|
188
|
-
.drawer__dialog--bg
|
|
189
|
-
background-color: var(--color-base-100);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.drawer__dialog--bg-surface-1 {
|
|
193
|
-
background-color: var(--nf-surface-1, var(--color-base-100));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.drawer__dialog--bg-surface-2 {
|
|
197
|
-
background-color: var(--nf-surface-2, var(--color-base-200));
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.drawer__dialog--bg-surface-3 {
|
|
201
|
-
background-color: var(--nf-surface-3, var(--color-base-300));
|
|
192
|
+
.drawer__dialog--custom-bg {
|
|
193
|
+
background-color: var(--drawer-dialog-bg, var(--color-base-100));
|
|
202
194
|
}
|
|
203
195
|
|
|
204
196
|
/* Slide transitions — open state */
|
|
@@ -22,14 +22,15 @@ export type DrawerContentProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "child
|
|
|
22
22
|
placement?: DrawerPlacement;
|
|
23
23
|
};
|
|
24
24
|
export type DrawerDialogSide = "left" | "right";
|
|
25
|
-
export type DrawerDialogBg = "base" | "surface-1" | "surface-2" | "surface-3";
|
|
26
25
|
export type DrawerDialogProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
27
26
|
children: JSX.Element;
|
|
28
27
|
side?: DrawerDialogSide;
|
|
29
28
|
width?: string;
|
|
30
29
|
maxWidth?: string;
|
|
31
|
-
bg?:
|
|
30
|
+
bg?: string;
|
|
32
31
|
padding?: string;
|
|
32
|
+
borderWidth?: string;
|
|
33
|
+
borderColor?: string;
|
|
33
34
|
};
|
|
34
35
|
export type DrawerHeaderProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
35
36
|
children: JSX.Element;
|
|
@@ -228,12 +228,6 @@ const DrawerContent = (props)=>{
|
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
};
|
|
231
|
-
const BG_MAP = {
|
|
232
|
-
base: "drawer__dialog--bg-base",
|
|
233
|
-
"surface-1": "drawer__dialog--bg-surface-1",
|
|
234
|
-
"surface-2": "drawer__dialog--bg-surface-2",
|
|
235
|
-
"surface-3": "drawer__dialog--bg-surface-3"
|
|
236
|
-
};
|
|
237
231
|
const SIDE_MAP = {
|
|
238
232
|
left: "drawer__dialog--side-left",
|
|
239
233
|
right: "drawer__dialog--side-right"
|
|
@@ -249,7 +243,9 @@ const DrawerDialog = (props)=>{
|
|
|
249
243
|
"width",
|
|
250
244
|
"maxWidth",
|
|
251
245
|
"bg",
|
|
252
|
-
"padding"
|
|
246
|
+
"padding",
|
|
247
|
+
"borderWidth",
|
|
248
|
+
"borderColor"
|
|
253
249
|
]);
|
|
254
250
|
const ctx = useDrawerContext();
|
|
255
251
|
const mergedStyle = ()=>{
|
|
@@ -257,18 +253,22 @@ const DrawerDialog = (props)=>{
|
|
|
257
253
|
if ("object" == typeof local.style && local.style) Object.assign(s, local.style);
|
|
258
254
|
if (local.width) s["--drawer-dialog-width"] = local.width;
|
|
259
255
|
if (local.maxWidth) s["--drawer-dialog-max-width"] = local.maxWidth;
|
|
256
|
+
if (local.bg) s["--drawer-dialog-bg"] = local.bg;
|
|
260
257
|
if (local.padding) s["--drawer-dialog-padding"] = local.padding;
|
|
258
|
+
if (local.borderWidth) s["--drawer-dialog-border-width"] = local.borderWidth;
|
|
259
|
+
if (local.borderColor) s["--drawer-dialog-border-color"] = local.borderColor;
|
|
261
260
|
return s;
|
|
262
261
|
};
|
|
263
262
|
const hasCustomSize = ()=>Boolean(local.width || local.maxWidth);
|
|
264
263
|
const hasCustomPadding = ()=>Boolean(local.padding);
|
|
264
|
+
const hasCustomBg = ()=>Boolean(local.bg);
|
|
265
265
|
return (()=>{
|
|
266
266
|
var _el$4 = _tmpl$2();
|
|
267
267
|
spread(_el$4, mergeProps(others, {
|
|
268
268
|
role: "dialog",
|
|
269
269
|
"aria-modal": "true"
|
|
270
270
|
}, ()=>({
|
|
271
|
-
class: twMerge(CLASSES.slot.dialog, local.side ? SIDE_MAP[local.side] : void 0,
|
|
271
|
+
class: twMerge(CLASSES.slot.dialog, local.side ? SIDE_MAP[local.side] : void 0, hasCustomBg() ? "drawer__dialog--custom-bg" : void 0, hasCustomSize() ? "drawer__dialog--custom-size" : void 0, hasCustomPadding() ? "drawer__dialog--custom-padding" : void 0, local.class, local.className)
|
|
272
272
|
}), {
|
|
273
273
|
"data-slot": "drawer-dialog",
|
|
274
274
|
get ["data-placement"] () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, DrawerRoot, DrawerTrigger, DrawerBackdrop, DrawerContent, DrawerDialog, DrawerHeader, DrawerHeading, DrawerBody, DrawerFooter, DrawerHandle, DrawerCloseTrigger, DrawerClose, type DrawerPlacement, type DrawerBackdropVariant, type DrawerDialogSide, type
|
|
1
|
+
export { default, DrawerRoot, DrawerTrigger, DrawerBackdrop, DrawerContent, DrawerDialog, DrawerHeader, DrawerHeading, DrawerBody, DrawerFooter, DrawerHandle, DrawerCloseTrigger, DrawerClose, type DrawerPlacement, type DrawerBackdropVariant, type DrawerDialogSide, type DrawerRootProps, type DrawerTriggerProps, type DrawerBackdropProps, type DrawerContentProps, type DrawerDialogProps, type DrawerHeaderProps, type DrawerHeadingProps, type DrawerBodyProps, type DrawerFooterProps, type DrawerHandleProps, type DrawerCloseTriggerProps, type DrawerCloseProps, } from "./Drawer";
|
|
@@ -16,8 +16,7 @@ const Icon = (props)=>{
|
|
|
16
16
|
]);
|
|
17
17
|
const width = local.width ?? 24;
|
|
18
18
|
const height = local.height ?? 24;
|
|
19
|
-
const
|
|
20
|
-
const classes = createMemo(()=>twMerge(CLASSES.base, name, local.class, local.className));
|
|
19
|
+
const classes = createMemo(()=>twMerge(CLASSES.base, local.name, local.class, local.className));
|
|
21
20
|
return (()=>{
|
|
22
21
|
var _el$ = _tmpl$();
|
|
23
22
|
spread(_el$, mergeProps(others, ()=>({
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
--switch-control-bg-pressed: var(--switch-control-bg-hover);
|
|
15
15
|
--switch-control-bg-checked: var(--color-accent);
|
|
16
16
|
--switch-control-bg-checked-hover: color-mix(in oklab, var(--switch-control-bg-checked), #000 8%);
|
|
17
|
+
--switch-control-border: color-mix(in oklab, var(--color-base-content) 24%, transparent);
|
|
18
|
+
--switch-control-border-checked: color-mix(
|
|
19
|
+
in oklab,
|
|
20
|
+
var(--switch-control-bg-checked) 74%,
|
|
21
|
+
var(--color-base-content)
|
|
22
|
+
);
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
.toggle__input {
|
|
@@ -37,9 +43,11 @@
|
|
|
37
43
|
border-radius: 9999px;
|
|
38
44
|
height: 1.25rem;
|
|
39
45
|
width: 2.5rem;
|
|
46
|
+
border: 1px solid var(--switch-control-border);
|
|
40
47
|
background-color: var(--switch-control-bg);
|
|
41
48
|
transition:
|
|
42
49
|
background-color 250ms ease,
|
|
50
|
+
border-color 250ms ease,
|
|
43
51
|
box-shadow 150ms ease;
|
|
44
52
|
}
|
|
45
53
|
|
|
@@ -109,6 +117,7 @@
|
|
|
109
117
|
|
|
110
118
|
.toggle[data-selected="true"] .toggle__control {
|
|
111
119
|
background-color: var(--switch-control-bg-checked);
|
|
120
|
+
border-color: var(--switch-control-border-checked);
|
|
112
121
|
}
|
|
113
122
|
|
|
114
123
|
.toggle[data-selected="true"] .toggle__thumb {
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export { default as DatePicker, type DatePickerProps, } from "./components/date-
|
|
|
45
45
|
export { default as DateRangePicker, type DateRangePickerProps, type DateRangeValue, } from "./components/date-range-picker";
|
|
46
46
|
export { default as RangeCalendar, type RangeCalendarProps, type RangeCalendarValue, } from "./components/range-calendar";
|
|
47
47
|
export { default as Drawer, DrawerRoot, DrawerTrigger, DrawerBackdrop, DrawerContent, DrawerDialog, DrawerHeader, DrawerHeading, DrawerBody, DrawerFooter, DrawerHandle, DrawerCloseTrigger, DrawerClose, } from "./components/drawer";
|
|
48
|
-
export type { DrawerPlacement, DrawerBackdropVariant, DrawerDialogSide,
|
|
48
|
+
export type { DrawerPlacement, DrawerBackdropVariant, DrawerDialogSide, DrawerRootProps, DrawerTriggerProps, DrawerBackdropProps, DrawerContentProps, DrawerDialogProps, DrawerHeaderProps, DrawerHeadingProps, DrawerBodyProps, DrawerFooterProps, DrawerHandleProps, DrawerCloseTriggerProps, } from "./components/drawer";
|
|
49
49
|
export { default as Dropdown } from "./components/dropdown";
|
|
50
50
|
export { default as Disclosure } from "./components/disclosure";
|
|
51
51
|
export type { DisclosureProps, DisclosureRootProps, DisclosureHeadingProps, DisclosureTriggerProps, DisclosureContentProps, DisclosureBodyProps, DisclosureIndicatorProps, } from "./components/disclosure";
|