@pathscale/ui 1.1.45 → 1.1.46
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 +3 -15
- package/dist/components/drawer/Drawer.d.ts +1 -2
- package/dist/components/drawer/Drawer.js +3 -7
- 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
|
@@ -183,22 +183,10 @@
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
/* -------------------------------------------------------------------------------------------------
|
|
186
|
-
* Dialog — semantic prop: bg (
|
|
186
|
+
* Dialog — semantic prop: bg (any CSS color via custom property)
|
|
187
187
|
* -----------------------------------------------------------------------------------------------*/
|
|
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));
|
|
188
|
+
.drawer__dialog--custom-bg {
|
|
189
|
+
background-color: var(--drawer-dialog-bg, var(--color-base-100));
|
|
202
190
|
}
|
|
203
191
|
|
|
204
192
|
/* Slide transitions — open state */
|
|
@@ -22,13 +22,12 @@ 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;
|
|
33
32
|
};
|
|
34
33
|
export type DrawerHeaderProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
@@ -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"
|
|
@@ -257,18 +251,20 @@ const DrawerDialog = (props)=>{
|
|
|
257
251
|
if ("object" == typeof local.style && local.style) Object.assign(s, local.style);
|
|
258
252
|
if (local.width) s["--drawer-dialog-width"] = local.width;
|
|
259
253
|
if (local.maxWidth) s["--drawer-dialog-max-width"] = local.maxWidth;
|
|
254
|
+
if (local.bg) s["--drawer-dialog-bg"] = local.bg;
|
|
260
255
|
if (local.padding) s["--drawer-dialog-padding"] = local.padding;
|
|
261
256
|
return s;
|
|
262
257
|
};
|
|
263
258
|
const hasCustomSize = ()=>Boolean(local.width || local.maxWidth);
|
|
264
259
|
const hasCustomPadding = ()=>Boolean(local.padding);
|
|
260
|
+
const hasCustomBg = ()=>Boolean(local.bg);
|
|
265
261
|
return (()=>{
|
|
266
262
|
var _el$4 = _tmpl$2();
|
|
267
263
|
spread(_el$4, mergeProps(others, {
|
|
268
264
|
role: "dialog",
|
|
269
265
|
"aria-modal": "true"
|
|
270
266
|
}, ()=>({
|
|
271
|
-
class: twMerge(CLASSES.slot.dialog, local.side ? SIDE_MAP[local.side] : void 0,
|
|
267
|
+
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
268
|
}), {
|
|
273
269
|
"data-slot": "drawer-dialog",
|
|
274
270
|
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";
|