@pathscale/ui 2.11.7 → 2.11.9
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/color-wheel/ColorWheel.generated.js +4 -1
- package/dist/components/color-wheel/ComplexColorWheel.css +1 -1
- package/dist/components/color-wheel/ComplexColorWheel.generated.js +180 -173
- package/dist/components/color-wheel-flower/ColorWheelFlower.css +84 -3
- package/dist/components/color-wheel-flower/ColorWheelFlower.generated.d.ts +2 -0
- package/dist/components/color-wheel-flower/ColorWheelFlower.generated.js +18 -247
- package/dist/components/dock/Dock.generated.js +1 -1
- package/dist/components/dropdown/Dropdown.css +32 -1
- package/dist/components/dropdown/Dropdown.generated.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.generated.js +49 -42
- package/dist/components/inline-edit/InlineEdit.generated.js +19 -15
- package/dist/components/language-switcher/LanguageSwitcher.generated.d.ts +2 -0
- package/dist/components/panel-toggle/PanelToggle.css +72 -0
- package/dist/components/panel-toggle/PanelToggle.generated.d.ts +18 -0
- package/dist/components/panel-toggle/PanelToggle.generated.js +41 -0
- package/dist/components/panel-toggle/PanelToggle.recipe.d.ts +21 -0
- package/dist/components/panel-toggle/PanelToggle.recipe.js +45 -0
- package/dist/components/panel-toggle/index.d.ts +2 -0
- package/dist/components/panel-toggle/index.js +2 -0
- package/dist/components/select/Select.generated.js +116 -88
- package/dist/components/slider/Slider.generated.js +11 -4
- package/dist/components/tabs/Tabs.css +5 -0
- package/dist/components/tabs/Tabs.generated.js +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/layouts.manifest.json +4 -1
- package/dist/motion/engine.js +11 -5
- package/dist/purge-manifest.json +117 -9
- package/package.json +7 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component as __LayoutComponent } from "solid-js";
|
|
2
|
+
import "./PanelToggle.css";
|
|
3
|
+
import type { JSX } from "@solidjs/web";
|
|
4
|
+
import type { UIBaseProps } from "../vocabulary";
|
|
5
|
+
export type PanelToggleSide = "left" | "right";
|
|
6
|
+
export type PanelToggleProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "id" | "aria-label" | "aria-expanded" | "type"> & UIBaseProps & {
|
|
7
|
+
/** Required so inspection and QA can address this control without its copy. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Whether the panel controlled by this gutter tab is visible. */
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
/** The side of the content on which the controlled panel lives. */
|
|
12
|
+
side?: PanelToggleSide;
|
|
13
|
+
/** Names the action in the current state, for example “Hide details”. */
|
|
14
|
+
"aria-label": string;
|
|
15
|
+
/** The id of the panel this button expands and collapses. */
|
|
16
|
+
"aria-controls"?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const PanelToggleLayout: __LayoutComponent<PanelToggleProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { mergeProps, spread, template } from "@solidjs/web";
|
|
2
|
+
import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
3
|
+
import "./PanelToggle.css";
|
|
4
|
+
import { omit } from "solid-js";
|
|
5
|
+
import { panelToggle } from "./PanelToggle.recipe.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<button><span>");
|
|
7
|
+
const __solidLayoutPanelToggleLayout = (_stable, p)=>{
|
|
8
|
+
const rest = omit(p, "id", "expanded", "side", "aria-label", "aria-controls", "children", "class", "style");
|
|
9
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
|
|
10
|
+
spread(_el$, mergeProps(rest, ()=>_stable.slot.root, {
|
|
11
|
+
get id () {
|
|
12
|
+
return p.id;
|
|
13
|
+
},
|
|
14
|
+
type: "button",
|
|
15
|
+
get ["aria-label"] () {
|
|
16
|
+
return p["aria-label"];
|
|
17
|
+
},
|
|
18
|
+
get ["aria-controls"] () {
|
|
19
|
+
return p["aria-controls"];
|
|
20
|
+
},
|
|
21
|
+
get ["aria-expanded"] () {
|
|
22
|
+
return p.expanded ? "true" : "false";
|
|
23
|
+
},
|
|
24
|
+
get ["data-expanded"] () {
|
|
25
|
+
return p.expanded ? "true" : "false";
|
|
26
|
+
},
|
|
27
|
+
get ["data-side"] () {
|
|
28
|
+
return p.side ?? "right";
|
|
29
|
+
}
|
|
30
|
+
}), true);
|
|
31
|
+
spread(_el$2, mergeProps(()=>_stable.slot.indicator, {
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
}), false);
|
|
34
|
+
return _el$;
|
|
35
|
+
};
|
|
36
|
+
const PanelToggleLayout = defineComponent({
|
|
37
|
+
recipe: panelToggle,
|
|
38
|
+
layout: __solidLayoutPanelToggleLayout,
|
|
39
|
+
embedded: true
|
|
40
|
+
});
|
|
41
|
+
export { PanelToggleLayout };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const panelToggle: import("solid-layouts/solid-2").Recipe<{
|
|
2
|
+
readonly component: "panel-toggle";
|
|
3
|
+
readonly element: "button";
|
|
4
|
+
readonly slots: {
|
|
5
|
+
readonly root: {
|
|
6
|
+
readonly base: "panel-toggle";
|
|
7
|
+
};
|
|
8
|
+
readonly indicator: {
|
|
9
|
+
readonly base: "panel-toggle__indicator";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly props: {
|
|
13
|
+
readonly side: {
|
|
14
|
+
readonly left: "panel-toggle--left";
|
|
15
|
+
readonly right: "panel-toggle--right";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly defaults: {
|
|
19
|
+
readonly side: "right";
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { recipe } from "../../lib/layouts/index.js";
|
|
2
|
+
const panelToggle = recipe({
|
|
3
|
+
component: "panel-toggle",
|
|
4
|
+
element: "button",
|
|
5
|
+
slots: {
|
|
6
|
+
root: {
|
|
7
|
+
base: "panel-toggle"
|
|
8
|
+
},
|
|
9
|
+
indicator: {
|
|
10
|
+
base: "panel-toggle__indicator"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
side: {
|
|
15
|
+
left: "panel-toggle--left",
|
|
16
|
+
right: "panel-toggle--right"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaults: {
|
|
20
|
+
side: "right"
|
|
21
|
+
},
|
|
22
|
+
_layouts: {
|
|
23
|
+
slots: {
|
|
24
|
+
root: {
|
|
25
|
+
base: "panel-toggle",
|
|
26
|
+
axes: {
|
|
27
|
+
side: {
|
|
28
|
+
left: "panel-toggle--left",
|
|
29
|
+
right: "panel-toggle--right"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
indicator: {
|
|
34
|
+
base: "panel-toggle__indicator",
|
|
35
|
+
axes: {}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
stateKeys: [],
|
|
39
|
+
slotIds: {
|
|
40
|
+
root: 1,
|
|
41
|
+
indicator: 0
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export { panelToggle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent, insert, memo, mergeProps, ref, spread, template } from "@solidjs/web";
|
|
2
2
|
import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
3
3
|
import "./Select.css";
|
|
4
|
-
import { createContext, createMemo, createSignal, createTrackedEffect, createUniqueId, omit, onCleanup, onSettled, useContext } from "solid-js";
|
|
4
|
+
import { Show, createContext, createMemo, createSignal, createTrackedEffect, createUniqueId, omit, onCleanup, onSettled, untrack, useContext } from "solid-js";
|
|
5
5
|
import { twMerge } from "../../lib/twMerge.js";
|
|
6
6
|
import { createOverlayPosition } from "../_shared/overlayPosition.js";
|
|
7
7
|
import { CLASSES, componentRecipe } from "./Select.recipe.js";
|
|
@@ -36,7 +36,8 @@ const sortOptionsByDomOrder = (options)=>[
|
|
|
36
36
|
});
|
|
37
37
|
const __solidLayoutSelectRoot = (_stable, p)=>{
|
|
38
38
|
const others = omit(p, "children", "class", "dataTheme", "placeholder", "value", "defaultValue", "selectedKeys", "defaultSelectedKeys", "onChange", "onSelectionChange", "state", "disabled", "fullWidth", "variant", "selectionMode", "placement", "autoFlip", "open", "defaultOpen", "onOpenChange", "ref");
|
|
39
|
-
const
|
|
39
|
+
const generatedId = createUniqueId();
|
|
40
|
+
const baseId = p.id || generatedId;
|
|
40
41
|
const triggerId = `${baseId}-trigger`;
|
|
41
42
|
const listboxId = `${baseId}-listbox`;
|
|
42
43
|
const selectionMode = ()=>p.selectionMode ?? "single";
|
|
@@ -47,7 +48,8 @@ const __solidLayoutSelectRoot = (_stable, p)=>{
|
|
|
47
48
|
const [internalSelectedKeys, setInternalSelectedKeys] = createSignal(initialSelected);
|
|
48
49
|
const [internalOpen, setInternalOpen] = createSignal(Boolean(p.defaultOpen));
|
|
49
50
|
const [options, setOptions] = createSignal([]);
|
|
50
|
-
const
|
|
51
|
+
const optionTextByKey = new Map();
|
|
52
|
+
const [optionTextRevision, setOptionTextRevision] = createSignal(0);
|
|
51
53
|
const [focusedKey, setFocusedKey] = createSignal();
|
|
52
54
|
const [focusRequest, setFocusRequest] = createSignal(null);
|
|
53
55
|
const [triggerRef, setTriggerRefSignal] = createSignal();
|
|
@@ -63,8 +65,9 @@ const __solidLayoutSelectRoot = (_stable, p)=>{
|
|
|
63
65
|
});
|
|
64
66
|
const selectedSet = createMemo(()=>new Set(selectedKeys()));
|
|
65
67
|
const selectedText = createMemo(()=>{
|
|
68
|
+
optionTextRevision();
|
|
66
69
|
if (!selectedKeys().length) return "";
|
|
67
|
-
return selectedKeys().map((key)=>optionTextByKey
|
|
70
|
+
return selectedKeys().map((key)=>optionTextByKey.get(key) ?? key).join("multiple" === selectionMode() ? ", " : "");
|
|
68
71
|
});
|
|
69
72
|
const getEnabledOptions = ()=>options().filter((option)=>!option.disabled);
|
|
70
73
|
const focusOption = (option)=>{
|
|
@@ -130,13 +133,17 @@ const __solidLayoutSelectRoot = (_stable, p)=>{
|
|
|
130
133
|
focusTrigger: true
|
|
131
134
|
});
|
|
132
135
|
};
|
|
136
|
+
const registerOptionText = (key, textValue)=>{
|
|
137
|
+
if (optionTextByKey.get(key) === textValue) return;
|
|
138
|
+
optionTextByKey.set(key, textValue);
|
|
139
|
+
if (untrack(selectedKeys).includes(key)) setOptionTextRevision((revision)=>revision + 1);
|
|
140
|
+
};
|
|
141
|
+
const unregisterOptionText = (key)=>{
|
|
142
|
+
if (!optionTextByKey.delete(key)) return;
|
|
143
|
+
if (untrack(selectedKeys).includes(key)) setOptionTextRevision((revision)=>revision + 1);
|
|
144
|
+
};
|
|
133
145
|
const registerOption = (option)=>{
|
|
134
|
-
|
|
135
|
-
if (current.get(option.key) === option.textValue) return current;
|
|
136
|
-
const next = new Map(current);
|
|
137
|
-
next.set(option.key, option.textValue);
|
|
138
|
-
return next;
|
|
139
|
-
});
|
|
146
|
+
registerOptionText(option.key, option.textValue);
|
|
140
147
|
setOptions((current)=>sortOptionsByDomOrder([
|
|
141
148
|
...current.filter((entry)=>entry.key !== option.key),
|
|
142
149
|
option
|
|
@@ -211,6 +218,8 @@ const __solidLayoutSelectRoot = (_stable, p)=>{
|
|
|
211
218
|
focusNext,
|
|
212
219
|
requestFocus: setFocusRequest,
|
|
213
220
|
selectKey,
|
|
221
|
+
registerOptionText,
|
|
222
|
+
unregisterOptionText,
|
|
214
223
|
registerOption,
|
|
215
224
|
unregisterOption,
|
|
216
225
|
setTriggerRef,
|
|
@@ -614,6 +623,7 @@ const __solidLayoutSelectOption = (_stable, p)=>{
|
|
|
614
623
|
return _el$21;
|
|
615
624
|
}
|
|
616
625
|
const key = ()=>String(p.value);
|
|
626
|
+
const textValue = ()=>p.textValue ?? ("string" == typeof p.children ? p.children : key());
|
|
617
627
|
const isDisabled = ()=>Boolean("disabled" === p.state) || Boolean(p.disabled) || ctx.disabled();
|
|
618
628
|
const isSelected = ()=>ctx.isSelected(key());
|
|
619
629
|
const isFocused = ()=>ctx.focusedKey() === key();
|
|
@@ -622,17 +632,21 @@ const __solidLayoutSelectOption = (_stable, p)=>{
|
|
|
622
632
|
optionRef = el;
|
|
623
633
|
ctx.registerOption({
|
|
624
634
|
key: key(),
|
|
625
|
-
textValue:
|
|
635
|
+
textValue: textValue(),
|
|
626
636
|
disabled: isDisabled(),
|
|
627
637
|
ref: el
|
|
628
638
|
});
|
|
629
639
|
if ("function" == typeof p.ref) p.ref(el);
|
|
630
640
|
};
|
|
641
|
+
onSettled(()=>{
|
|
642
|
+
ctx.registerOptionText(key(), textValue());
|
|
643
|
+
return ()=>ctx.unregisterOptionText(key());
|
|
644
|
+
});
|
|
631
645
|
createTrackedEffect(()=>{
|
|
632
646
|
if (!optionRef) return;
|
|
633
647
|
ctx.registerOption({
|
|
634
648
|
key: key(),
|
|
635
|
-
textValue:
|
|
649
|
+
textValue: textValue(),
|
|
636
650
|
disabled: isDisabled(),
|
|
637
651
|
ref: optionRef
|
|
638
652
|
});
|
|
@@ -690,83 +704,97 @@ const __solidLayoutSelectOption = (_stable, p)=>{
|
|
|
690
704
|
}
|
|
691
705
|
if ("Tab" === event.key) ctx.setOpen(false);
|
|
692
706
|
};
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
707
|
+
const MountedOption = ()=>{
|
|
708
|
+
onCleanup(()=>{
|
|
709
|
+
optionRef = void 0;
|
|
710
|
+
ctx.unregisterOption(key());
|
|
711
|
+
});
|
|
712
|
+
var _el$28 = _tmpl$6(), _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling;
|
|
713
|
+
ref(()=>setRef, _el$28);
|
|
714
|
+
spread(_el$28, mergeProps(others, {
|
|
715
|
+
get type () {
|
|
716
|
+
return p.type ?? "button";
|
|
717
|
+
}
|
|
718
|
+
}, ()=>({
|
|
719
|
+
class: twMerge(CLASSES.slot.option, p.class)
|
|
720
|
+
}), {
|
|
721
|
+
get ["data-theme"] () {
|
|
722
|
+
return p.dataTheme;
|
|
723
|
+
},
|
|
724
|
+
"data-slot": "ui-select-option",
|
|
725
|
+
get ["data-selected"] () {
|
|
726
|
+
return isSelected() ? "true" : "false";
|
|
727
|
+
},
|
|
728
|
+
get ["data-focused"] () {
|
|
729
|
+
return isFocused() ? "true" : "false";
|
|
730
|
+
},
|
|
731
|
+
get ["data-disabled"] () {
|
|
732
|
+
return isDisabled() ? "true" : "false";
|
|
733
|
+
},
|
|
734
|
+
role: "option",
|
|
735
|
+
get ["aria-selected"] () {
|
|
736
|
+
return isSelected() ? "true" : "false";
|
|
737
|
+
},
|
|
738
|
+
get ["aria-disabled"] () {
|
|
739
|
+
return isDisabled() ? "true" : "false";
|
|
740
|
+
},
|
|
741
|
+
get disabled () {
|
|
742
|
+
return isDisabled();
|
|
743
|
+
},
|
|
744
|
+
tabindex: -1,
|
|
745
|
+
onClick: handleClick,
|
|
746
|
+
onMouseEnter: handleMouseEnter,
|
|
747
|
+
onFocus: ()=>ctx.setFocusedKey(key()),
|
|
748
|
+
onKeyDown: handleKeyDown
|
|
749
|
+
}), true);
|
|
750
|
+
insert(_el$28, (()=>{
|
|
751
|
+
var _c$9 = memo(()=>!!p.startIcon);
|
|
752
|
+
return ()=>_c$9() ? (()=>{
|
|
753
|
+
var _el$31 = _tmpl$3();
|
|
754
|
+
spread(_el$31, mergeProps(()=>({
|
|
755
|
+
class: twMerge(CLASSES.slot.icon, CLASSES.slot.iconStart)
|
|
756
|
+
}), {
|
|
757
|
+
"data-slot": "ui-select-option-start-icon"
|
|
758
|
+
}), true);
|
|
759
|
+
insert(_el$31, ()=>p.startIcon);
|
|
760
|
+
return _el$31;
|
|
761
|
+
})() : null;
|
|
762
|
+
})(), _el$29);
|
|
763
|
+
spread(_el$29, mergeProps(()=>({
|
|
764
|
+
class: CLASSES.slot.optionLabel
|
|
765
|
+
}), {
|
|
766
|
+
"data-slot": "ui-select-option-label"
|
|
767
|
+
}), true);
|
|
768
|
+
insert(_el$29, ()=>p.children);
|
|
769
|
+
insert(_el$28, (()=>{
|
|
770
|
+
var _c$0 = memo(()=>!!p.endIcon);
|
|
771
|
+
return ()=>_c$0() ? (()=>{
|
|
772
|
+
var _el$32 = _tmpl$5(), _el$33 = _el$32.firstChild;
|
|
773
|
+
spread(_el$32, mergeProps(()=>({
|
|
774
|
+
class: CLASSES.slot.optionIndicator
|
|
775
|
+
}), {
|
|
776
|
+
"data-slot": "ui-select-option-indicator",
|
|
777
|
+
"aria-hidden": "true"
|
|
778
|
+
}), true);
|
|
779
|
+
spread(_el$33, mergeProps(()=>({
|
|
780
|
+
class: twMerge(CLASSES.slot.icon, CLASSES.slot.iconEnd)
|
|
781
|
+
}), {
|
|
782
|
+
"data-slot": "ui-select-option-end-icon"
|
|
783
|
+
}), true);
|
|
784
|
+
insert(_el$33, ()=>p.endIcon);
|
|
785
|
+
return _el$32;
|
|
786
|
+
})() : null;
|
|
787
|
+
})(), _el$30);
|
|
788
|
+
return _el$28;
|
|
789
|
+
};
|
|
790
|
+
return createComponent(Show, {
|
|
791
|
+
get when () {
|
|
792
|
+
return ctx.open();
|
|
724
793
|
},
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
onKeyDown: handleKeyDown
|
|
730
|
-
}), true);
|
|
731
|
-
insert(_el$28, (()=>{
|
|
732
|
-
var _c$9 = memo(()=>!!p.startIcon);
|
|
733
|
-
return ()=>_c$9() ? (()=>{
|
|
734
|
-
var _el$31 = _tmpl$3();
|
|
735
|
-
spread(_el$31, mergeProps(()=>({
|
|
736
|
-
class: twMerge(CLASSES.slot.icon, CLASSES.slot.iconStart)
|
|
737
|
-
}), {
|
|
738
|
-
"data-slot": "ui-select-option-start-icon"
|
|
739
|
-
}), true);
|
|
740
|
-
insert(_el$31, ()=>p.startIcon);
|
|
741
|
-
return _el$31;
|
|
742
|
-
})() : null;
|
|
743
|
-
})(), _el$29);
|
|
744
|
-
spread(_el$29, mergeProps(()=>({
|
|
745
|
-
class: CLASSES.slot.optionLabel
|
|
746
|
-
}), {
|
|
747
|
-
"data-slot": "ui-select-option-label"
|
|
748
|
-
}), true);
|
|
749
|
-
insert(_el$29, ()=>p.children);
|
|
750
|
-
insert(_el$28, (()=>{
|
|
751
|
-
var _c$0 = memo(()=>!!p.endIcon);
|
|
752
|
-
return ()=>_c$0() ? (()=>{
|
|
753
|
-
var _el$32 = _tmpl$5(), _el$33 = _el$32.firstChild;
|
|
754
|
-
spread(_el$32, mergeProps(()=>({
|
|
755
|
-
class: CLASSES.slot.optionIndicator
|
|
756
|
-
}), {
|
|
757
|
-
"data-slot": "ui-select-option-indicator",
|
|
758
|
-
"aria-hidden": "true"
|
|
759
|
-
}), true);
|
|
760
|
-
spread(_el$33, mergeProps(()=>({
|
|
761
|
-
class: twMerge(CLASSES.slot.icon, CLASSES.slot.iconEnd)
|
|
762
|
-
}), {
|
|
763
|
-
"data-slot": "ui-select-option-end-icon"
|
|
764
|
-
}), true);
|
|
765
|
-
insert(_el$33, ()=>p.endIcon);
|
|
766
|
-
return _el$32;
|
|
767
|
-
})() : null;
|
|
768
|
-
})(), _el$30);
|
|
769
|
-
return _el$28;
|
|
794
|
+
get children () {
|
|
795
|
+
return createComponent(MountedOption, {});
|
|
796
|
+
}
|
|
797
|
+
});
|
|
770
798
|
};
|
|
771
799
|
const SelectOption = defineComponent({
|
|
772
800
|
recipe: componentRecipe,
|
|
@@ -21,7 +21,8 @@ const __solidLayoutSlider = (_stable, p)=>{
|
|
|
21
21
|
const step = ()=>p.step ?? 1;
|
|
22
22
|
const size = ()=>p.size ?? "md";
|
|
23
23
|
const isDisabled = ()=>Boolean(p.disabled);
|
|
24
|
-
const
|
|
24
|
+
const generatedLabelId = createUniqueId();
|
|
25
|
+
const labelId = ()=>p.id ? `${p.id}-label` : generatedLabelId;
|
|
25
26
|
const [dragging, setDragging] = createSignal(false);
|
|
26
27
|
const [focusVisible, setFocusVisible] = createSignal(false);
|
|
27
28
|
const fraction = ()=>{
|
|
@@ -132,7 +133,9 @@ const __solidLayoutSlider = (_stable, p)=>{
|
|
|
132
133
|
(()=>{
|
|
133
134
|
var _el$2 = _tmpl$();
|
|
134
135
|
spread(_el$2, mergeProps({
|
|
135
|
-
id
|
|
136
|
+
get id () {
|
|
137
|
+
return labelId();
|
|
138
|
+
}
|
|
136
139
|
}, ()=>({
|
|
137
140
|
class: CLASSES.label
|
|
138
141
|
}), {
|
|
@@ -186,7 +189,11 @@ const __solidLayoutSlider = (_stable, p)=>{
|
|
|
186
189
|
}), false);
|
|
187
190
|
var _ref$2 = thumbRef;
|
|
188
191
|
"function" == typeof _ref$2 || Array.isArray(_ref$2) ? ref(()=>_ref$2, _el$6) : thumbRef = _el$6;
|
|
189
|
-
spread(_el$6, mergeProps(
|
|
192
|
+
spread(_el$6, mergeProps({
|
|
193
|
+
get id () {
|
|
194
|
+
return p.id;
|
|
195
|
+
}
|
|
196
|
+
}, ()=>({
|
|
190
197
|
class: CLASSES.thumb
|
|
191
198
|
}), {
|
|
192
199
|
"data-slot": "slider-thumb",
|
|
@@ -224,7 +231,7 @@ const __solidLayoutSlider = (_stable, p)=>{
|
|
|
224
231
|
return p["aria-label"] ?? p.label;
|
|
225
232
|
},
|
|
226
233
|
get ["aria-labelledby"] () {
|
|
227
|
-
return p.label ? labelId : void 0;
|
|
234
|
+
return p.label ? labelId() : void 0;
|
|
228
235
|
},
|
|
229
236
|
get ["aria-disabled"] () {
|
|
230
237
|
return isDisabled() ? "true" : void 0;
|
|
@@ -29,12 +29,17 @@
|
|
|
29
29
|
width: 100%;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
.tabs__list[data-orientation="horizontal"] .tabs__tab {
|
|
33
|
+
width: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
.tabs__list[data-orientation="vertical"] {
|
|
33
37
|
flex-direction: column;
|
|
34
38
|
gap: 0.25rem;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
.tabs__list[data-orientation="vertical"] .tabs__tab {
|
|
42
|
+
width: 100%;
|
|
38
43
|
min-width: 5rem;
|
|
39
44
|
}
|
|
40
45
|
|
|
@@ -13,7 +13,8 @@ const invokeEventHandler = (handler, event)=>{
|
|
|
13
13
|
};
|
|
14
14
|
const __solidLayoutTabsRoot = (_stable, p)=>{
|
|
15
15
|
const others = omit(p, "children", "class", "orientation", "variant", "selectedKey", "defaultSelectedKey", "onSelectionChange");
|
|
16
|
-
const
|
|
16
|
+
const generatedId = createUniqueId();
|
|
17
|
+
const baseId = ()=>p.id || generatedId;
|
|
17
18
|
const [internalSelectedKey, setInternalSelectedKey] = createSignal(p.defaultSelectedKey);
|
|
18
19
|
const [tabs, setTabs] = createSignal([]);
|
|
19
20
|
const isControlled = ()=>void 0 !== p.selectedKey;
|
|
@@ -34,8 +35,8 @@ const __solidLayoutTabsRoot = (_stable, p)=>{
|
|
|
34
35
|
const unregisterTab = (key)=>{
|
|
35
36
|
setTabs((prev)=>prev.filter((item)=>item.key !== key));
|
|
36
37
|
};
|
|
37
|
-
const getTabId = (key)=>`${baseId}-tab-${String(key)}`;
|
|
38
|
-
const getPanelId = (key)=>`${baseId}-panel-${String(key)}`;
|
|
38
|
+
const getTabId = (key)=>`${baseId()}-tab-${String(key)}`;
|
|
39
|
+
const getPanelId = (key)=>`${baseId()}-panel-${String(key)}`;
|
|
39
40
|
const classes = ()=>twMerge(CLASSES.base, "secondary" === p.variant && CLASSES.variant.secondary, p.class);
|
|
40
41
|
const context = createMemo(()=>({
|
|
41
42
|
orientation: p.orientation ?? "horizontal",
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { BreadcrumbItemProps, BreadcrumbRootProps, } from "./components/bre
|
|
|
18
18
|
export { Breadcrumb, BreadcrumbItem, } from "./components/breadcrumb";
|
|
19
19
|
export type { ButtonProps } from "./components/button";
|
|
20
20
|
export { default as Button } from "./components/button";
|
|
21
|
+
export { PanelToggle, type PanelToggleProps, type PanelToggleSide, } from "./components/panel-toggle";
|
|
21
22
|
export { type CalendarDayHoverHandler, type CalendarDaySelectHandler, type CalendarProps, type CalendarSelectionMode, type CalendarWeekdayFormat, default as Calendar, } from "./components/calendar";
|
|
22
23
|
export type { CardElevation, CardMaterial, CardProps, CardSectionProps, } from "./components/card";
|
|
23
24
|
export { Card as CardRoot, CardBody, CardFooter, CardHeader, default as Card, } from "./components/card";
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { AvatarFallback, AvatarImage, default as Avatar } from "./components/ava
|
|
|
13
13
|
export { default as Badge } from "./components/badge/index.js";
|
|
14
14
|
export { Breadcrumb, BreadcrumbItem } from "./components/breadcrumb/index.js";
|
|
15
15
|
export { default as Button } from "./components/button/index.js";
|
|
16
|
+
export { PanelToggle } from "./components/panel-toggle/index.js";
|
|
16
17
|
export { default as Calendar } from "./components/calendar/index.js";
|
|
17
18
|
export { Card as CardRoot, CardBody, CardFooter, CardHeader, default as Card } from "./components/card/index.js";
|
|
18
19
|
export { default as ChatBubble } from "./components/chatbubble/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": "solid-layouts-library-v2",
|
|
3
3
|
"package": "@pathscale/ui",
|
|
4
|
-
"version": "2.11.
|
|
4
|
+
"version": "2.11.9",
|
|
5
5
|
"components": {
|
|
6
6
|
"Accordion": {
|
|
7
7
|
"kind": "embedded"
|
|
@@ -423,6 +423,9 @@
|
|
|
423
423
|
"Pagination": {
|
|
424
424
|
"kind": "embedded"
|
|
425
425
|
},
|
|
426
|
+
"PanelToggle": {
|
|
427
|
+
"kind": "embedded"
|
|
428
|
+
},
|
|
426
429
|
"PasswordField": {
|
|
427
430
|
"kind": "embedded"
|
|
428
431
|
},
|
package/dist/motion/engine.js
CHANGED
|
@@ -25,7 +25,13 @@ const runMotion = (el, from, to, transition, onComplete)=>{
|
|
|
25
25
|
};
|
|
26
26
|
if (void 0 !== from.opacity) el.style.opacity = String(from.opacity);
|
|
27
27
|
applyTransform();
|
|
28
|
-
const
|
|
28
|
+
const valueFor = (key, state)=>{
|
|
29
|
+
if ("opacity" === key) return state.opacity ?? readOpacity(el);
|
|
30
|
+
if ("scale" === key) return state.scale ?? 1;
|
|
31
|
+
if ("x" === key) return state.x ?? 0;
|
|
32
|
+
return state.y ?? 0;
|
|
33
|
+
};
|
|
34
|
+
const animationTargets = Object.keys(to).filter((key)=>valueFor(key, from) !== valueFor(key, to));
|
|
29
35
|
if (0 === animationTargets.length) {
|
|
30
36
|
onComplete?.();
|
|
31
37
|
return {
|
|
@@ -40,10 +46,10 @@ const runMotion = (el, from, to, transition, onComplete)=>{
|
|
|
40
46
|
const start = ()=>{
|
|
41
47
|
animationTargets.forEach((key)=>{
|
|
42
48
|
if ("opacity" === key) {
|
|
43
|
-
const fromValue =
|
|
49
|
+
const fromValue = valueFor(key, from);
|
|
44
50
|
const control = driver({
|
|
45
51
|
from: fromValue,
|
|
46
|
-
to: to
|
|
52
|
+
to: valueFor(key, to),
|
|
47
53
|
duration,
|
|
48
54
|
ease,
|
|
49
55
|
onUpdate: (latest)=>{
|
|
@@ -54,8 +60,8 @@ const runMotion = (el, from, to, transition, onComplete)=>{
|
|
|
54
60
|
controls.push(control);
|
|
55
61
|
return;
|
|
56
62
|
}
|
|
57
|
-
const fromValue =
|
|
58
|
-
const toValue =
|
|
63
|
+
const fromValue = valueFor(key, from);
|
|
64
|
+
const toValue = valueFor(key, to);
|
|
59
65
|
const control = driver({
|
|
60
66
|
from: fromValue,
|
|
61
67
|
to: toValue,
|