@servicetitan/anvil2 1.2.6 → 1.2.8
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/Alert-2e4d9ed5.js +89 -0
- package/Alert-2e4d9ed5.js.map +1 -0
- package/Alert-94c37437.cjs +2 -0
- package/Alert-94c37437.cjs.map +1 -0
- package/Alert.cjs +1 -1
- package/Alert.css +1 -1
- package/Alert.js +1 -1
- package/{Announcement-115eb041.js → Announcement-1db4ac33.js} +11 -11
- package/{Announcement-115eb041.js.map → Announcement-1db4ac33.js.map} +1 -1
- package/{Announcement-4c075fdb.cjs → Announcement-2058bd02.cjs} +2 -2
- package/{Announcement-4c075fdb.cjs.map → Announcement-2058bd02.cjs.map} +1 -1
- package/Announcement.cjs +1 -1
- package/Announcement.js +1 -1
- package/Button-30b35802.cjs +2 -0
- package/Button-30b35802.cjs.map +1 -0
- package/Button-3b93bd5d.js +289 -0
- package/Button-3b93bd5d.js.map +1 -0
- package/Button.cjs +1 -1
- package/Button.cjs.map +1 -1
- package/Button.css +1 -1
- package/Button.js +16 -15
- package/Button.js.map +1 -1
- package/ButtonCompound.cjs +1 -1
- package/ButtonCompound.cjs.map +1 -1
- package/ButtonCompound.js +16 -15
- package/ButtonCompound.js.map +1 -1
- package/ButtonLink.cjs +1 -1
- package/ButtonLink.cjs.map +1 -1
- package/ButtonLink.js +16 -15
- package/ButtonLink.js.map +1 -1
- package/ButtonToggle.cjs +1 -1
- package/ButtonToggle.cjs.map +1 -1
- package/ButtonToggle.js +16 -15
- package/ButtonToggle.js.map +1 -1
- package/{Calendar-c8bc215f.js → Calendar-cbfe3c06.js} +326 -310
- package/{Calendar-c8bc215f.js.map → Calendar-cbfe3c06.js.map} +1 -1
- package/{Calendar-06ced77e.cjs → Calendar-ec151b3b.cjs} +2 -2
- package/{Calendar-06ced77e.cjs.map → Calendar-ec151b3b.cjs.map} +1 -1
- package/Calendar.cjs +1 -1
- package/Calendar.js +1 -1
- package/Combobox.cjs +1 -1
- package/Combobox.cjs.map +1 -1
- package/Combobox.js +16 -15
- package/Combobox.js.map +1 -1
- package/Details.cjs +1 -1
- package/Details.cjs.map +1 -1
- package/Details.js +16 -15
- package/Details.js.map +1 -1
- package/Dialog.cjs +1 -1
- package/Dialog.cjs.map +1 -1
- package/Dialog.js +24 -23
- package/Dialog.js.map +1 -1
- package/Divider-6646eeb8.cjs +2 -0
- package/Divider-6646eeb8.cjs.map +1 -0
- package/Divider-b3bff73a.js +74 -0
- package/Divider-b3bff73a.js.map +1 -0
- package/Divider.cjs +1 -1
- package/Divider.css +1 -1
- package/Divider.js +1 -1
- package/Drawer-21c36b46.js +209 -0
- package/Drawer-21c36b46.js.map +1 -0
- package/Drawer-d332b2da.cjs +2 -0
- package/Drawer-d332b2da.cjs.map +1 -0
- package/Drawer.cjs +1 -1
- package/Drawer.js +1 -1
- package/Link.cjs +1 -1
- package/Link.cjs.map +1 -1
- package/Link.js +16 -15
- package/Link.js.map +1 -1
- package/Menu.cjs +1 -1
- package/Menu.js +1 -1
- package/Overflow.cjs +1 -1
- package/Overflow.cjs.map +1 -1
- package/Overflow.js +18 -17
- package/Overflow.js.map +1 -1
- package/Popover.cjs +1 -1
- package/Popover.cjs.map +1 -1
- package/Popover.d.ts +1 -22
- package/Popover.js +37 -36
- package/Popover.js.map +1 -1
- package/{ProgressBar-91240dab.js → ProgressBar-33e4f5d9.js} +46 -46
- package/{ProgressBar-91240dab.js.map → ProgressBar-33e4f5d9.js.map} +1 -1
- package/{ProgressBar-b25b2493.cjs → ProgressBar-9632fe6e.cjs} +2 -2
- package/ProgressBar-9632fe6e.cjs.map +1 -0
- package/ProgressBar.cjs +1 -1
- package/ProgressBar.css +1 -1
- package/ProgressBar.js +1 -1
- package/SegmentedControl-384bd212.js +108 -0
- package/SegmentedControl-384bd212.js.map +1 -0
- package/SegmentedControl-5d284f09.cjs +2 -0
- package/SegmentedControl-5d284f09.cjs.map +1 -0
- package/SegmentedControl.cjs +2 -0
- package/SegmentedControl.cjs.map +1 -0
- package/SegmentedControl.css +1 -0
- package/SegmentedControl.d.ts +36 -0
- package/SegmentedControl.js +16 -0
- package/SegmentedControl.js.map +1 -0
- package/{SideNav-dbcdf7cb.cjs → SideNav-2a75e772.cjs} +2 -2
- package/{SideNav-dbcdf7cb.cjs.map → SideNav-2a75e772.cjs.map} +1 -1
- package/{SideNav-b5ef91d4.js → SideNav-693494e5.js} +67 -67
- package/{SideNav-b5ef91d4.js.map → SideNav-693494e5.js.map} +1 -1
- package/SideNav.cjs +1 -1
- package/SideNav.js +1 -1
- package/SrOnly-864bd4cb.js.map +1 -1
- package/SrOnly-88e8fca6.cjs.map +1 -1
- package/Stepper-7c787b24.js +391 -0
- package/Stepper-7c787b24.js.map +1 -0
- package/Stepper-e08b9998.cjs +2 -0
- package/Stepper-e08b9998.cjs.map +1 -0
- package/Stepper.cjs +1 -1
- package/Stepper.d.ts +2 -2
- package/Stepper.js +4 -4
- package/Switch-39010760.js.map +1 -1
- package/Switch-c0bea091.cjs.map +1 -1
- package/Tab-0bcbe9c7.cjs.map +1 -1
- package/Tab-f636d6c5.js.map +1 -1
- package/Text-465104f6.js.map +1 -1
- package/Text-631c229a.cjs.map +1 -1
- package/TextField.cjs +1 -1
- package/TextField.cjs.map +1 -1
- package/TextField.js +16 -15
- package/TextField.js.map +1 -1
- package/Textarea.cjs +1 -1
- package/Textarea.cjs.map +1 -1
- package/Textarea.js +16 -15
- package/Textarea.js.map +1 -1
- package/{Toast-70eeeb27.js → Toast-36679136.js} +22 -22
- package/{Toast-70eeeb27.js.map → Toast-36679136.js.map} +1 -1
- package/{Toast-f681677a.cjs → Toast-44e3ff94.cjs} +5 -5
- package/{Toast-f681677a.cjs.map → Toast-44e3ff94.cjs.map} +1 -1
- package/Toast.cjs +1 -1
- package/Toast.js +1 -1
- package/Tooltip.cjs +1 -1
- package/Tooltip.cjs.map +1 -1
- package/Tooltip.js +16 -15
- package/Tooltip.js.map +1 -1
- package/anvil2.cjs +1 -1
- package/anvil2.d.ts +41 -35
- package/anvil2.js +168 -164
- package/anvil2.js.map +1 -1
- package/getKeyboardFocusableElements-ea0e208d-58a00025.js +14 -0
- package/getKeyboardFocusableElements-ea0e208d-58a00025.js.map +1 -0
- package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs +2 -0
- package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs.map +1 -0
- package/index-845dea53-710c1e0d.cjs +2 -0
- package/index-845dea53-710c1e0d.cjs.map +1 -0
- package/index-845dea53-dce876ab.js +521 -0
- package/index-845dea53-dce876ab.js.map +1 -0
- package/index-845dea53.css +1 -0
- package/{index-d1828774.js → index-cfd364c0.js} +1589 -1794
- package/index-cfd364c0.js.map +1 -0
- package/index-f3c3ec15.cjs +23 -0
- package/index-f3c3ec15.cjs.map +1 -0
- package/index3.css +1 -1
- package/package.json +2 -2
- package/useAccessibleColor.cjs +1 -1
- package/useAccessibleColor.js +16 -15
- package/useAccessibleColor.js.map +1 -1
- package/useLinkStyles.cjs +1 -1
- package/useLinkStyles.js +15 -14
- package/useLinkStyles.js.map +1 -1
- package/useMergeRefs.cjs +1 -1
- package/useMergeRefs.js +16 -15
- package/useMergeRefs.js.map +1 -1
- package/usePrefersColorScheme.cjs +1 -1
- package/usePrefersColorScheme.js +16 -15
- package/usePrefersColorScheme.js.map +1 -1
- package/useSwipe.cjs +1 -1
- package/useSwipe.js +16 -15
- package/useSwipe.js.map +1 -1
- package/Alert-9a5ff517.js +0 -89
- package/Alert-9a5ff517.js.map +0 -1
- package/Alert-df710e2c.cjs +0 -2
- package/Alert-df710e2c.cjs.map +0 -1
- package/Button-04337e26.cjs +0 -2
- package/Button-04337e26.cjs.map +0 -1
- package/Button-45864cc0.js +0 -289
- package/Button-45864cc0.js.map +0 -1
- package/Divider-cdc54ec4.cjs +0 -2
- package/Divider-cdc54ec4.cjs.map +0 -1
- package/Divider-e5d4cede.js +0 -74
- package/Divider-e5d4cede.js.map +0 -1
- package/Drawer-d34989aa.js +0 -219
- package/Drawer-d34989aa.js.map +0 -1
- package/Drawer-ec654d43.cjs +0 -2
- package/Drawer-ec654d43.cjs.map +0 -1
- package/ProgressBar-b25b2493.cjs.map +0 -1
- package/Stepper-24609fae.cjs +0 -2
- package/Stepper-24609fae.cjs.map +0 -1
- package/Stepper-af4bf5a4.js +0 -390
- package/Stepper-af4bf5a4.js.map +0 -1
- package/index-96006246.cjs +0 -23
- package/index-96006246.cjs.map +0 -1
- package/index-afacb017-461bfee6.cjs +0 -2
- package/index-afacb017-461bfee6.cjs.map +0 -1
- package/index-afacb017-9c38f9e0.js +0 -310
- package/index-afacb017-9c38f9e0.js.map +0 -1
- package/index-afacb017.css +0 -1
- package/index-d1828774.js.map +0 -1
package/ProgressBar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400;1,6..12,600;1,6..12,700&display=swap";@layer starter,reset,base,state,application;@layer reset{._label_uama7_4{all:unset;font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color, #141414);margin:0;padding:0;border-style:none;border-width:0;border-color:transparent;box-sizing:border-box;display:initial}}@layer base{._label_uama7_4{all:unset;font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color, #141414);margin:0;padding:0;border-style:none;border-width:0;border-color:transparent;box-sizing:border-box;display:initial;display:flex;justify-items:flex-start;gap:.25rem;cursor:default;flex-direction:column;font-size:.875rem;line-height:1}._label_uama7_4 ._top-container_uama7_39{display:flex;gap:.25rem;align-items:flex-start}._label_uama7_4 ._label-text_uama7_44{line-height:1rem;font-weight:600}._label_uama7_4 ._label-text_uama7_44 ._required_uama7_48{color:var(--foreground-color-danger, #e13212);margin-inline-start:.125rem;margin-inline-end:.125rem}._label_uama7_4 ._info-trigger_uama7_53{display:flex;align-items:center;cursor:pointer}._label_uama7_4 ._info-content_uama7_58{max-width:15rem!important}}@layer starter,reset,base,state,application;@layer reset{.
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400;1,6..12,600;1,6..12,700&display=swap";@layer starter,reset,base,state,application;@layer reset{._label_uama7_4{all:unset;font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color, #141414);margin:0;padding:0;border-style:none;border-width:0;border-color:transparent;box-sizing:border-box;display:initial}}@layer base{._label_uama7_4{all:unset;font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color, #141414);margin:0;padding:0;border-style:none;border-width:0;border-color:transparent;box-sizing:border-box;display:initial;display:flex;justify-items:flex-start;gap:.25rem;cursor:default;flex-direction:column;font-size:.875rem;line-height:1}._label_uama7_4 ._top-container_uama7_39{display:flex;gap:.25rem;align-items:flex-start}._label_uama7_4 ._label-text_uama7_44{line-height:1rem;font-weight:600}._label_uama7_4 ._label-text_uama7_44 ._required_uama7_48{color:var(--foreground-color-danger, #e13212);margin-inline-start:.125rem;margin-inline-end:.125rem}._label_uama7_4 ._info-trigger_uama7_53{display:flex;align-items:center;cursor:pointer}._label_uama7_4 ._info-content_uama7_58{max-width:15rem!important}}@layer starter,reset,base,state,application;@layer reset{._content_q4f14_4{all:unset;font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color-inverted, #ffffff);margin:0;padding:.25rem .5rem;border-style:none;border-width:0;border-color:transparent;box-sizing:border-box;display:initial}}@layer base{._content_q4f14_4{font-size:.875rem;width:max-content;white-space:pre-line;background-color:var(--background-color-inverted-strong, #141414);border-radius:.375rem;box-shadow:0 .125rem .5rem var(--shadow-color, rgba(20, 20, 20, .0784313725));line-height:1.5;z-index:1}._arrow_q4f14_29{fill:var(--background-color-inverted-strong, #141414)}._trigger_q4f14_32{height:min-content;display:inline-flex}}@layer starter,reset,base,state,application;@layer reset{._progress-bar_eqffx_4{all:unset;font-family:Nunito Sans,sans-serif;font-size:100%;color:var(--foreground-color, #141414);margin:0;padding:0;border-style:none;border-width:0;border-color:transparent;box-sizing:border-box;display:flex}}@layer base{._progress-bar_eqffx_4{position:relative;flex-direction:column;width:100%;gap:.5rem}._progress-bar_eqffx_4 ._bar-container_eqffx_25{height:.5rem;border-radius:.5rem;overflow:hidden;position:relative;flex-grow:1;background-color:var(--background-color-stronger);display:flex}._progress-bar_eqffx_4 ._bar-container_eqffx_25 ._bar_eqffx_25{-moz-appearance:none;appearance:none;-webkit-appearance:none;height:inherit;border-radius:inherit;width:100%}._progress-bar_eqffx_4 ._bar-container_eqffx_25 ._bar_eqffx_25::-webkit-progress-value{border-radius:.5rem;background-color:var(--status-color-info, #0265dc);transition:width .2s cubic-bezier(0,0,.4,1)}._progress-bar_eqffx_4 ._bar-container_eqffx_25 ._bar_eqffx_25::-webkit-progress-bar{background-color:var(--background-color-stronger)}}@layer state{._progress-bar_eqffx_4 ._check-icon_eqffx_51{color:var(--status-color-success, #007a4d)}._progress-bar_eqffx_4 ._error-icon_eqffx_54{color:var(--status-color-danger, #e13212)}._progress-bar_eqffx_4 ._bar-container_eqffx_25:has(._bar_eqffx_25:not([value])):before{content:"";position:absolute;width:25%;inset-block-start:0;inset-block-end:0;inset-inline-start:100%;background-color:var(--status-color-info, #0265dc);border-radius:.25rem;animation:_indeterminate_eqffx_1 1s ease-in-out infinite alternate forwards}._progress-bar_eqffx_4._success_eqffx_68 ._bar_eqffx_25::-webkit-progress-value{background-color:var(--status-color-success, #007a4d)}._progress-bar_eqffx_4._success_eqffx_68 ._bar_eqffx_25:not([value]):before{background-color:var(--status-color-success, #007a4d)}._progress-bar_eqffx_4._error_eqffx_54 ._bar_eqffx_25::-webkit-progress-value{background-color:var(--status-color-danger, #e13212)}._progress-bar_eqffx_4._error_eqffx_54 ._bar_eqffx_25:not([value]):before{background-color:var(--status-color-danger, #e13212)}}@keyframes _indeterminate_eqffx_1{0%{inset-inline-start:-25%}to{inset-inline-start:100%}}
|
package/ProgressBar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-82a9ddf6.js";
|
|
2
|
-
import { U as s } from "./ProgressBar-
|
|
2
|
+
import { U as s } from "./ProgressBar-33e4f5d9.js";
|
|
3
3
|
import { forwardRef as m } from "react";
|
|
4
4
|
const p = m(
|
|
5
5
|
(r, o) => /* @__PURE__ */ t.jsx(s, { ref: o, ...r })
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import "./SegmentedControl.css";
|
|
2
|
+
import { f as e } from "./jsx-runtime-944c88e2-e73fa629.js";
|
|
3
|
+
import { forwardRef as p, useContext as v, useRef as y, createContext as N, useState as S, useId as R } from "react";
|
|
4
|
+
import { c as C } from "./index-e0f6271a.js";
|
|
5
|
+
import { C as k } from "./Icon-b443eea4.js";
|
|
6
|
+
import { u as b } from "./floating-ui.react-8d61182d.js";
|
|
7
|
+
import { u as z } from "./use-reduced-motion-b359504d.js";
|
|
8
|
+
import { m as F } from "./motion-a0a946d6.js";
|
|
9
|
+
const I = "_legend_1w0sh_5", M = "_children_1w0sh_6", O = "_segment_1w0sh_4", P = "_fill_1w0sh_82", E = "_small_1w0sh_85", H = "_medium_1w0sh_94", s = {
|
|
10
|
+
"segmented-control": "_segmented-control_1w0sh_4",
|
|
11
|
+
legend: I,
|
|
12
|
+
children: M,
|
|
13
|
+
"select-indicator": "_select-indicator_1w0sh_7",
|
|
14
|
+
segment: O,
|
|
15
|
+
fill: P,
|
|
16
|
+
small: E,
|
|
17
|
+
"icon-only": "_icon-only_1w0sh_91",
|
|
18
|
+
medium: H
|
|
19
|
+
}, x = p((m, c) => {
|
|
20
|
+
const { icon: t, value: n, children: r, className: d, ...u } = m, _ = z(), { current: o, setCurrent: l, name: a, onChange: i } = v(
|
|
21
|
+
w
|
|
22
|
+
), g = y(null), h = () => {
|
|
23
|
+
l == null || l(n), i == null || i(n);
|
|
24
|
+
}, f = C(s.segment, d, {
|
|
25
|
+
[s["icon-only"]]: t && !r
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
28
|
+
"label",
|
|
29
|
+
{
|
|
30
|
+
className: f,
|
|
31
|
+
ref: b([g, c]),
|
|
32
|
+
"data-anv": "segmented-control-segment",
|
|
33
|
+
...u,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ e.jsx(
|
|
36
|
+
"input",
|
|
37
|
+
{
|
|
38
|
+
type: "radio",
|
|
39
|
+
name: a,
|
|
40
|
+
value: n,
|
|
41
|
+
onChange: h,
|
|
42
|
+
checked: o === n,
|
|
43
|
+
"aria-checked": o === n
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
t ? /* @__PURE__ */ e.jsx(k, { svg: t, "aria-hidden": !0 }) : null,
|
|
47
|
+
r,
|
|
48
|
+
o === n && /* @__PURE__ */ e.jsx(
|
|
49
|
+
F.span,
|
|
50
|
+
{
|
|
51
|
+
layoutId: a,
|
|
52
|
+
transition: {
|
|
53
|
+
duration: _ ? 0 : 0.2
|
|
54
|
+
},
|
|
55
|
+
className: s["select-indicator"]
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
) });
|
|
61
|
+
});
|
|
62
|
+
x.displayName = "Segmented Control Segment";
|
|
63
|
+
const w = N({}), j = p((m, c) => {
|
|
64
|
+
const {
|
|
65
|
+
className: t,
|
|
66
|
+
onClick: n,
|
|
67
|
+
onChange: r,
|
|
68
|
+
children: d,
|
|
69
|
+
size: u = "medium",
|
|
70
|
+
defaultSelected: _,
|
|
71
|
+
name: o,
|
|
72
|
+
fill: l,
|
|
73
|
+
...a
|
|
74
|
+
} = m, [i, g] = S(_), h = C(
|
|
75
|
+
s["segmented-control"],
|
|
76
|
+
s[u],
|
|
77
|
+
t,
|
|
78
|
+
{
|
|
79
|
+
[s.fill]: l
|
|
80
|
+
}
|
|
81
|
+
), f = R();
|
|
82
|
+
return /* @__PURE__ */ e.jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
role: "radiogroup",
|
|
86
|
+
className: h,
|
|
87
|
+
"data-anv": "segmented-control",
|
|
88
|
+
ref: c,
|
|
89
|
+
...a,
|
|
90
|
+
children: /* @__PURE__ */ e.jsx(
|
|
91
|
+
w.Provider,
|
|
92
|
+
{
|
|
93
|
+
value: { current: i, setCurrent: g, name: o ?? f, onChange: r },
|
|
94
|
+
children: d
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
j.displayName = "Segmented Control";
|
|
101
|
+
const K = Object.assign(j, {
|
|
102
|
+
Segment: x
|
|
103
|
+
});
|
|
104
|
+
export {
|
|
105
|
+
x as C,
|
|
106
|
+
K as L
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=SegmentedControl-384bd212.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl-384bd212.js","sources":["../node_modules/@servicetitan/hammer-react/dist/SegmentedControl.js"],"sourcesContent":["import \"./index25.css\";\nimport { j as e } from \"./jsx-runtime-944c88e2.js\";\nimport { forwardRef as p, useContext as w, useRef as N, createContext as y, useState as v, useId as R } from \"react\";\nimport x from \"classnames\";\nimport { useReducedMotion as b, motion as k } from \"framer-motion\";\nimport { Icon as I } from \"./Icon.js\";\nimport { useMergeRefs as M } from \"@floating-ui/react\";\nconst E = \"_legend_1w0sh_5\", z = \"_children_1w0sh_6\", F = \"_segment_1w0sh_4\", H = \"_fill_1w0sh_82\", O = \"_small_1w0sh_85\", P = \"_medium_1w0sh_94\", t = {\n \"segmented-control\": \"_segmented-control_1w0sh_4\",\n legend: E,\n children: z,\n \"select-indicator\": \"_select-indicator_1w0sh_7\",\n segment: F,\n fill: H,\n small: O,\n \"icon-only\": \"_icon-only_1w0sh_91\",\n medium: P\n}, C = p((a, i) => {\n const { icon: o, value: n, children: c, className: d, ...g } = a, u = b(), { current: s, setCurrent: l, name: m, onChange: r } = w(\n S\n ), _ = N(null), h = () => {\n l == null || l(n), r == null || r(n);\n }, f = x(t.segment, d, {\n [t[\"icon-only\"]]: o && !c\n });\n return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(\n \"label\",\n {\n className: f,\n ref: M([_, i]),\n \"data-anv\": \"segmented-control-segment\",\n ...g,\n children: [\n /* @__PURE__ */ e.jsx(\n \"input\",\n {\n type: \"radio\",\n name: m,\n value: n,\n onChange: h,\n checked: s === n,\n \"aria-checked\": s === n\n }\n ),\n o ? /* @__PURE__ */ e.jsx(I, { svg: o, \"aria-hidden\": !0 }) : null,\n c,\n s === n && /* @__PURE__ */ e.jsx(\n k.span,\n {\n layoutId: m,\n transition: {\n duration: u ? 0 : 0.2\n },\n className: t[\"select-indicator\"]\n }\n )\n ]\n }\n ) });\n});\nC.displayName = \"Segmented Control Segment\";\nconst S = y({}), j = p((a, i) => {\n const {\n className: o,\n onClick: n,\n onChange: c,\n children: d,\n size: g = \"medium\",\n defaultSelected: u,\n name: s,\n fill: l,\n ...m\n } = a, [r, _] = v(u), h = x(\n t[\"segmented-control\"],\n t[g],\n o,\n {\n [t.fill]: l\n }\n ), f = R();\n return /* @__PURE__ */ e.jsx(\n \"div\",\n {\n role: \"radiogroup\",\n className: h,\n \"data-anv\": \"segmented-control\",\n ref: i,\n ...m,\n children: /* @__PURE__ */ e.jsx(\n S.Provider,\n {\n value: { current: r, setCurrent: _, name: s ?? f, onChange: c },\n children: d\n }\n )\n }\n );\n});\nj.displayName = \"Segmented Control\";\nconst L = Object.assign(j, {\n Segment: C\n});\nexport {\n L as SegmentedControl,\n C as SegmentedControlSegment\n};\n//# sourceMappingURL=SegmentedControl.js.map\n"],"names":["E","z","F","H","O","P","t","C","forwardRef","a","i","o","c","g","u","useReducedMotion","s","m","r","useContext","S","_","useRef","cx","fr","useMergeRefs","C$1","motion","createContext","useState","useId","L"],"mappings":";;;;;;;;AAOK,MAAAA,IAAA,mBAAAC,IAAA,qBAAAC,IAAA,oBAAAC,IAAA,kBAAAC,IAAA,mBAAAC,IAAA,oBAAAC,IAAA;AAAA,EACL,qBAAA;AAAA,EACA,QAAAN;AAAA,EACA,UAAAC;AAAA,EACA,oBAAA;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAA;AAAA,EACA,QAAAC;AACA,GAAAE,IAAAC,EAAA,CAAAC,GAAAC,MAAA;AACA,QAAA,EAAA,MAAAC,GAAA,OAAA,GAAA,UAAAC,GAAA,WAAA,GAAA,GAAAC,EAAA,IAAAJ,GAAAK,IAAAC,EAAA,GAAA,EAAA,SAAAC,GAAA,YAAA,GAAA,MAAAC,GAAA,UAAAC,EAAA,IAAAC;AAAA,IACAC;AAAA,EACA,GAAAC,IAAAC,EAAA,IAAA,GAAA,IAAA,MAAA;AACA,SAAA,QAAA,EAAA,CAAA,GAAAJ,KAAA,QAAAA,EAAA,CAAA;AAAA,EACA,GAAA,IAAAK,EAAAjB,EAAA,SAAA,GAAA;AAAA,IACA,CAAAA,EAAA,WAAA,CAAA,GAAAK,KAAA,CAAAC;AAAA,EACA,CAAA;AACA,SAAA,gBAAAY,EAAA,IAAAA,EAAA,UAAA,EAAA,UAAA,gBAAAA,EAAA;AAAA,IACA;AAAA,IACA;AAAA,MACA,WAAA;AAAA,MACA,KAAAC,EAAA,CAAAJ,GAAAX,CAAA,CAAA;AAAA,MACA,YAAA;AAAA,MACA,GAAAG;AAAA,MACA,UAAA;AAAA,QACA,gBAAAW,EAAA;AAAA,UACA;AAAA,UACA;AAAA,YACA,MAAA;AAAA,YACA,MAAAP;AAAA,YACA,OAAA;AAAA,YACA,UAAA;AAAA,YACA,SAAAD,MAAA;AAAA,YACA,gBAAAA,MAAA;AAAA,UACA;AAAA,QACA;AAAA,QACAL,IAAA,gBAAAa,EAAA,IAAAE,GAAA,EAAA,KAAAf,GAAA,eAAA,GAAA,CAAA,IAAA;AAAA,QACAC;AAAA,QACAI,MAAA,KAAA,gBAAAQ,EAAA;AAAA,UACAG,EAAA;AAAA,UACA;AAAA,YACA,UAAAV;AAAA,YACA,YAAA;AAAA,cACA,UAAAH,IAAA,IAAA;AAAA,YACA;AAAA,YACA,WAAAR,EAAA,kBAAA;AAAA,UACA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA,EAAA,CAAA;AACA,CAAA;AACAC,EAAA,cAAA;AACA,MAAAa,IAAAQ,EAAA,CAAA,CAAA,GAAA,IAAApB,EAAA,CAAAC,GAAAC,MAAA;AACA,QAAA;AAAA,IACA,WAAAC;AAAA,IACA,SAAA;AAAA,IACA,UAAAC;AAAA,IACA,UAAA;AAAA,IACA,MAAAC,IAAA;AAAA,IACA,iBAAAC;AAAA,IACA,MAAAE;AAAA,IACA,MAAA;AAAA,IACA,GAAAC;AAAA,EACA,IAAAR,GAAA,CAAAS,GAAAG,CAAA,IAAAQ,EAAAf,CAAA,GAAA,IAAAS;AAAA,IACAjB,EAAA,mBAAA;AAAA,IACAA,EAAAO,CAAA;AAAA,IACAF;AAAA,IACA;AAAA,MACA,CAAAL,EAAA,IAAA,GAAA;AAAA,IACA;AAAA,EACA,GAAA,IAAAwB,EAAA;AACA,SAAA,gBAAAN,EAAA;AAAA,IACA;AAAA,IACA;AAAA,MACA,MAAA;AAAA,MACA,WAAA;AAAA,MACA,YAAA;AAAA,MACA,KAAAd;AAAA,MACA,GAAAO;AAAA,MACA,UAAA,gBAAAO,EAAA;AAAA,QACAJ,EAAA;AAAA,QACA;AAAA,UACA,OAAA,EAAA,SAAAF,GAAA,YAAAG,GAAA,MAAAL,KAAA,GAAA,UAAAJ,EAAA;AAAA,UACA,UAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA,CAAA;AACA,EAAA,cAAA;AACK,MAAAmB,IAAA,OAAA,OAAA,GAAA;AAAA,EACL,SAAAxB;AACA,CAAA;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var F=require("./SegmentedControl.css");const e=require("./jsx-runtime-944c88e2-2b81c205.cjs"),t=require("react"),w=require("./index-67d20edb.cjs"),R=require("./Icon-43ce0e6c.cjs"),p=require("./floating-ui.react-5347095a.cjs"),q=require("./use-reduced-motion-a766a46b.cjs"),y=require("./motion-dae3950e.cjs");const N="_legend_1w0sh_5",S="_children_1w0sh_6",k="_segment_1w0sh_4",I="_fill_1w0sh_82",M="_small_1w0sh_85",b="_medium_1w0sh_94",s={"segmented-control":"_segmented-control_1w0sh_4",legend:N,children:S,"select-indicator":"_select-indicator_1w0sh_7",segment:k,fill:I,small:M,"icon-only":"_icon-only_1w0sh_91",medium:b},C=t.forwardRef((d,u)=>{const{icon:r,value:n,children:l,className:m,..._}=d,g=q.useReducedMotion(),{current:o,setCurrent:c,name:i,onChange:a}=t.useContext(j),h=t.useRef(null),f=()=>{c==null||c(n),a==null||a(n)},x=w.cx(s.segment,m,{[s["icon-only"]]:r&&!l});return e.fr.jsx(e.fr.Fragment,{children:e.fr.jsxs("label",{className:x,ref:p.useMergeRefs([h,u]),"data-anv":"segmented-control-segment",..._,children:[e.fr.jsx("input",{type:"radio",name:i,value:n,onChange:f,checked:o===n,"aria-checked":o===n}),r?e.fr.jsx(R.C,{svg:r,"aria-hidden":!0}):null,l,o===n&&e.fr.jsx(y.motion.span,{layoutId:i,transition:{duration:g?0:.2},className:s["select-indicator"]})]})})});C.displayName="Segmented Control Segment";const j=t.createContext({}),v=t.forwardRef((d,u)=>{const{className:r,onClick:n,onChange:l,children:m,size:_="medium",defaultSelected:g,name:o,fill:c,...i}=d,[a,h]=t.useState(g),f=w.cx(s["segmented-control"],s[_],r,{[s.fill]:c}),x=t.useId();return e.fr.jsx("div",{role:"radiogroup",className:f,"data-anv":"segmented-control",ref:u,...i,children:e.fr.jsx(j.Provider,{value:{current:a,setCurrent:h,name:o??x,onChange:l},children:m})})});v.displayName="Segmented Control";const z=Object.assign(v,{Segment:C});exports.C=C;exports.L=z;
|
|
2
|
+
//# sourceMappingURL=SegmentedControl-5d284f09.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl-5d284f09.cjs","sources":["../node_modules/@servicetitan/hammer-react/dist/SegmentedControl.js"],"sourcesContent":["import \"./index25.css\";\nimport { j as e } from \"./jsx-runtime-944c88e2.js\";\nimport { forwardRef as p, useContext as w, useRef as N, createContext as y, useState as v, useId as R } from \"react\";\nimport x from \"classnames\";\nimport { useReducedMotion as b, motion as k } from \"framer-motion\";\nimport { Icon as I } from \"./Icon.js\";\nimport { useMergeRefs as M } from \"@floating-ui/react\";\nconst E = \"_legend_1w0sh_5\", z = \"_children_1w0sh_6\", F = \"_segment_1w0sh_4\", H = \"_fill_1w0sh_82\", O = \"_small_1w0sh_85\", P = \"_medium_1w0sh_94\", t = {\n \"segmented-control\": \"_segmented-control_1w0sh_4\",\n legend: E,\n children: z,\n \"select-indicator\": \"_select-indicator_1w0sh_7\",\n segment: F,\n fill: H,\n small: O,\n \"icon-only\": \"_icon-only_1w0sh_91\",\n medium: P\n}, C = p((a, i) => {\n const { icon: o, value: n, children: c, className: d, ...g } = a, u = b(), { current: s, setCurrent: l, name: m, onChange: r } = w(\n S\n ), _ = N(null), h = () => {\n l == null || l(n), r == null || r(n);\n }, f = x(t.segment, d, {\n [t[\"icon-only\"]]: o && !c\n });\n return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(\n \"label\",\n {\n className: f,\n ref: M([_, i]),\n \"data-anv\": \"segmented-control-segment\",\n ...g,\n children: [\n /* @__PURE__ */ e.jsx(\n \"input\",\n {\n type: \"radio\",\n name: m,\n value: n,\n onChange: h,\n checked: s === n,\n \"aria-checked\": s === n\n }\n ),\n o ? /* @__PURE__ */ e.jsx(I, { svg: o, \"aria-hidden\": !0 }) : null,\n c,\n s === n && /* @__PURE__ */ e.jsx(\n k.span,\n {\n layoutId: m,\n transition: {\n duration: u ? 0 : 0.2\n },\n className: t[\"select-indicator\"]\n }\n )\n ]\n }\n ) });\n});\nC.displayName = \"Segmented Control Segment\";\nconst S = y({}), j = p((a, i) => {\n const {\n className: o,\n onClick: n,\n onChange: c,\n children: d,\n size: g = \"medium\",\n defaultSelected: u,\n name: s,\n fill: l,\n ...m\n } = a, [r, _] = v(u), h = x(\n t[\"segmented-control\"],\n t[g],\n o,\n {\n [t.fill]: l\n }\n ), f = R();\n return /* @__PURE__ */ e.jsx(\n \"div\",\n {\n role: \"radiogroup\",\n className: h,\n \"data-anv\": \"segmented-control\",\n ref: i,\n ...m,\n children: /* @__PURE__ */ e.jsx(\n S.Provider,\n {\n value: { current: r, setCurrent: _, name: s ?? f, onChange: c },\n children: d\n }\n )\n }\n );\n});\nj.displayName = \"Segmented Control\";\nconst L = Object.assign(j, {\n Segment: C\n});\nexport {\n L as SegmentedControl,\n C as SegmentedControlSegment\n};\n//# sourceMappingURL=SegmentedControl.js.map\n"],"names":["E","z","F","H","O","P","t","React","a","i","o","c","d","g","u","useReducedMotion","s","l","m","r","S","_","h","f","index","jsxRuntime944c88e2","floatingUi_react","Icon","motion","j","L"],"mappings":"qTAOK,MAAAA,EAAA,kBAAAC,EAAA,oBAAAC,EAAA,mBAAAC,EAAA,iBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,CACL,oBAAA,6BACA,OAAAN,EACA,SAAAC,EACA,mBAAA,4BACA,QAAAC,EACA,KAAAC,EACA,MAAAC,EACA,YAAA,sBACA,OAAAC,CACA,EAAA,EAAAE,EAAA,WAAA,CAAAC,EAAAC,IAAA,CACA,KAAA,CAAA,KAAAC,EAAA,MAAA,EAAA,SAAAC,EAAA,UAAAC,EAAA,GAAAC,CAAA,EAAAL,EAAAM,EAAAC,EAAA,iBAAA,EAAA,CAAA,QAAAC,EAAA,WAAAC,EAAA,KAAAC,EAAA,SAAAC,CAAA,EAAAZ,EAAA,WACAa,CACA,EAAAC,EAAAd,EAAA,OAAA,IAAA,EAAAe,EAAA,IAAA,CACAL,GAAA,MAAAA,EAAA,CAAA,EAAAE,GAAA,MAAAA,EAAA,CAAA,CACA,EAAAI,EAAAC,EAAA,GAAAlB,EAAA,QAAAM,EAAA,CACA,CAAAN,EAAA,WAAA,CAAA,EAAAI,GAAA,CAAAC,CACA,CAAA,EACA,OAAAc,EAAA,GAAA,IAAAA,EAAA,GAAA,SAAA,CAAA,SAAAA,EAAA,GAAA,KACA,QACA,CACA,UAAAF,EACA,IAAAG,EAAA,aAAA,CAAAL,EAAAZ,CAAA,CAAA,EACA,WAAA,4BACA,GAAAI,EACA,SAAA,CACAY,EAAA,GAAA,IACA,QACA,CACA,KAAA,QACA,KAAAP,EACA,MAAA,EACA,SAAAI,EACA,QAAAN,IAAA,EACA,eAAAA,IAAA,CACA,CACA,EACAN,EAAAe,EAAA,GAAA,IAAAE,EAAA,EAAA,CAAA,IAAAjB,EAAA,cAAA,EAAA,CAAA,EAAA,KACAC,EACAK,IAAA,GAAAS,EAAA,GAAA,IACAG,EAAA,OAAA,KACA,CACA,SAAAV,EACA,WAAA,CACA,SAAAJ,EAAA,EAAA,EACA,EACA,UAAAR,EAAA,kBAAA,CACA,CACA,CACA,CACA,CACA,CAAA,CAAA,CACA,CAAA,EACA,EAAA,YAAA,4BACA,MAAAc,EAAAb,EAAA,cAAA,CAAA,CAAA,EAAAsB,EAAAtB,EAAA,WAAA,CAAAC,EAAAC,IAAA,CACA,KAAA,CACA,UAAAC,EACA,QAAA,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EAAA,SACA,gBAAAC,EACA,KAAAE,EACA,KAAAC,EACA,GAAAC,CACA,EAAAV,EAAA,CAAAW,EAAAE,CAAA,EAAAd,EAAA,SAAAO,CAAA,EAAAQ,EAAAE,EAAA,GACAlB,EAAA,mBAAA,EACAA,EAAAO,CAAA,EACAH,EACA,CACA,CAAAJ,EAAA,IAAA,EAAAW,CACA,CACA,EAAAM,EAAAhB,EAAA,MAAA,EACA,OAAAkB,EAAA,GAAA,IACA,MACA,CACA,KAAA,aACA,UAAAH,EACA,WAAA,oBACA,IAAAb,EACA,GAAAS,EACA,SAAAO,EAAA,GAAA,IACAL,EAAA,SACA,CACA,MAAA,CAAA,QAAAD,EAAA,WAAAE,EAAA,KAAAL,GAAAO,EAAA,SAAAZ,CAAA,EACA,SAAAC,CACA,CACA,CACA,CACA,CACA,CAAA,EACAiB,EAAA,YAAA,oBACK,MAAAC,EAAA,OAAA,OAAAD,EAAA,CACL,QAAA,CACA,CAAA","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./jsx-runtime-494437bb.cjs"),o=require("./SegmentedControl-5d284f09.cjs"),r=require("react"),m=r.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(o.L,{ref:t,...e})),s=r.forwardRef((e,t)=>n.jsxRuntimeExports.jsx(o.C,{ref:t,...e})),u=Object.assign(m,{Segment:s});exports.SegmentedControl=u;exports.SegmentedControlSegment=s;exports.default=u;
|
|
2
|
+
//# sourceMappingURL=SegmentedControl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.cjs","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n SegmentedControlProps as CoreSegmentedControlProps,\n SegmentedControl as CoreSegmentedControl,\n SegmentedControlSegmentProps as CoreSegmentedControlSegmentProps,\n SegmentedControlSegment as CoreSegmentedControlSegment,\n} from \"@servicetitan/hammer-react/dist/SegmentedControl\";\nimport { Ref, forwardRef } from \"react\";\n\nexport type SegmentedControlProps = CoreSegmentedControlProps;\nexport type SegmentedControlSegmentProps = CoreSegmentedControlSegmentProps;\n\nconst SegmentedControlElement = forwardRef(\n (props: CoreSegmentedControlProps, ref: Ref<HTMLDivElement>) => {\n return <CoreSegmentedControl ref={ref} {...props} />;\n }\n);\n\nexport const SegmentedControlSegment = forwardRef(\n (props: CoreSegmentedControlSegmentProps, ref: Ref<HTMLLabelElement>) => {\n return <CoreSegmentedControlSegment ref={ref} {...props} />;\n }\n);\n\nexport const SegmentedControl = Object.assign(SegmentedControlElement, {\n Segment: SegmentedControlSegment,\n});\n"],"names":["SegmentedControlElement","forwardRef","props","ref","jsx","CoreSegmentedControl","SegmentedControlSegment","CoreSegmentedControlSegment","SegmentedControl"],"mappings":"0NAWMA,EAA0BC,EAAA,WAC9B,CAACC,EAAkCC,IACzBC,EAAAA,kBAAAA,IAAAC,EAAAA,EAAA,CAAqB,IAAAF,EAAW,GAAGD,CAAO,CAAA,CAEtD,EAEaI,EAA0BL,EAAA,WACrC,CAACC,EAAyCC,IAChCC,EAAAA,kBAAAA,IAAAG,EAAAA,EAAA,CAA4B,IAAAJ,EAAW,GAAGD,CAAO,CAAA,CAE7D,EAEaM,EAAmB,OAAO,OAAOR,EAAyB,CACrE,QAASM,CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400;1,6..12,600;1,6..12,700&display=swap";@layer starter,reset,base,state,application;@layer reset{._segmented-control_1w0sh_4,._legend_1w0sh_5,._children_1w0sh_6,._select-indicator_1w0sh_7,._segment_1w0sh_4{all:unset}}@layer base{._segmented-control_1w0sh_4{max-width:100%;width:fit-content;display:inline-flex;flex-direction:row;flex-wrap:nowrap;background-color:var(--background-color-stronger, #eeeeee);position:relative;border-radius:.375rem;border-style:solid;border-color:var(--border-color-subdued, #dfe0e1);border-width:.0625rem;padding:.25rem;gap:.5rem;z-index:1;overflow:auto;box-sizing:border-box}._segmented-control_1w0sh_4:disabled{opacity:.6}._segment_1w0sh_4{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;position:relative;height:auto;flex-shrink:0;flex-grow:1;gap:.5rem;color:var(--foreground-color, #141414);border-radius:.25rem}._segment_1w0sh_4 input{position:absolute;width:0;height:0;opacity:0;top:0;left:0}._segment_1w0sh_4:has(input:checked){z-index:-1}._segment_1w0sh_4:before{position:absolute;pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;top:0;right:0;bottom:0;left:0;transition:background-color .2s cubic-bezier(0,0,.4,1);z-index:-1}._select-indicator_1w0sh_7{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;background-color:var(--background-color, #ffffff);border-radius:.25rem;box-shadow:var(--shadow-color, rgba(20, 20, 20, .0784313725)) 0 .125rem .5rem;outline:0 solid var(--focus-ring-color, #0265dc);outline-offset:.125rem;z-index:-1;transition:outline .2s cubic-bezier(0,0,.4,1)}}@layer state{._segmented-control_1w0sh_4._fill_1w0sh_82{width:-webkit-fill-available}._segmented-control_1w0sh_4._small_1w0sh_85{height:2rem}._segmented-control_1w0sh_4._small_1w0sh_85 ._segment_1w0sh_4{padding-inline:.75rem}._segmented-control_1w0sh_4._small_1w0sh_85 ._segment_1w0sh_4._icon-only_1w0sh_91{padding-inline:.1875rem}._segmented-control_1w0sh_4._medium_1w0sh_94{height:2.5rem}._segmented-control_1w0sh_4._medium_1w0sh_94 ._segment_1w0sh_4{padding-inline:1rem}._segmented-control_1w0sh_4._medium_1w0sh_94 ._segment_1w0sh_4._icon-only_1w0sh_91{padding-inline:.4375rem}._segment_1w0sh_4:has(input:focus-visible) ._select-indicator_1w0sh_7,._segment_1w0sh_4[data-interactive=focus-visible] ._select-indicator_1w0sh_7{outline-width:.125rem}._segment_1w0sh_4:not(:has(input:checked)):hover,._segment_1w0sh_4:not(:has(input:checked))[data-interactive=hover]{background-color:var(--overlay-color-hover, rgba(20, 20, 20, .0784313725))}._segment_1w0sh_4:not(:has(input:checked)):active,._segment_1w0sh_4:not(:has(input:checked))[data-interactive=active]{background-color:var(--overlay-color-active, rgba(20, 20, 20, .1607843137))}}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DetailedHTMLProps } from 'react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { FunctionComponent } from 'react';
|
|
4
|
+
import { HTMLAttributes } from 'react';
|
|
5
|
+
import { LabelHTMLAttributes } from 'react';
|
|
6
|
+
import { LayoutUtilProps } from '@servicetitan/hammer-react/dist/SegmentedControl';
|
|
7
|
+
import { RefAttributes } from 'react';
|
|
8
|
+
import { SegmentedControlProps as SegmentedControlProps_2 } from '@servicetitan/hammer-react/dist/SegmentedControl';
|
|
9
|
+
import { SegmentedControlSegmentProps as SegmentedControlSegmentProps_2 } from '@servicetitan/hammer-react/dist/SegmentedControl';
|
|
10
|
+
import { SVGProps } from 'react';
|
|
11
|
+
|
|
12
|
+
declare const SegmentedControl: ForwardRefExoticComponent<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LayoutUtilProps & {
|
|
13
|
+
onChange?: (value: SegmentedControlSegmentProps_2["value"]) => void;
|
|
14
|
+
defaultSelected: SegmentedControlSegmentProps_2["value"];
|
|
15
|
+
size?: Extract<"small" | "medium" | "large" | "0" | "xsmall" | "xlarge", "small" | "medium">;
|
|
16
|
+
fill?: boolean;
|
|
17
|
+
name?: string;
|
|
18
|
+
} & RefAttributes<HTMLDivElement>> & {
|
|
19
|
+
Segment: ForwardRefExoticComponent<Omit< DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
20
|
+
icon?: FunctionComponent<SVGProps<SVGSVGElement>> | undefined;
|
|
21
|
+
value: string;
|
|
22
|
+
} & RefAttributes<HTMLLabelElement>>;
|
|
23
|
+
};
|
|
24
|
+
export { SegmentedControl }
|
|
25
|
+
export default SegmentedControl;
|
|
26
|
+
|
|
27
|
+
export declare type SegmentedControlProps = SegmentedControlProps_2;
|
|
28
|
+
|
|
29
|
+
export declare const SegmentedControlSegment: ForwardRefExoticComponent<Omit< DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
30
|
+
icon?: FunctionComponent<SVGProps<SVGSVGElement>> | undefined;
|
|
31
|
+
value: string;
|
|
32
|
+
} & RefAttributes<HTMLLabelElement>>;
|
|
33
|
+
|
|
34
|
+
export declare type SegmentedControlSegmentProps = SegmentedControlSegmentProps_2;
|
|
35
|
+
|
|
36
|
+
export { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { j as o } from "./jsx-runtime-82a9ddf6.js";
|
|
2
|
+
import { L as n, C as m } from "./SegmentedControl-384bd212.js";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
4
|
+
const s = r(
|
|
5
|
+
(e, t) => /* @__PURE__ */ o.jsx(n, { ref: t, ...e })
|
|
6
|
+
), f = r(
|
|
7
|
+
(e, t) => /* @__PURE__ */ o.jsx(m, { ref: t, ...e })
|
|
8
|
+
), i = Object.assign(s, {
|
|
9
|
+
Segment: f
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
i as SegmentedControl,
|
|
13
|
+
f as SegmentedControlSegment,
|
|
14
|
+
i as default
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import {\n SegmentedControlProps as CoreSegmentedControlProps,\n SegmentedControl as CoreSegmentedControl,\n SegmentedControlSegmentProps as CoreSegmentedControlSegmentProps,\n SegmentedControlSegment as CoreSegmentedControlSegment,\n} from \"@servicetitan/hammer-react/dist/SegmentedControl\";\nimport { Ref, forwardRef } from \"react\";\n\nexport type SegmentedControlProps = CoreSegmentedControlProps;\nexport type SegmentedControlSegmentProps = CoreSegmentedControlSegmentProps;\n\nconst SegmentedControlElement = forwardRef(\n (props: CoreSegmentedControlProps, ref: Ref<HTMLDivElement>) => {\n return <CoreSegmentedControl ref={ref} {...props} />;\n }\n);\n\nexport const SegmentedControlSegment = forwardRef(\n (props: CoreSegmentedControlSegmentProps, ref: Ref<HTMLLabelElement>) => {\n return <CoreSegmentedControlSegment ref={ref} {...props} />;\n }\n);\n\nexport const SegmentedControl = Object.assign(SegmentedControlElement, {\n Segment: SegmentedControlSegment,\n});\n"],"names":["SegmentedControlElement","forwardRef","props","ref","jsx","CoreSegmentedControl","SegmentedControlSegment","CoreSegmentedControlSegment","SegmentedControl"],"mappings":";;;AAWA,MAAMA,IAA0BC;AAAA,EAC9B,CAACC,GAAkCC,MACzBC,gBAAAA,EAAAA,IAAAC,GAAA,EAAqB,KAAAF,GAAW,GAAGD,EAAO,CAAA;AAEtD,GAEaI,IAA0BL;AAAA,EACrC,CAACC,GAAyCC,MAChCC,gBAAAA,EAAAA,IAAAG,GAAA,EAA4B,KAAAJ,GAAW,GAAGD,EAAO,CAAA;AAE7D,GAEaM,IAAmB,OAAO,OAAOR,GAAyB;AAAA,EACrE,SAASM;AACX,CAAC;"}
|
|
@@ -17,5 +17,5 @@ object-assign
|
|
|
17
17
|
(c) Sindre Sorhus
|
|
18
18
|
@license MIT
|
|
19
19
|
*/var oe,Te;function ze(){if(Te)return oe;Te=1;var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function o(c){if(c==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function g(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de",Object.getOwnPropertyNames(c)[0]==="5")return!1;for(var y={},u=0;u<10;u++)y["_"+String.fromCharCode(u)]=u;var _=Object.getOwnPropertyNames(y).map(function(v){return y[v]});if(_.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(v){l[v]=v}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return oe=g()?Object.assign:function(c,y){for(var u,_=o(c),l,v=1;v<arguments.length;v++){u=Object(arguments[v]);for(var d in u)i.call(u,d)&&(_[d]=u[d]);if(e){l=e(u);for(var w=0;w<l.length;w++)s.call(u,l[w])&&(_[l[w]]=u[l[w]])}}return _},oe}var ae,xe;function pe(){if(xe)return ae;xe=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ae=e,ae}var ie,Se;function Ce(){return Se||(Se=1,ie=Function.call.bind(Object.prototype.hasOwnProperty)),ie}var se,Oe;function Fe(){if(Oe)return se;Oe=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var i=pe(),s={},o=Ce();e=function(c){var y="Warning: "+c;typeof console<"u"&&console.error(y);try{throw new Error(y)}catch{}}}function g(c,y,u,_,l){if(process.env.NODE_ENV!=="production"){for(var v in c)if(o(c,v)){var d;try{if(typeof c[v]!="function"){var w=Error((_||"React class")+": "+u+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}d=c[v](y,v,_,u,null,i)}catch(I){d=I}if(d&&!(d instanceof Error)&&e((_||"React class")+": type specification of "+u+" `"+v+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in s)){s[d.message]=!0;var C=l?l():"";e("Failed "+u+" type: "+d.message+(C??""))}}}}return g.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(s={})},se=g,se}var ce,Pe;function Ke(){if(Pe)return ce;Pe=1;var e=Re(),i=ze(),s=pe(),o=Ce(),g=Fe(),c=function(){};process.env.NODE_ENV!=="production"&&(c=function(u){var _="Warning: "+u;typeof console<"u"&&console.error(_);try{throw new Error(_)}catch{}});function y(){return null}return ce=function(u,_){var l=typeof Symbol=="function"&&Symbol.iterator,v="@@iterator";function d(r){var a=r&&(l&&r[l]||r[v]);if(typeof a=="function")return a}var w="<<anonymous>>",C={array:D("array"),bigint:D("bigint"),bool:D("boolean"),func:D("function"),number:D("number"),object:D("object"),string:D("string"),symbol:D("symbol"),any:$(),arrayOf:A,element:j(),elementType:t(),instanceOf:Y,node:W(),objectOf:K,oneOf:J,oneOfType:q,shape:G,exact:X};function I(r,a){return r===a?r!==0||1/r===1/a:r!==r&&a!==a}function S(r,a){this.message=r,this.data=a&&typeof a=="object"?a:{},this.stack=""}S.prototype=Error.prototype;function M(r){if(process.env.NODE_ENV!=="production")var a={},m=0;function b(E,p,h,T,R,x,L){if(T=T||w,x=x||h,L!==s){if(_){var n=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw n.name="Invariant Violation",n}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var z=T+":"+h;!a[z]&&m<3&&(c("You are manually calling a React.PropTypes validation function for the `"+x+"` prop on `"+T+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),a[z]=!0,m++)}}return p[h]==null?E?p[h]===null?new S("The "+R+" `"+x+"` is marked as required "+("in `"+T+"`, but its value is `null`.")):new S("The "+R+" `"+x+"` is marked as required in "+("`"+T+"`, but its value is `undefined`.")):null:r(p,h,T,R,x)}var f=b.bind(null,!1);return f.isRequired=b.bind(null,!0),f}function D(r){function a(m,b,f,E,p,h){var T=m[b],R=U(T);if(R!==r){var x=V(T);return new S("Invalid "+E+" `"+p+"` of type "+("`"+x+"` supplied to `"+f+"`, expected ")+("`"+r+"`."),{expectedType:r})}return null}return M(a)}function $(){return M(y)}function A(r){function a(m,b,f,E,p){if(typeof r!="function")return new S("Property `"+p+"` of component `"+f+"` has invalid PropType notation inside arrayOf.");var h=m[b];if(!Array.isArray(h)){var T=U(h);return new S("Invalid "+E+" `"+p+"` of type "+("`"+T+"` supplied to `"+f+"`, expected an array."))}for(var R=0;R<h.length;R++){var x=r(h,R,f,E,p+"["+R+"]",s);if(x instanceof Error)return x}return null}return M(a)}function j(){function r(a,m,b,f,E){var p=a[m];if(!u(p)){var h=U(p);return new S("Invalid "+f+" `"+E+"` of type "+("`"+h+"` supplied to `"+b+"`, expected a single ReactElement."))}return null}return M(r)}function t(){function r(a,m,b,f,E){var p=a[m];if(!e.isValidElementType(p)){var h=U(p);return new S("Invalid "+f+" `"+E+"` of type "+("`"+h+"` supplied to `"+b+"`, expected a single ReactElement type."))}return null}return M(r)}function Y(r){function a(m,b,f,E,p){if(!(m[b]instanceof r)){var h=r.name||w,T=ne(m[b]);return new S("Invalid "+E+" `"+p+"` of type "+("`"+T+"` supplied to `"+f+"`, expected ")+("instance of `"+h+"`."))}return null}return M(a)}function J(r){if(!Array.isArray(r))return process.env.NODE_ENV!=="production"&&(arguments.length>1?c("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):c("Invalid argument supplied to oneOf, expected an array.")),y;function a(m,b,f,E,p){for(var h=m[b],T=0;T<r.length;T++)if(I(h,r[T]))return null;var R=JSON.stringify(r,function(L,n){var z=V(n);return z==="symbol"?String(n):n});return new S("Invalid "+E+" `"+p+"` of value `"+String(h)+"` "+("supplied to `"+f+"`, expected one of "+R+"."))}return M(a)}function K(r){function a(m,b,f,E,p){if(typeof r!="function")return new S("Property `"+p+"` of component `"+f+"` has invalid PropType notation inside objectOf.");var h=m[b],T=U(h);if(T!=="object")return new S("Invalid "+E+" `"+p+"` of type "+("`"+T+"` supplied to `"+f+"`, expected an object."));for(var R in h)if(o(h,R)){var x=r(h,R,f,E,p+"."+R,s);if(x instanceof Error)return x}return null}return M(a)}function q(r){if(!Array.isArray(r))return process.env.NODE_ENV!=="production"&&c("Invalid argument supplied to oneOfType, expected an instance of array."),y;for(var a=0;a<r.length;a++){var m=r[a];if(typeof m!="function")return c("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(m)+" at index "+a+"."),y}function b(f,E,p,h,T){for(var R=[],x=0;x<r.length;x++){var L=r[x],n=L(f,E,p,h,T,s);if(n==null)return null;n.data&&o(n.data,"expectedType")&&R.push(n.data.expectedType)}var z=R.length>0?", expected one of type ["+R.join(", ")+"]":"";return new S("Invalid "+h+" `"+T+"` supplied to "+("`"+p+"`"+z+"."))}return M(b)}function W(){function r(a,m,b,f,E){return H(a[m])?null:new S("Invalid "+f+" `"+E+"` supplied to "+("`"+b+"`, expected a ReactNode."))}return M(r)}function B(r,a,m,b,f){return new S((r||"React class")+": "+a+" type `"+m+"."+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+f+"`.")}function G(r){function a(m,b,f,E,p){var h=m[b],T=U(h);if(T!=="object")return new S("Invalid "+E+" `"+p+"` of type `"+T+"` "+("supplied to `"+f+"`, expected `object`."));for(var R in r){var x=r[R];if(typeof x!="function")return B(f,E,p,R,V(x));var L=x(h,R,f,E,p+"."+R,s);if(L)return L}return null}return M(a)}function X(r){function a(m,b,f,E,p){var h=m[b],T=U(h);if(T!=="object")return new S("Invalid "+E+" `"+p+"` of type `"+T+"` "+("supplied to `"+f+"`, expected `object`."));var R=i({},m[b],r);for(var x in R){var L=r[x];if(o(r,x)&&typeof L!="function")return B(f,E,p,x,V(L));if(!L)return new S("Invalid "+E+" `"+p+"` key `"+x+"` supplied to `"+f+"`.\nBad object: "+JSON.stringify(m[b],null," ")+`
|
|
20
|
-
Valid keys: `+JSON.stringify(Object.keys(r),null," "));var n=L(h,x,f,E,p+"."+x,s);if(n)return n}return null}return M(a)}function H(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(H);if(r===null||u(r))return!0;var a=d(r);if(a){var m=a.call(r),b;if(a!==r.entries){for(;!(b=m.next()).done;)if(!H(b.value))return!1}else for(;!(b=m.next()).done;){var f=b.value;if(f&&!H(f[1]))return!1}}else return!1;return!0;default:return!1}}function te(r,a){return r==="symbol"?!0:a?a["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&a instanceof Symbol:!1}function U(r){var a=typeof r;return Array.isArray(r)?"array":r instanceof RegExp?"object":te(a,r)?"symbol":a}function V(r){if(typeof r>"u"||r===null)return""+r;var a=U(r);if(a==="object"){if(r instanceof Date)return"date";if(r instanceof RegExp)return"regexp"}return a}function Z(r){var a=V(r);switch(a){case"array":case"object":return"an "+a;case"boolean":case"date":case"regexp":return"a "+a;default:return a}}function ne(r){return!r.constructor||!r.constructor.name?w:r.constructor.name}return C.checkPropTypes=g,C.resetWarningCache=g.resetWarningCache,C.PropTypes=C,C},ce}var ue,we;function Be(){if(we)return ue;we=1;var e=pe();function i(){}function s(){}return s.resetWarningCache=i,ue=function(){function o(y,u,_,l,v,d){if(d!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}o.isRequired=o;function g(){return o}var c={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:g,element:o,elementType:o,instanceOf:g,node:o,objectOf:g,oneOf:g,oneOfType:g,shape:g,exact:g,checkPropTypes:s,resetWarningCache:i};return c.PropTypes=c,c},ue}if(process.env.NODE_ENV!=="production"){var Ve=Re(),Ge=!0;de.exports=Ke()(Ve.isElement,Ge)}else de.exports=Be()();var He=de.exports;const Je=Me.getDefaultExportFromCjs(He);const Xe="_sidenav_12xoe_4",Ze="_root_12xoe_5",Qe="_group_12xoe_9",er="_arrow_12xoe_58",rr="_disabled_12xoe_88",F={sidenav:Xe,root:Ze,"sidenav-group":"_sidenav-group_12xoe_6","sidenav-link":"_sidenav-link_12xoe_7","sidenav-collapsible":"_sidenav-collapsible_12xoe_8",group:Qe,"group-label":"_group-label_12xoe_32",arrow:er,disabled:rr,"not-collapsible":"_not-collapsible_12xoe_110","has-indicator":"_has-indicator_12xoe_118"},Ae=(e,i,s)=>{const o=Array.prototype.indexOf.call(i,s.current);switch(e.key){case"ArrowDown":if(!i)return;if(i[o].setAttribute("tabindex","-1"),o===i.length-1){i[0].setAttribute("tabindex","0"),i[0].focus();break}i[o+1].setAttribute("tabindex","0"),i[o+1].focus();break;case"ArrowUp":if(
|
|
21
|
-
//# sourceMappingURL=SideNav-
|
|
20
|
+
Valid keys: `+JSON.stringify(Object.keys(r),null," "));var n=L(h,x,f,E,p+"."+x,s);if(n)return n}return null}return M(a)}function H(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(H);if(r===null||u(r))return!0;var a=d(r);if(a){var m=a.call(r),b;if(a!==r.entries){for(;!(b=m.next()).done;)if(!H(b.value))return!1}else for(;!(b=m.next()).done;){var f=b.value;if(f&&!H(f[1]))return!1}}else return!1;return!0;default:return!1}}function te(r,a){return r==="symbol"?!0:a?a["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&a instanceof Symbol:!1}function U(r){var a=typeof r;return Array.isArray(r)?"array":r instanceof RegExp?"object":te(a,r)?"symbol":a}function V(r){if(typeof r>"u"||r===null)return""+r;var a=U(r);if(a==="object"){if(r instanceof Date)return"date";if(r instanceof RegExp)return"regexp"}return a}function Z(r){var a=V(r);switch(a){case"array":case"object":return"an "+a;case"boolean":case"date":case"regexp":return"a "+a;default:return a}}function ne(r){return!r.constructor||!r.constructor.name?w:r.constructor.name}return C.checkPropTypes=g,C.resetWarningCache=g.resetWarningCache,C.PropTypes=C,C},ce}var ue,we;function Be(){if(we)return ue;we=1;var e=pe();function i(){}function s(){}return s.resetWarningCache=i,ue=function(){function o(y,u,_,l,v,d){if(d!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}o.isRequired=o;function g(){return o}var c={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:g,element:o,elementType:o,instanceOf:g,node:o,objectOf:g,oneOf:g,oneOfType:g,shape:g,exact:g,checkPropTypes:s,resetWarningCache:i};return c.PropTypes=c,c},ue}if(process.env.NODE_ENV!=="production"){var Ve=Re(),Ge=!0;de.exports=Ke()(Ve.isElement,Ge)}else de.exports=Be()();var He=de.exports;const Je=Me.getDefaultExportFromCjs(He);const Xe="_sidenav_12xoe_4",Ze="_root_12xoe_5",Qe="_group_12xoe_9",er="_arrow_12xoe_58",rr="_disabled_12xoe_88",F={sidenav:Xe,root:Ze,"sidenav-group":"_sidenav-group_12xoe_6","sidenav-link":"_sidenav-link_12xoe_7","sidenav-collapsible":"_sidenav-collapsible_12xoe_8",group:Qe,"group-label":"_group-label_12xoe_32",arrow:er,disabled:rr,"not-collapsible":"_not-collapsible_12xoe_110","has-indicator":"_has-indicator_12xoe_118"},Ae=(e,i,s)=>{const o=Array.prototype.indexOf.call(i,s.current);switch(e.key){case"ArrowDown":if(!i)return;if(e.preventDefault(),i[o].setAttribute("tabindex","-1"),o===i.length-1){i[0].setAttribute("tabindex","0"),i[0].focus();break}i[o+1].setAttribute("tabindex","0"),i[o+1].focus();break;case"ArrowUp":if(e.preventDefault(),!i)return;if(i[o].setAttribute("tabindex","-1"),o===0){i[i.length-1].setAttribute("tabindex","0"),i[i.length-1].focus();break}i[o-1].setAttribute("tabindex","0"),i[o-1].focus();break}},ye=k.forwardRef((e,i)=>{const{className:s,children:o,href:g,id:c,active:y,onClick:u,onKeyDown:_,onKeyUp:l,style:v,disabled:d,...w}=e,{links:C}=ke(),I=k.useRef(null);function S($){Ae($,C,I),_==null||_($,c)}function M($){d||(($.code==="Space"||$.code==="Enter")&&($.preventDefault(),u&&$.currentTarget.click()),l==null||l($,c))}function D($){var A,j;if(d)return;const t=Array.prototype.slice.call(C).filter(Y=>Y.tabIndex===0)[0];t&&t.setAttribute("tabindex","-1"),(A=I.current)==null||A.setAttribute("tabindex","0"),(j=I.current)==null||j.focus(),u==null||u($,c)}return N.fr.jsx("li",{className:s,"data-anv":"sidenav-link",style:v,ref:i,children:N.fr.jsx("a",{className:F["sidenav-link"],"aria-current":y?"page":void 0,href:g,ref:I,onClick:D,onKeyDown:S,onKeyUp:M,id:c,"aria-disabled":d,tabIndex:y?0:-1,...w,children:o})})});ye.displayName="SideNavLink";const tr=e=>me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e},me.createElement("path",{d:"M8.12 9.29 12 13.17l3.88-3.88a.996.996 0 1 1 1.41 1.41l-4.59 4.59a.996.996 0 0 1-1.41 0L6.7 10.7a.996.996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0z"})),ve=k.forwardRef((e,i)=>{var s;const{className:o,children:g,label:c,onClick:y,onKeyDown:u,defaultExpanded:_=!1,expanded:l,...v}=e,[d,w]=k.useState(_),[C,I]=k.useState(!1),S=k.useRef(null),M=k.useRef(null),D=re.cx(F["sidenav-collapsible"],o),{links:$,reCalculateLinks:A}=ke(),j=k.useId(),t=q=>{l===void 0&&w(W=>q!==void 0?q:!W)};k.useEffect(()=>{l!==void 0&&w(l)},[l]);function Y(q){var W,B;t(),setTimeout(()=>A(),0);const G=Array.prototype.slice.call($).filter(X=>X.tabIndex===0)[0];G&&G.setAttribute("tabindex","-1"),(W=S.current)==null||W.setAttribute("tabindex","0"),(B=S.current)==null||B.focus(),y==null||y(q)}function J(q){switch(Ae(q,$,S),q.key){case"ArrowRight":w(!0),setTimeout(()=>A(),0);break;case"ArrowLeft":w(!1),setTimeout(()=>A(),0);break}u==null||u(q)}const K=(s=k.Children.map(g,q=>q.props))==null?void 0:s.some(q=>q.active===!0);return k.useLayoutEffect(()=>{K&&(t(!0),setTimeout(()=>{var q;const W=(q=M.current)==null?void 0:q.querySelector("[active='true']");W==null||W.setAttribute("tabindex","0"),A()},0))},[]),k.useEffect(()=>{if(!K){I(!1);return}I(!0)},[K]),N.fr.jsxs("li",{ref:i,"data-anv":"sidenav-collapsible",...v,className:D,children:[N.fr.jsxs("button",{"aria-expanded":d,"aria-controls":j,type:"button",tabIndex:-1,onClick:Y,ref:S,className:re.cx(F["sidenav-link"],{[F["has-indicator"]]:C&&!d}),onKeyDown:J,children:[c,N.fr.jsx(De.C,{className:F.arrow,inherit:!0,svg:tr,"aria-hidden":!0})]}),d?N.fr.jsx("ul",{id:j,ref:M,className:F.group,children:g}):null]})});ve.displayName="SideNavCollapsible";const be=k.forwardRef((e,i)=>{const{children:s,label:o,...g}=e,c=re.cx(F["sidenav-group"]),y=k.useId();return N.fr.jsxs("li",{ref:i,"data-anv":"sidenav-group",...g,children:[N.fr.jsx("label",{id:y,className:F["group-label"],children:o}),N.fr.jsx("ul",{"aria-labelledby":y,className:c,children:s})]})});be.displayName="SideNavGroup";const je=k.createContext(null),Ie=k.forwardRef((e,i)=>{const{layoutStyles:s,componentProps:o}=$e.J(e),{className:g,children:c,style:y,...u}=o,_=k.useRef(null),[l,v]=k.useState(),d={...y,...s};function w(){if(_.current){const S=_.current.querySelectorAll("li[data-anv='sidenav-link'] a:not([aria-disabled='true']), li[data-anv='sidenav-collapsible'] button[aria-expanded]:not([aria-disabled='true'])");v(S)}}k.useEffect(()=>{w()},[]);const C=re.cx([F.sidenav],g),I=k.useMemo(()=>({links:l,reCalculateLinks:w}),[l]);return N.fr.jsx(je.Provider,{value:I,children:N.fr.jsx("nav",{ref:qe.useMergeRefs([_,i]),className:C,style:d,"data-anv":"sidenav",...u,children:N.fr.jsx("ul",{className:F.root,children:c})})})}),ke=()=>{const e=k.useContext(je);if(e==null)throw new Error("useSideNav must be wrapped in <SideNav />");return e};Ie.displayName="SideNav";const nr=Object.assign(Ie,{Link:ye,Collapsible:ve,Group:be});exports.M=ye;exports.O=ve;exports.P=be;exports.PropTypes=Je;exports._extends=fe;exports._inheritsLoose=Ye;exports._objectWithoutPropertiesLoose=Ne;exports.fe=nr;
|
|
21
|
+
//# sourceMappingURL=SideNav-2a75e772.cjs.map
|