@ensi-platform/admin-ui 0.11.0 → 0.12.0
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/ai/skills/admin-ui/SKILL.md +1 -0
- package/dist/{Component-MSGhHMYk.js → Component-B1piMJHv.js} +2 -2
- package/dist/{Component-MSGhHMYk.js.map → Component-B1piMJHv.js.map} +1 -1
- package/dist/{Component-DpACJ8IJ.js → Component-BPAXqDXt.js} +2 -2
- package/dist/{Component-DpACJ8IJ.js.map → Component-BPAXqDXt.js.map} +1 -1
- package/dist/{Component-DSAL6avh.js → Component-BPN5FgKq.js} +2 -2
- package/dist/{Component-DSAL6avh.js.map → Component-BPN5FgKq.js.map} +1 -1
- package/dist/{Component-BZqLGwzc.js → Component-BuFsNZAH.js} +2 -2
- package/dist/{Component-BZqLGwzc.js.map → Component-BuFsNZAH.js.map} +1 -1
- package/dist/{Component-IFlvrceZ.js → Component-CBnhxD86.js} +5 -5
- package/dist/{Component-IFlvrceZ.js.map → Component-CBnhxD86.js.map} +1 -1
- package/dist/{Component-BH5skHn_.js → Component-CDURmZCP.js} +2 -2
- package/dist/{Component-BH5skHn_.js.map → Component-CDURmZCP.js.map} +1 -1
- package/dist/{Component-Dq7pvkWP.js → Component-CQyBQxAb.js} +2 -2
- package/dist/{Component-Dq7pvkWP.js.map → Component-CQyBQxAb.js.map} +1 -1
- package/dist/{Component-DGze6SVb.js → Component-D92F9hx-.js} +2 -2
- package/dist/{Component-DGze6SVb.js.map → Component-D92F9hx-.js.map} +1 -1
- package/dist/{Component-DH7wdC3G.js → Component-DWp04UBh.js} +2 -2
- package/dist/{Component-DH7wdC3G.js.map → Component-DWp04UBh.js.map} +1 -1
- package/dist/{Component-CkazNd13.js → Component-D_c3xBcb.js} +2 -2
- package/dist/{Component-CkazNd13.js.map → Component-D_c3xBcb.js.map} +1 -1
- package/dist/Component-DhE4a93B.js +138 -0
- package/dist/Component-DhE4a93B.js.map +1 -0
- package/dist/Component-DlBYWjUa.js +107 -0
- package/dist/Component-DlBYWjUa.js.map +1 -0
- package/dist/{Component-C4vHIDMZ.js → Component-dmSX0Khf.js} +2 -2
- package/dist/{Component-C4vHIDMZ.js.map → Component-dmSX0Khf.js.map} +1 -1
- package/dist/{Component-DOlDNQnu.js → Component-eoUrqznD.js} +2 -2
- package/dist/{Component-DOlDNQnu.js.map → Component-eoUrqznD.js.map} +1 -1
- package/dist/{Component-6rieHJdg.js → Component-jzDbWkuj.js} +3 -3
- package/dist/{Component-6rieHJdg.js.map → Component-jzDbWkuj.js.map} +1 -1
- package/dist/{Component-CzwTENBM.js → Component-uHkw3SDR.js} +2 -2
- package/dist/{Component-CzwTENBM.js.map → Component-uHkw3SDR.js.map} +1 -1
- package/dist/action-popup/index.js +2 -2
- package/dist/active-filters/index.js +2 -2
- package/dist/arrangement-settings/index.js +2 -2
- package/dist/assets/Component.css +1 -1
- package/dist/assets/Component10.css +1 -1
- package/dist/assets/Component11.css +1 -1
- package/dist/assets/Component12.css +1 -1
- package/dist/assets/Component13.css +1 -1
- package/dist/assets/Component14.css +1 -1
- package/dist/assets/Component15.css +1 -1
- package/dist/assets/Component16.css +1 -0
- package/dist/assets/Component2.css +1 -1
- package/dist/assets/Component3.css +1 -1
- package/dist/assets/Component4.css +1 -1
- package/dist/assets/Component5.css +1 -1
- package/dist/assets/Component6.css +1 -1
- package/dist/assets/Component7.css +1 -1
- package/dist/assets/Component8.css +1 -1
- package/dist/assets/Component9.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/autocomplete/index.js +2 -2
- package/dist/autocomplete-async/index.js +2 -2
- package/dist/button/Component.d.ts +1 -1
- package/dist/button/Component.d.ts.map +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/types.d.ts +2 -0
- package/dist/button/types.d.ts.map +1 -1
- package/dist/cascade-menu/index.js +2 -2
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox-group/index.js +1 -1
- package/dist/color-field/Component.d.ts +5 -0
- package/dist/color-field/Component.d.ts.map +1 -0
- package/dist/color-field/FormColorField.d.ts +6 -0
- package/dist/color-field/FormColorField.d.ts.map +1 -0
- package/dist/color-field/index.d.ts +4 -0
- package/dist/color-field/index.d.ts.map +1 -0
- package/dist/color-field/index.js +284 -0
- package/dist/color-field/index.js.map +1 -0
- package/dist/{color-picker → color-field}/theme.d.ts +1 -1
- package/dist/color-field/theme.d.ts.map +1 -0
- package/dist/color-field/types.d.ts +58 -0
- package/dist/color-field/types.d.ts.map +1 -0
- package/dist/color-field/utils.d.ts +14 -0
- package/dist/color-field/utils.d.ts.map +1 -0
- package/dist/color-picker/Component.d.ts +1 -1
- package/dist/color-picker/Component.d.ts.map +1 -1
- package/dist/color-picker/index.d.ts +2 -2
- package/dist/color-picker/index.d.ts.map +1 -1
- package/dist/color-picker/index.js +3 -344
- package/dist/color-picker/index.js.map +1 -1
- package/dist/color-picker/types.d.ts +16 -37
- package/dist/color-picker/types.d.ts.map +1 -1
- package/dist/color-picker/utils.d.ts +7 -14
- package/dist/color-picker/utils.d.ts.map +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/copy-button/index.js +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/date-picker/index.js +1 -1
- package/dist/date-range-picker/index.js +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/dropzone/index.js +2 -2
- package/dist/field/index.js +1 -1
- package/dist/input/index.js +2 -2
- package/dist/link/index.js +1 -1
- package/dist/mask/Component.d.ts +5 -0
- package/dist/mask/Component.d.ts.map +1 -0
- package/dist/mask/FormMask.d.ts +6 -0
- package/dist/mask/FormMask.d.ts.map +1 -0
- package/dist/mask/index.d.ts +4 -0
- package/dist/mask/index.d.ts.map +1 -0
- package/dist/mask/index.js +104 -0
- package/dist/mask/index.js.map +1 -0
- package/dist/mask/types.d.ts +20 -0
- package/dist/mask/types.d.ts.map +1 -0
- package/dist/menu-list/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-autocomplete/index.js +2 -2
- package/dist/multi-autocomplete-async/index.js +2 -2
- package/dist/multi-select/index.js +1 -1
- package/dist/number-input/index.js +2 -2
- package/dist/number-range/index.js +2 -2
- package/dist/popover/index.js +1 -1
- package/dist/select/index.js +2 -2
- package/dist/slider/index.js +1 -1
- package/dist/suggest-checklist/index.js +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/time-field/index.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/package.json +11 -1
- package/src/button/docs/Description.md +9 -8
- package/src/button/docs/cssVariables.ts +1 -0
- package/src/button/types.ts +2 -0
- package/src/color-field/docs/Description.md +46 -0
- package/src/color-field/docs/Example.md +5 -0
- package/src/color-field/docs/cssVariables.ts +34 -0
- package/src/color-field/types.ts +67 -0
- package/src/color-picker/docs/Description.md +17 -36
- package/src/color-picker/docs/Example.md +1 -1
- package/src/color-picker/docs/cssVariables.ts +4 -32
- package/src/color-picker/types.ts +16 -44
- package/src/mask/docs/Description.md +48 -0
- package/src/mask/docs/Example.md +12 -0
- package/src/mask/types.ts +21 -0
- package/dist/Component-C24OpTxW.js +0 -92
- package/dist/Component-C24OpTxW.js.map +0 -1
- package/dist/color-picker/FormColorPicker.d.ts +0 -6
- package/dist/color-picker/FormColorPicker.d.ts.map +0 -1
- package/dist/color-picker/theme.d.ts.map +0 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as s, jsxs as U } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as D, useEffect as x } from "react";
|
|
3
|
+
import X from "classnames";
|
|
4
|
+
import { parseColor as V, ColorPicker as Y, ColorArea as q, ColorThumb as N, ColorSlider as z, SliderTrack as J, ColorSwatchPicker as Q, ColorSwatchPickerItem as W, ColorSwatch as Z } from "react-aria-components";
|
|
5
|
+
import { s as ee } from "./index-h8z54aFR.js";
|
|
6
|
+
import { u as te } from "./hooks-CekMiYbX.js";
|
|
7
|
+
import './assets/Component.css';const E = "#808080", F = (e) => V(e).toFormat("hsb"), d = (e) => e.toString("hex").toLowerCase(), R = (e, t) => t == null || e.getChannelValue("saturation") !== 0 || e.getChannelValue("hue") === t ? e : e.withChannelValue("hue", t), re = /^[0-9a-fA-F]+$/, H = (e) => {
|
|
8
|
+
try {
|
|
9
|
+
return V(e).toString("hex").toLowerCase();
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}, p = (e) => {
|
|
14
|
+
const t = e.trim();
|
|
15
|
+
return t ? re.test(t) ? H(`#${t}`) : H(t) : null;
|
|
16
|
+
}, oe = (e) => {
|
|
17
|
+
if (!e?.length) return [];
|
|
18
|
+
const t = /* @__PURE__ */ new Set();
|
|
19
|
+
return e.flatMap((i) => {
|
|
20
|
+
const c = p(i);
|
|
21
|
+
return !c || t.has(c) ? [] : (t.add(c), [c]);
|
|
22
|
+
});
|
|
23
|
+
}, se = "aub_styles-module_root_1a08f", ne = "aub_styles-module_area_bc0ba", ae = "aub_styles-module_hue_431a1", ce = "aub_styles-module_hueTrack_aed1b", le = "aub_styles-module_thumb_3861b", ue = "aub_styles-module_presets_b941b", ie = "aub_styles-module_preset_94276", n = {
|
|
24
|
+
root: se,
|
|
25
|
+
area: ne,
|
|
26
|
+
hue: ae,
|
|
27
|
+
hueTrack: ce,
|
|
28
|
+
thumb: le,
|
|
29
|
+
presets: ue,
|
|
30
|
+
preset: ie
|
|
31
|
+
}, he = (e, t) => R(F(p(e ?? "") ?? E), t), T = (e) => e.toFormat("hsb"), me = ee(
|
|
32
|
+
({
|
|
33
|
+
ref: e,
|
|
34
|
+
value: t,
|
|
35
|
+
defaultValue: i,
|
|
36
|
+
onChange: c,
|
|
37
|
+
onPreview: A,
|
|
38
|
+
onHueChange: C,
|
|
39
|
+
hue: h,
|
|
40
|
+
presets: $,
|
|
41
|
+
disabled: l = !1,
|
|
42
|
+
className: v,
|
|
43
|
+
dataTestId: G,
|
|
44
|
+
"aria-label": b
|
|
45
|
+
}) => {
|
|
46
|
+
const { colorHue: L, colorPresets: j } = te(), _ = t !== void 0, [I, O] = w(i ?? ""), a = _ ? t : I, [B, m] = w(() => he(a, h)), u = D(!1), f = D(a), g = oe($);
|
|
47
|
+
x(() => {
|
|
48
|
+
f.current = a;
|
|
49
|
+
}, [a]), x(() => {
|
|
50
|
+
if (u.current) return;
|
|
51
|
+
const r = p(a) ?? E;
|
|
52
|
+
m((o) => R(d(o) === r ? o : F(r), h));
|
|
53
|
+
}, [a, h]);
|
|
54
|
+
const k = (r) => {
|
|
55
|
+
l || f.current === r || (f.current = r, _ || O(r), r !== a && c?.(r));
|
|
56
|
+
}, K = (r) => {
|
|
57
|
+
if (l) return;
|
|
58
|
+
const o = T(r), S = d(o);
|
|
59
|
+
if (m(o), C?.(o.getChannelValue("hue")), u.current) {
|
|
60
|
+
A?.(S);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
k(S);
|
|
64
|
+
}, y = (r) => {
|
|
65
|
+
if (l) return;
|
|
66
|
+
const o = T(r);
|
|
67
|
+
u.current = !1, m(o), C?.(o.getChannelValue("hue")), k(d(o));
|
|
68
|
+
}, M = () => {
|
|
69
|
+
u.current = !1;
|
|
70
|
+
}, P = () => {
|
|
71
|
+
u.current = !0;
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ s(Y, { value: B, onChange: K, children: /* @__PURE__ */ U(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
ref: e,
|
|
77
|
+
className: X(n.root, v),
|
|
78
|
+
"data-test-id": G,
|
|
79
|
+
role: b ? "group" : void 0,
|
|
80
|
+
"aria-label": b,
|
|
81
|
+
onKeyDownCapture: M,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ s(
|
|
84
|
+
q,
|
|
85
|
+
{
|
|
86
|
+
className: n.area,
|
|
87
|
+
colorSpace: "hsb",
|
|
88
|
+
xChannel: "saturation",
|
|
89
|
+
yChannel: "brightness",
|
|
90
|
+
isDisabled: l,
|
|
91
|
+
"data-test-id": "color-picker-area",
|
|
92
|
+
onChangeEnd: y,
|
|
93
|
+
onPointerDown: P,
|
|
94
|
+
children: /* @__PURE__ */ s(N, { className: n.thumb })
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ s(
|
|
98
|
+
z,
|
|
99
|
+
{
|
|
100
|
+
className: n.hue,
|
|
101
|
+
"aria-label": L,
|
|
102
|
+
channel: "hue",
|
|
103
|
+
colorSpace: "hsb",
|
|
104
|
+
isDisabled: l,
|
|
105
|
+
onChangeEnd: y,
|
|
106
|
+
children: /* @__PURE__ */ s(
|
|
107
|
+
J,
|
|
108
|
+
{
|
|
109
|
+
className: n.hueTrack,
|
|
110
|
+
onPointerDown: P,
|
|
111
|
+
"data-test-id": "color-picker-hue",
|
|
112
|
+
children: /* @__PURE__ */ s(N, { className: n.thumb })
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
g.length > 0 ? /* @__PURE__ */ s(Q, { "aria-label": j, className: n.presets, children: g.map((r) => /* @__PURE__ */ s(
|
|
118
|
+
W,
|
|
119
|
+
{
|
|
120
|
+
className: n.preset,
|
|
121
|
+
color: r,
|
|
122
|
+
isDisabled: l,
|
|
123
|
+
"data-test-id": `color-picker-preset-${r}`,
|
|
124
|
+
children: /* @__PURE__ */ s(Z, {})
|
|
125
|
+
},
|
|
126
|
+
r
|
|
127
|
+
)) }) : null
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
) });
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
me.displayName = "ColorPicker";
|
|
134
|
+
export {
|
|
135
|
+
me as C,
|
|
136
|
+
p as t
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=Component-DhE4a93B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component-DhE4a93B.js","sources":["../src/color-picker/utils.ts","../src/color-picker/Component.tsx"],"sourcesContent":["import { type Color, parseColor } from 'react-aria-components';\n\n/** Draft shown in the panel when the value is empty. Never emitted. */\nexport const IDLE_DRAFT = '#808080';\n\n/** HSB color for the RAC picker, so hue survives gray values. */\nexport const toDraftColor = (hex: string): Color => parseColor(hex).toFormat('hsb');\n\nexport const hexOf = (color: Color) => color.toString('hex').toLowerCase();\n\n/**\n * Gray hex has no hue. Keep a hue the field stored across a remount.\n * Chromatic colors already encode hue, so the stored value is ignored.\n */\nexport const withStoredHue = (color: Color, hue: number | undefined): Color => {\n if (hue == null || color.getChannelValue('saturation') !== 0) return color;\n\n if (color.getChannelValue('hue') === hue) return color;\n\n return color.withChannelValue('hue', hue);\n};\n\nconst HEX_BODY = /^[0-9a-fA-F]+$/;\n\nconst readHex = (candidate: string): string | null => {\n try {\n return parseColor(candidate).toString('hex').toLowerCase();\n } catch {\n return null;\n }\n};\n\n/** Canonical `#rrggbb`, or `null` when the string is not a color. */\nexport const toHexColor = (value: string): string | null => {\n const trimmed = value.trim();\n\n if (!trimmed) return null;\n\n if (HEX_BODY.test(trimmed)) return readHex(`#${trimmed}`);\n\n return readHex(trimmed);\n};\n\n/** Preset list as unique `#rrggbb`. Drops values that are not colors. */\nexport const validPresetHexes = (presets: readonly string[] | undefined): string[] => {\n if (!presets?.length) return [];\n\n const seen = new Set<string>();\n\n return presets.flatMap(preset => {\n const hex = toHexColor(preset);\n\n if (!hex || seen.has(hex)) return [];\n\n seen.add(hex);\n\n return [hex];\n });\n};\n","import { useEffect, useRef, useState } from 'react';\n\nimport cn from 'classnames';\nimport {\n ColorArea,\n ColorPicker as RacColorPicker,\n ColorSlider,\n ColorSwatch,\n ColorSwatchPicker,\n ColorSwatchPickerItem,\n ColorThumb,\n SliderTrack,\n type Color,\n} from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { useAuiLabels } from '@/provider';\n\nimport { type IColorPickerProps } from './types';\nimport { hexOf, IDLE_DRAFT, toDraftColor, toHexColor, validPresetHexes, withStoredHue } from './utils';\n\nimport styles from './styles.module.css';\n\nconst draftFrom = (value: string | undefined, hue: number | undefined) =>\n withStoredHue(toDraftColor(toHexColor(value ?? '') ?? IDLE_DRAFT), hue);\n\nconst toHsb = (color: Color) => color.toFormat('hsb');\n\nexport const ColorPicker = supportRef(\n ({\n ref,\n value,\n defaultValue,\n onChange,\n onPreview,\n onHueChange,\n hue,\n presets,\n disabled = false,\n className,\n dataTestId,\n 'aria-label': ariaLabel,\n }: IColorPickerProps) => {\n const { colorHue, colorPresets } = useAuiLabels();\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? '');\n const current = isControlled ? value : uncontrolledValue;\n const [draft, setDraft] = useState<Color>(() => draftFrom(current, hue));\n const draggingRef = useRef(false);\n const lastEmittedRef = useRef(current);\n const presetHexes = validPresetHexes(presets);\n\n useEffect(() => {\n lastEmittedRef.current = current;\n }, [current]);\n\n useEffect(() => {\n if (draggingRef.current) return;\n\n const hex = toHexColor(current) ?? IDLE_DRAFT;\n\n setDraft(prev => withStoredHue(hexOf(prev) === hex ? prev : toDraftColor(hex), hue));\n }, [current, hue]);\n\n const commit = (hex: string) => {\n if (disabled || lastEmittedRef.current === hex) return;\n\n lastEmittedRef.current = hex;\n\n if (!isControlled) setUncontrolledValue(hex);\n\n if (hex === current) return;\n\n onChange?.(hex);\n };\n\n const onPickerChange = (color: Color) => {\n if (disabled) return;\n\n const next = toHsb(color);\n const hex = hexOf(next);\n\n setDraft(next);\n onHueChange?.(next.getChannelValue('hue'));\n\n if (draggingRef.current) {\n onPreview?.(hex);\n\n return;\n }\n\n commit(hex);\n };\n\n const finishGesture = (color: Color) => {\n if (disabled) return;\n\n const next = toHsb(color);\n\n draggingRef.current = false;\n setDraft(next);\n onHueChange?.(next.getChannelValue('hue'));\n commit(hexOf(next));\n };\n\n const releasePointerGesture = () => {\n draggingRef.current = false;\n };\n\n const startGesture = () => {\n draggingRef.current = true;\n };\n\n return (\n <RacColorPicker value={draft} onChange={onPickerChange}>\n <div\n ref={ref}\n className={cn(styles.root, className)}\n data-test-id={dataTestId}\n role={ariaLabel ? 'group' : undefined}\n aria-label={ariaLabel}\n onKeyDownCapture={releasePointerGesture}\n >\n <ColorArea\n className={styles.area}\n colorSpace=\"hsb\"\n xChannel=\"saturation\"\n yChannel=\"brightness\"\n isDisabled={disabled}\n data-test-id=\"color-picker-area\"\n onChangeEnd={finishGesture}\n onPointerDown={startGesture}\n >\n <ColorThumb className={styles.thumb} />\n </ColorArea>\n <ColorSlider\n className={styles.hue}\n aria-label={colorHue}\n channel=\"hue\"\n colorSpace=\"hsb\"\n isDisabled={disabled}\n onChangeEnd={finishGesture}\n >\n <SliderTrack\n className={styles.hueTrack}\n onPointerDown={startGesture}\n data-test-id=\"color-picker-hue\"\n >\n <ColorThumb className={styles.thumb} />\n </SliderTrack>\n </ColorSlider>\n {presetHexes.length > 0 ? (\n <ColorSwatchPicker aria-label={colorPresets} className={styles.presets}>\n {presetHexes.map(hex => (\n <ColorSwatchPickerItem\n key={hex}\n className={styles.preset}\n color={hex}\n isDisabled={disabled}\n data-test-id={`color-picker-preset-${hex}`}\n >\n <ColorSwatch />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n ) : null}\n </div>\n </RacColorPicker>\n );\n }\n);\n\nColorPicker.displayName = 'ColorPicker';\n"],"names":["IDLE_DRAFT","toDraftColor","hex","parseColor","hexOf","color","withStoredHue","hue","HEX_BODY","readHex","candidate","toHexColor","value","trimmed","validPresetHexes","presets","seen","preset","draftFrom","toHsb","ColorPicker","supportRef","ref","defaultValue","onChange","onPreview","onHueChange","disabled","className","dataTestId","ariaLabel","colorHue","colorPresets","useAuiLabels","isControlled","uncontrolledValue","setUncontrolledValue","useState","current","draft","setDraft","draggingRef","useRef","lastEmittedRef","presetHexes","useEffect","prev","commit","onPickerChange","next","finishGesture","releasePointerGesture","startGesture","jsx","RacColorPicker","jsxs","cn","styles","ColorArea","ColorThumb","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AA;AAAA,kBACG,WAAWJ,EAAO;AAAA,kBAClB,eAAeL;AAAA,kBACf,gBAAa;AAAA,kBAEb,UAAA,gBAAAC,EAACM,GAAA,EAAW,WAAWF,EAAO,MAAA,CAAO;AAAA,gBAAA;AAAA,cAAA;AAAA,YACzC;AAAA,UAAA;AAAA,UAEHb,EAAY,SAAS,IAClB,gBAAAS,EAACS,GAAA,EAAkB,cAAY9B,GAAc,WAAWyB,EAAO,SAC1D,UAAAb,EAAY,IAAI,CAAA1C,MACb,gBAAAmD;AAAA,YAACU;AAAA,YAAA;AAAA,cAEG,WAAWN,EAAO;AAAA,cAClB,OAAOvD;AAAA,cACP,YAAYyB;AAAA,cACZ,gBAAc,uBAAuBzB,CAAG;AAAA,cAExC,4BAAC8D,GAAA,CAAA,CAAY;AAAA,YAAA;AAAA,YANR9D;AAAA,UAAA,CAQZ,GACL,IACA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEZ;AAAA,EAER;AACJ;AAEAkB,GAAY,cAAc;"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jsxs as _, Fragment as j, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import p from "classnames";
|
|
4
|
+
import { s as I } from "./index-h8z54aFR.js";
|
|
5
|
+
import { cva as P } from "class-variance-authority";
|
|
6
|
+
import './assets/Component7.css';const R = 16, g = (n) => {
|
|
7
|
+
if (n !== void 0)
|
|
8
|
+
return typeof n == "number" ? `${n / R}rem` : n;
|
|
9
|
+
}, S = "aub_styles-module_root_21ec5", V = "aub_styles-module_block_6b432", D = "aub_styles-module_spinner_0291f", E = "aub_styles-module_labelHidden_4ca90", F = "aub_styles-module_sm_1b540", M = "aub_styles-module_md_52f28", X = "aub_styles-module_lg_f20a1", $ = "aub_styles-module_iconOnly_e0c71", q = "aub_styles-module_primary_792f0", w = "aub_styles-module_secondary_b1b78", A = "aub_styles-module_danger_1f22b", G = "aub_styles-module_icon_3df5a", s = {
|
|
10
|
+
root: S,
|
|
11
|
+
block: V,
|
|
12
|
+
spinner: D,
|
|
13
|
+
labelHidden: E,
|
|
14
|
+
sm: F,
|
|
15
|
+
md: M,
|
|
16
|
+
lg: X,
|
|
17
|
+
iconOnly: $,
|
|
18
|
+
primary: q,
|
|
19
|
+
secondary: w,
|
|
20
|
+
danger: A,
|
|
21
|
+
icon: G
|
|
22
|
+
}, J = P(s.root, {
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
sm: s.sm,
|
|
26
|
+
md: s.md,
|
|
27
|
+
lg: s.lg
|
|
28
|
+
},
|
|
29
|
+
variant: {
|
|
30
|
+
primary: s.primary,
|
|
31
|
+
secondary: s.secondary,
|
|
32
|
+
danger: s.danger
|
|
33
|
+
},
|
|
34
|
+
block: {
|
|
35
|
+
true: s.block,
|
|
36
|
+
false: null
|
|
37
|
+
},
|
|
38
|
+
iconOnly: {
|
|
39
|
+
true: s.iconOnly,
|
|
40
|
+
false: null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: "md",
|
|
45
|
+
variant: "primary",
|
|
46
|
+
block: !1,
|
|
47
|
+
iconOnly: !1
|
|
48
|
+
}
|
|
49
|
+
}), f = ({ Component: n, size: a, fill: l, className: r }) => {
|
|
50
|
+
const d = {
|
|
51
|
+
...a !== void 0 && { "--icon-size": g(a) },
|
|
52
|
+
...l !== void 0 && { "--icon-fill": l }
|
|
53
|
+
};
|
|
54
|
+
return /* @__PURE__ */ t(n, { className: p(s.icon, r), style: d, "aria-hidden": !0, focusable: !1 });
|
|
55
|
+
}, W = I(
|
|
56
|
+
({
|
|
57
|
+
as: n,
|
|
58
|
+
type: a = "button",
|
|
59
|
+
size: l = "md",
|
|
60
|
+
variant: r = "primary",
|
|
61
|
+
block: d = !1,
|
|
62
|
+
hidden: c = !1,
|
|
63
|
+
loading: v = !1,
|
|
64
|
+
children: u,
|
|
65
|
+
icon: o,
|
|
66
|
+
className: k,
|
|
67
|
+
dataTestId: O,
|
|
68
|
+
style: B,
|
|
69
|
+
...h
|
|
70
|
+
}) => {
|
|
71
|
+
const m = n ?? "button", b = m === "button", e = !!v, { disabled: i, onClick: x, ...C } = h, H = b ? { ...i || e ? { disabled: !0 } : {} } : {
|
|
72
|
+
...i !== void 0 ? { disabled: i } : {},
|
|
73
|
+
...e ? { "aria-disabled": !0, tabIndex: -1, href: void 0 } : {}
|
|
74
|
+
}, N = {
|
|
75
|
+
...B,
|
|
76
|
+
...o?.indent !== void 0 && { "--button-icon-indent": g(o.indent) }
|
|
77
|
+
}, y = /* @__PURE__ */ _(j, { children: [
|
|
78
|
+
o && !o.after ? /* @__PURE__ */ t(f, { ...o }) : null,
|
|
79
|
+
c ? /* @__PURE__ */ t("span", { hidden: !0, children: u }) : u,
|
|
80
|
+
o && o.after ? /* @__PURE__ */ t(f, { ...o }) : null
|
|
81
|
+
] });
|
|
82
|
+
return /* @__PURE__ */ _(
|
|
83
|
+
m,
|
|
84
|
+
{
|
|
85
|
+
...b ? { type: a } : {},
|
|
86
|
+
className: p(J({ size: l, variant: r, block: d, iconOnly: c }), k),
|
|
87
|
+
"data-test-id": O,
|
|
88
|
+
style: N,
|
|
89
|
+
...C,
|
|
90
|
+
...H,
|
|
91
|
+
"data-loading": e || void 0,
|
|
92
|
+
"aria-busy": e || void 0,
|
|
93
|
+
onClick: e ? (z) => {
|
|
94
|
+
z.preventDefault();
|
|
95
|
+
} : x,
|
|
96
|
+
children: [
|
|
97
|
+
e ? /* @__PURE__ */ t("span", { className: s.labelHidden, children: y }) : y,
|
|
98
|
+
e ? /* @__PURE__ */ t("span", { className: s.spinner, "aria-hidden": !0 }) : null
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
export {
|
|
105
|
+
W as B
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=Component-DlBYWjUa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component-DlBYWjUa.js","sources":["../src/ds/common/utils.ts","../src/button/theme.ts","../src/button/Component.tsx"],"sourcesContent":["/** Pixels in 1rem at the html root. */\nconst REM_PX = 16;\n\nexport const toCssSize = (value: number | string | undefined): string | undefined => {\n if (value === undefined) {\n return undefined;\n }\n\n return typeof value === 'number' ? `${value / REM_PX}rem` : value;\n};\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const buttonVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n secondary: styles.secondary,\n danger: styles.danger,\n },\n block: {\n true: styles.block,\n false: null,\n },\n iconOnly: {\n true: styles.iconOnly,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n block: false,\n iconOnly: false,\n },\n});\n","import { type CSSProperties, type ElementType, type MouseEvent, type ReactNode } from 'react';\n\nimport cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { toCssSize } from '@ds/common/utils';\n\nimport { buttonVariants } from './theme';\nimport { type IButtonIconProps, type TButtonProps } from './types';\n\nimport styles from './styles.module.css';\n\nconst ButtonIcon = ({ Component, size, fill, className }: IButtonIconProps) => {\n const style = {\n ...(size !== undefined && { '--icon-size': toCssSize(size) }),\n ...(fill !== undefined && { '--icon-fill': fill }),\n } as CSSProperties;\n\n return <Component className={cn(styles.icon, className)} style={style} aria-hidden focusable={false} />;\n};\n\nexport const Button = supportRef(\n <P extends ElementType = 'button'>({\n as,\n type = 'button',\n size = 'md',\n variant = 'primary',\n block = false,\n hidden = false,\n loading = false,\n children,\n icon,\n className,\n dataTestId,\n style,\n ...props\n }: TButtonProps<P>) => {\n const Component = as ?? 'button';\n const isButton = Component === 'button';\n const busy = Boolean(loading);\n const { disabled, onClick, ...rest } = props as typeof props & {\n disabled?: boolean;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n };\n const stateProps = isButton\n ? { ...(Boolean(disabled) || busy ? { disabled: true } : {}) }\n : {\n ...(disabled !== undefined ? { disabled } : {}),\n ...(busy ? { 'aria-disabled': true, tabIndex: -1, href: undefined } : {}),\n };\n\n const rootStyle = {\n ...style,\n ...(icon?.indent !== undefined && { '--button-icon-indent': toCssSize(icon.indent) }),\n } as CSSProperties;\n\n const label: ReactNode = (\n <>\n {icon && !icon.after ? <ButtonIcon {...icon} /> : null}\n {hidden ? <span hidden>{children}</span> : children}\n {icon && icon.after ? <ButtonIcon {...icon} /> : null}\n </>\n );\n\n return (\n <Component\n {...(isButton ? { type } : {})}\n className={cn(buttonVariants({ size, variant, block, iconOnly: hidden }), className)}\n data-test-id={dataTestId}\n style={rootStyle}\n {...rest}\n {...stateProps}\n data-loading={busy || undefined}\n aria-busy={busy || undefined}\n onClick={\n busy\n ? (event: MouseEvent<HTMLElement>) => {\n event.preventDefault();\n }\n : onClick\n }\n >\n {busy ? <span className={styles.labelHidden}>{label}</span> : label}\n {busy ? <span className={styles.spinner} aria-hidden /> : null}\n </Component>\n );\n }\n);\n"],"names":["REM_PX","toCssSize","value","buttonVariants","cva","styles","ButtonIcon","Component","size","fill","className","style","jsx","cn","Button","supportRef","as","type","variant","block","hidden","loading","children","icon","dataTestId","props","isButton","busy","disabled","onClick","rest","stateProps","rootStyle","label","jsxs","Fragment","event"],"mappings":";;;;;AACA,MAAMA,IAAS,IAEFC,IAAY,CAACC,MAA2D;AACjF,MAAIA,MAAU;AAId,WAAO,OAAOA,KAAU,WAAW,GAAGA,IAAQF,CAAM,QAAQE;AAChE;;;;;;;;;;;;;GCLaC,IAAiBC,EAAIC,EAAO,MAAM;AAAA,EAC3C,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACL,SAASA,EAAO;AAAA,MAChB,WAAWA,EAAO;AAAA,MAClB,QAAQA,EAA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7
7
|
import { C as K } from "./index-DxsuVBkE.js";
|
|
8
8
|
import { cva as O } from "class-variance-authority";
|
|
9
|
-
import './assets/
|
|
9
|
+
import './assets/Component10.css';const P = "aub_styles-module_root_50457", Q = "aub_styles-module_block_95024", f = {
|
|
10
10
|
root: P,
|
|
11
11
|
block: Q
|
|
12
12
|
}, U = O(f.root, {
|
|
@@ -120,4 +120,4 @@ X.displayName = "MultiAutocomplete";
|
|
|
120
120
|
export {
|
|
121
121
|
X as M
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=Component-
|
|
123
|
+
//# sourceMappingURL=Component-dmSX0Khf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component-
|
|
1
|
+
{"version":3,"file":"Component-dmSX0Khf.js","sources":["../src/multi-autocomplete/theme.ts","../src/multi-autocomplete/utils.ts","../src/multi-autocomplete/Component.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const multiAutocompleteVariants = cva(styles.root, {\n variants: {\n block: {\n true: styles.block,\n false: null,\n },\n },\n defaultVariants: {\n block: true,\n },\n});\n","import { type Key } from 'react-aria-components';\n\nimport { type TComboboxValue } from '@/select/types';\n\nexport { isInteractiveTarget, resolveSelectedOptions, toKeyList } from '@/combobox';\n\nexport const toMultiValue = (value: TComboboxValue[] | undefined): Key[] | undefined => {\n if (value === undefined) {\n return undefined;\n }\n\n return [...value];\n};\n\nexport const fromMultiValue = (keys: Key[]): TComboboxValue[] => keys as TComboboxValue[];\n","import { useRef } from 'react';\n\nimport cn from 'classnames';\nimport { type Key, ComboBox as RacComboBox } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { ComboboxList, ComboboxMultiTrigger } from '@/combobox';\n\nimport { multiAutocompleteVariants } from './theme';\nimport { type IMultiAutocompleteProps } from './types';\nimport { fromMultiValue, toMultiValue } from './utils';\n\nexport const MultiAutocomplete = supportRef(\n ({\n ref,\n options,\n value,\n defaultValue,\n onChange,\n inputValue,\n defaultInputValue,\n onInputChange,\n placeholder,\n clear = false,\n clientFilter = true,\n isLoading = false,\n isError = false,\n hasMore = false,\n onLoadMore,\n isLoadingMore = false,\n size = 'md',\n variant = 'primary',\n block = true,\n invalid = false,\n disabled = false,\n className,\n dataTestId,\n onBlur,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n }: IMultiAutocompleteProps) => {\n const triggerRef = useRef<HTMLDivElement>(null);\n\n return (\n <RacComboBox\n {...props}\n ref={ref}\n selectionMode=\"multiple\"\n value={toMultiValue(value)}\n defaultValue={toMultiValue(defaultValue)}\n onChange={(keys: Key[]) => {\n onChange?.(fromMultiValue(keys));\n }}\n inputValue={inputValue}\n defaultInputValue={defaultInputValue}\n onInputChange={onInputChange}\n defaultItems={clientFilter ? options : undefined}\n items={clientFilter ? undefined : options}\n allowsEmptyCollection={!clientFilter || isLoading || isError || options.length === 0}\n isDisabled={disabled}\n isInvalid={invalid}\n onBlur={onBlur}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n data-invalid={invalid || undefined}\n data-test-id={dataTestId}\n className={cn(multiAutocompleteVariants({ block }), className)}\n >\n {({ isOpen, isDisabled: isComboDisabled, isInvalid: isComboInvalid }) => (\n <>\n <ComboboxMultiTrigger\n mode=\"combobox\"\n triggerRef={triggerRef}\n options={options}\n size={size}\n variant={variant}\n clear={clear}\n placeholder={placeholder ?? ''}\n isOpen={isOpen}\n isDisabled={isComboDisabled}\n isInvalid={isComboInvalid}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n />\n <ComboboxList\n triggerRef={triggerRef}\n options={options}\n size={size}\n variant={variant}\n isLoading={isLoading}\n isError={isError}\n hasMore={hasMore}\n onLoadMore={onLoadMore}\n isLoadingMore={isLoadingMore}\n showEmptyStatus\n />\n </>\n )}\n </RacComboBox>\n );\n }\n);\n\nMultiAutocomplete.displayName = 'MultiAutocomplete';\n"],"names":["multiAutocompleteVariants","cva","styles","toMultiValue","value","fromMultiValue","keys","MultiAutocomplete","supportRef","ref","options","defaultValue","onChange","inputValue","defaultInputValue","onInputChange","placeholder","clear","clientFilter","isLoading","isError","hasMore","onLoadMore","isLoadingMore","size","variant","block","invalid","disabled","className","dataTestId","onBlur","ariaLabel","ariaLabelledby","props","triggerRef","useRef","jsx","RacComboBox","cn","isOpen","isComboDisabled","isComboInvalid","jsxs","Fragment","ComboboxMultiTrigger","ComboboxList"],"mappings":";;;;;;;;;;;GAIaA,IAA4BC,EAAIC,EAAO,MAAM;AAAA,EACtD,UAAU;AAAA,IACN,OAAO;AAAA,MACH,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,EACX;AAAA,EAEJ,iBAAiB;AAAA,IACb,OAAO;AAAA,EAAA;AAEf,CAAC,GCRYC,IAAe,CAACC,MAA2D;AACpF,MAAIA,MAAU;AAId,WAAO,CAAC,GAAGA,CAAK;AACpB,GAEaC,IAAiB,CAACC,MAAkCA,GCDpDC,IAAoBC;AAAA,EAC7B,CAAC;AAAA,IACG,KAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAN;AAAA,IACA,cAAAO;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,cAAAC,IAAe;AAAA,IACf,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,YAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAcC;AAAA,IACd,mBAAmBC;AAAA,IACnB,GAAGC;AAAA,EAAA,MAC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AAAA,cACA,SAAAC;AAAA,cACA,SAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAC;AAAA,cACA,iBAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACnB,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIhB;AACJ;AAEAhB,EAAkB,cAAc;"}
|
|
@@ -6,7 +6,7 @@ import { s as G } from "./index-h8z54aFR.js";
|
|
|
6
6
|
import { a as H } from "./utils-DrTtzDsS.js";
|
|
7
7
|
import { C as J } from "./index-C_oo7Xm5.js";
|
|
8
8
|
import { cva as L } from "class-variance-authority";
|
|
9
|
-
import './assets/
|
|
9
|
+
import './assets/Component6.css';const O = "aub_styles-module_root_add2a", P = "aub_styles-module_block_6ae48", n = {
|
|
10
10
|
root: O,
|
|
11
11
|
block: P
|
|
12
12
|
}, Q = L(n.root, {
|
|
@@ -113,4 +113,4 @@ U.displayName = "Autocomplete";
|
|
|
113
113
|
export {
|
|
114
114
|
U as A
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=Component-
|
|
116
|
+
//# sourceMappingURL=Component-eoUrqznD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component-
|
|
1
|
+
{"version":3,"file":"Component-eoUrqznD.js","sources":["../src/autocomplete/theme.ts","../src/autocomplete/utils.ts","../src/autocomplete/Component.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const autocompleteVariants = cva(styles.root, {\n variants: {\n block: {\n true: styles.block,\n false: null,\n },\n },\n defaultVariants: {\n block: true,\n },\n});\n","import { type Key } from 'react-aria-components';\n\nimport { type TComboboxValue } from '@/select/types';\n\nexport const toSelectedKey = (value: TComboboxValue | null | undefined): Key | null | undefined => {\n if (value === undefined) {\n return undefined;\n }\n\n if (value === null || value === '') {\n return null;\n }\n\n return value;\n};\n\n/** True when click originated from nested button chrome (clear / chevron). */\nexport const isInteractiveTarget = (target: EventTarget | null) => {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n\n return Boolean(target.closest('button'));\n};\n","import { useRef } from 'react';\n\nimport cn from 'classnames';\nimport { ComboBox as RacComboBox } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { ComboboxList, ComboboxTrigger } from '@/combobox';\n\nimport { autocompleteVariants } from './theme';\nimport { type IAutocompleteProps, type TComboboxValue } from './types';\nimport { toSelectedKey } from './utils';\n\nexport const Autocomplete = supportRef(\n ({\n ref,\n options,\n value,\n defaultValue,\n onChange,\n inputValue,\n defaultInputValue,\n onInputChange,\n placeholder,\n clear = false,\n clientFilter = true,\n isLoading = false,\n isError = false,\n hasMore = false,\n onLoadMore,\n isLoadingMore = false,\n size = 'md',\n variant = 'primary',\n block = true,\n invalid = false,\n disabled = false,\n className,\n dataTestId,\n onBlur,\n ...props\n }: IAutocompleteProps) => {\n const triggerRef = useRef<HTMLDivElement>(null);\n const selectedKey = toSelectedKey(value);\n const defaultSelectedKey = toSelectedKey(defaultValue);\n\n return (\n <RacComboBox\n {...props}\n ref={ref}\n selectionMode=\"single\"\n value={selectedKey}\n defaultValue={defaultSelectedKey}\n onChange={key => {\n onChange?.(key as TComboboxValue | null);\n }}\n inputValue={inputValue}\n defaultInputValue={defaultInputValue}\n onInputChange={onInputChange}\n defaultItems={clientFilter ? options : undefined}\n items={clientFilter ? undefined : options}\n allowsEmptyCollection={!clientFilter || isLoading || isError || options.length === 0}\n isDisabled={disabled}\n isInvalid={invalid}\n onBlur={onBlur}\n data-invalid={invalid || undefined}\n data-test-id={dataTestId}\n className={cn(autocompleteVariants({ block }), className)}\n >\n {({ isOpen, isDisabled: isComboDisabled, isInvalid: isComboInvalid }) => (\n <>\n <ComboboxTrigger\n mode=\"combobox\"\n triggerRef={triggerRef}\n size={size}\n variant={variant}\n clear={clear}\n placeholder={placeholder ?? ''}\n isOpen={isOpen}\n isDisabled={isComboDisabled}\n isInvalid={isComboInvalid}\n />\n <ComboboxList\n triggerRef={triggerRef}\n options={options}\n size={size}\n variant={variant}\n isLoading={isLoading}\n isError={isError}\n hasMore={hasMore}\n onLoadMore={onLoadMore}\n isLoadingMore={isLoadingMore}\n showEmptyStatus\n />\n </>\n )}\n </RacComboBox>\n );\n }\n);\n\nAutocomplete.displayName = 'Autocomplete';\n"],"names":["autocompleteVariants","cva","styles","toSelectedKey","value","Autocomplete","supportRef","ref","options","defaultValue","onChange","inputValue","defaultInputValue","onInputChange","placeholder","clear","clientFilter","isLoading","isError","hasMore","onLoadMore","isLoadingMore","size","variant","block","invalid","disabled","className","dataTestId","onBlur","props","triggerRef","useRef","selectedKey","defaultSelectedKey","jsx","RacComboBox","key","cn","isOpen","isComboDisabled","isComboInvalid","jsxs","Fragment","ComboboxTrigger","ComboboxList"],"mappings":";;;;;;;;;;;GAIaA,IAAuBC,EAAIC,EAAO,MAAM;AAAA,EACjD,UAAU;AAAA,IACN,OAAO;AAAA,MACH,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,EACX;AAAA,EAEJ,iBAAiB;AAAA,IACb,OAAO;AAAA,EAAA;AAEf,CAAC,GCVYC,IAAgB,CAACC,MAAqE;AAC/F,MAAIA,MAAU;AAId,WAAIA,MAAU,QAAQA,MAAU,KACrB,OAGJA;AACX,GCDaC,IAAeC;AAAA,EACxB,CAAC;AAAA,IACG,KAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAJ;AAAA,IACA,cAAAK;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,cAAAC,IAAe;AAAA,IACf,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,YAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,I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,cACA,MAAAc;AAAA,cACA,SAAAC;AAAA,cACA,WAAAN;AAAA,cACA,SAAAC;AAAA,cACA,SAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAC;AAAA,cACA,iBAAe;AAAA,YAAA;AAAA,UAAA;AAAA,QACnB,EAAA,CACJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIhB;AACJ;AAEAhB,EAAa,cAAc;"}
|
|
@@ -5,9 +5,9 @@ import { s as k } from "./index-h8z54aFR.js";
|
|
|
5
5
|
import { typographyStyles as w } from "./typography/index.js";
|
|
6
6
|
import { C as Q } from "./ChevronRight-BsaiJImC.js";
|
|
7
7
|
import { b as W } from "./hooks-CekMiYbX.js";
|
|
8
|
-
import { T as D } from "./Component-
|
|
8
|
+
import { T as D } from "./Component-uHkw3SDR.js";
|
|
9
9
|
import { cva as z } from "class-variance-authority";
|
|
10
|
-
import './assets/
|
|
10
|
+
import './assets/Component11.css';const G = F(void 0), P = () => {
|
|
11
11
|
const l = q(G);
|
|
12
12
|
if (!l)
|
|
13
13
|
throw new Error("This component must be used within a <MenuList> component");
|
|
@@ -228,4 +228,4 @@ export {
|
|
|
228
228
|
At as M,
|
|
229
229
|
P as u
|
|
230
230
|
};
|
|
231
|
-
//# sourceMappingURL=Component-
|
|
231
|
+
//# sourceMappingURL=Component-jzDbWkuj.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component-6rieHJdg.js","sources":["../src/menu-list/context.ts","../src/menu-list/components/Group/index.tsx","../src/menu-list/components/Item/theme.ts","../src/menu-list/components/Item/index.tsx","../src/menu-list/theme.ts","../src/menu-list/Component.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type IMenuListContextValue } from './types';\n\nexport const MenuListContext = createContext<IMenuListContextValue | undefined>(undefined);\n\nexport const useMenuList = (): IMenuListContextValue => {\n const context = useContext(MenuListContext);\n\n if (!context) {\n throw new Error('This component must be used within a <MenuList> component');\n }\n\n return context;\n};\n","import cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { useMenuList } from '../../context';\nimport { type IMenuListGroupProps } from '../../types';\n\nimport styles from './styles.module.css';\n\nexport const MenuListGroup = supportRef(\n ({ ref, label, children, className, dataTestId, ...props }: IMenuListGroupProps) => {\n const { collapsed } = useMenuList();\n\n return (\n <div {...props} ref={ref} className={cn(styles.root, className)} data-test-id={dataTestId}>\n {collapsed ? null : <div className={cn(styles.label, typographyStyles.bodyXs)}>{label}</div>}\n {children}\n </div>\n );\n }\n);\n\nMenuListGroup.displayName = 'MenuList.Group';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const menuListItemVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n active: {\n true: styles.active,\n false: null,\n },\n open: {\n true: styles.open,\n false: null,\n },\n collapsed: {\n true: styles.collapsed,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n active: false,\n open: false,\n collapsed: false,\n },\n});\n","import { type ElementType, type MouseEvent } from 'react';\n\nimport cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { ChevronRight } from '@/icons';\nimport { useAuiLink } from '@/provider';\nimport { Tooltip } from '@/tooltip';\n\nimport { useMenuList } from '../../context';\nimport { type TMenuListItemProps } from '../../types';\n\nimport { menuListItemVariants } from './theme';\n\nimport styles from './styles.module.css';\n\nconst itemTypography = {\n sm: typographyStyles.bodyXs,\n md: typographyStyles.bodySTight,\n lg: typographyStyles.bodyM,\n} as const;\n\nexport const MenuListItem = supportRef(\n <P extends ElementType = 'a'>({\n as,\n id,\n children,\n icon: Icon,\n hasChildren = false,\n open = false,\n trailing,\n disabled = false,\n className,\n dataTestId,\n ref,\n onClick,\n href,\n ...props\n }: TMenuListItemProps<P>) => {\n const AuiLink = useAuiLink();\n const { size, activeId, setActiveId, disabled: listDisabled, collapsed } = useMenuList();\n const isDisabled = disabled || listDisabled;\n const isActive = activeId === id;\n const showTrailing = Boolean(trailing) && !collapsed;\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event as never);\n\n if (event.defaultPrevented || hasChildren) {\n return;\n }\n\n setActiveId(id);\n };\n\n const Component = (as ?? (href != null ? AuiLink : 'button')) as ElementType;\n const leafProps =\n Component === 'button'\n ? { type: 'button' as const, disabled: isDisabled }\n : {\n href,\n 'aria-disabled': isDisabled || undefined,\n tabIndex: isDisabled ? -1 : undefined,\n };\n\n const labelText = typeof children === 'string' ? children : undefined;\n\n const control = (\n <Component\n {...props}\n {...leafProps}\n ref={ref}\n className={cn(\n menuListItemVariants({ size, active: isActive, open, collapsed }),\n showTrailing && styles.rowControl,\n itemTypography[size],\n className\n )}\n data-test-id={dataTestId}\n data-menu-list-item={showTrailing ? undefined : ''}\n data-active={isActive || undefined}\n data-open={open || undefined}\n onClick={handleClick}\n aria-label={collapsed ? labelText : undefined}\n >\n {Icon ? <Icon className={styles.icon} aria-hidden focusable={false} /> : null}\n {collapsed ? null : <span className={styles.label}>{children}</span>}\n {hasChildren && !collapsed ? (\n <ChevronRight className={styles.chevron} aria-hidden focusable={false} />\n ) : null}\n </Component>\n );\n\n const withTrailing = showTrailing ? (\n <div\n className={cn(\n styles.row,\n isActive && styles.active,\n open && styles.open,\n isDisabled && styles.rowDisabled\n )}\n data-menu-list-item=\"\"\n data-active={isActive || undefined}\n data-open={open || undefined}\n >\n {control}\n <span className={styles.trailing}>{trailing}</span>\n </div>\n ) : (\n control\n );\n\n if (collapsed && labelText && !hasChildren) {\n return (\n <Tooltip>\n <Tooltip.Trigger>{withTrailing}</Tooltip.Trigger>\n <Tooltip.Content placement=\"right\">{labelText}</Tooltip.Content>\n </Tooltip>\n );\n }\n\n return withTrailing;\n }\n);\n\nMenuListItem.displayName = 'MenuList.Item';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const menuListShellVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n collapsed: {\n true: styles.collapsed,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n collapsed: false,\n },\n});\n","import { useCallback, useMemo, useState } from 'react';\n\nimport cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { MenuListGroup } from './components/Group';\nimport { MenuListItem } from './components/Item';\nimport { MenuListContext } from './context';\nimport { menuListShellVariants } from './theme';\nimport { type IMenuListProps } from './types';\n\nconst MenuListRoot = supportRef(\n ({\n ref,\n children,\n value,\n defaultValue,\n onChange,\n size = 'md',\n variant = 'primary',\n disabled = false,\n collapsed = false,\n className,\n dataTestId,\n ...props\n }: IMenuListProps) => {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const activeId = value !== undefined ? value : uncontrolled;\n\n const setActiveId = useCallback(\n (id: string) => {\n if (value === undefined) {\n setUncontrolled(id);\n }\n\n onChange?.(id);\n },\n [onChange, value]\n );\n\n const contextValue = useMemo(\n () => ({\n size,\n variant,\n activeId,\n setActiveId,\n disabled,\n collapsed,\n }),\n [activeId, collapsed, disabled, setActiveId, size, variant]\n );\n\n return (\n <MenuListContext.Provider value={contextValue}>\n <nav\n {...props}\n ref={ref}\n className={cn(menuListShellVariants({ size, variant, collapsed }), className)}\n data-size={size}\n data-collapsed={collapsed || undefined}\n data-disabled={disabled || undefined}\n data-test-id={dataTestId}\n >\n {children}\n </nav>\n </MenuListContext.Provider>\n );\n }\n);\n\nMenuListRoot.displayName = 'MenuList';\n\nexport const MenuList = Object.assign(MenuListRoot, {\n Group: MenuListGroup,\n Item: MenuListItem,\n});\n"],"names":["MenuListContext","createContext","useMenuList","context","useContext","MenuListGroup","supportRef","ref","label","children","className","dataTestId","props","collapsed","jsxs","cn","styles","jsx","typographyStyles","menuListItemVariants","cva","itemTypography","MenuListItem","as","id","Icon","hasChildren","open","trailing","disabled","onClick","href","AuiLink","useAuiLink","size","activeId","setActiveId","listDisabled","isDisabled","isActive","showTrailing","handleClick","event","Component","leafProps","labelText","control","ChevronRight","withTrailing","Tooltip","menuListShellVariants","MenuListRoot","value","defaultValue","onChange","variant","uncontrolled","setUncontrolled","useState","useCallback","contextValue","useMemo","MenuList"],"mappings":";;;;;;;;;AAIO,MAAMA,IAAkBC,EAAiD,MAAS,GAE5EC,IAAc,MAA6B;AACpD,QAAMC,IAAUC,EAAWJ,CAAe;AAE1C,MAAI,CAACG;AACD,UAAM,IAAI,MAAM,2DAA2D;AAG/E,SAAOA;AACX;;;GCJaE,IAAgBC;AAAA,EACzB,CAAC,EAAE,KAAAC,GAAK,OAAAC,GAAO,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,GAAGC,QAAiC;AAChF,UAAM,EAAE,WAAAC,EAAA,IAAcX,EAAA;AAEtB,WACI,gBAAAY,EAAC,OAAA,EAAK,GAAGF,GAAO,KAAAL,GAAU,WAAWQ,EAAGC,EAAO,MAAMN,CAAS,GAAG,gBAAcC,GAC1E,UAAA;AAAA,MAAAE,IAAY,OAAO,gBAAAI,EAAC,OAAA,EAAI,WAAWF,EAAGC,EAAO,OAAOE,EAAiB,MAAM,GAAI,UAAAV,EAAA,CAAM;AAAA,MACrFC;AAAA,IAAA,GACL;AAAA,EAER;AACJ;AAEAJ,EAAc,cAAc;;;;;;;;;;;;;;;;GCnBfc,KAAuBC,EAAIJ,EAAO,MAAM;AAAA,EACjD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEf,QAAQ;AAAA,MACJ,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,IAEX,MAAM;AAAA,MACF,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,IAEX,W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AA,QACH,MAAA3B;AAAA,QACA,SAAAqB;AAAA,QACA,UAAApB;AAAA,QACA,aAAAC;AAAA,QACA,UAAAP;AAAA,QACA,WAAAhB;AAAA,MAAA;AAAA,MAEJ,CAACsB,GAAUtB,GAAWgB,GAAUO,GAAaF,GAAMqB,CAAO;AAAA,IAAA;AAG9D,WACI,gBAAAtC,EAACjB,EAAgB,UAAhB,EAAyB,OAAO4D,GAC7B,UAAA,gBAAA3C;AAAA,MAAC;AAAA,MAAA;AAAA,QACI,GAAGL;AAAA,QACJ,KAAAL;AAAA,QACA,WAAWQ,EAAGmC,GAAsB,EAAE,MAAAhB,GAAM,SAAAqB,GAAS,WAAA1C,EAAA,CAAW,GAAGH,CAAS;AAAA,QAC5E,aAAWwB;AAAA,QACX,kBAAgBrB,KAAa;AAAA,QAC7B,iBAAegB,KAAY;AAAA,QAC3B,gBAAclB;AAAA,QAEb,UAAAF;AAAA,MAAA;AAAA,IAAA,GAET;AAAA,EAER;AACJ;AAEA0C,EAAa,cAAc;AAEpB,MAAMW,KAAW,OAAO,OAAOX,GAAc;AAAA,EAChD,OAAO9C;AAAA,EACP,MAAMiB;AACV,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Component-jzDbWkuj.js","sources":["../src/menu-list/context.ts","../src/menu-list/components/Group/index.tsx","../src/menu-list/components/Item/theme.ts","../src/menu-list/components/Item/index.tsx","../src/menu-list/theme.ts","../src/menu-list/Component.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { type IMenuListContextValue } from './types';\n\nexport const MenuListContext = createContext<IMenuListContextValue | undefined>(undefined);\n\nexport const useMenuList = (): IMenuListContextValue => {\n const context = useContext(MenuListContext);\n\n if (!context) {\n throw new Error('This component must be used within a <MenuList> component');\n }\n\n return context;\n};\n","import cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { useMenuList } from '../../context';\nimport { type IMenuListGroupProps } from '../../types';\n\nimport styles from './styles.module.css';\n\nexport const MenuListGroup = supportRef(\n ({ ref, label, children, className, dataTestId, ...props }: IMenuListGroupProps) => {\n const { collapsed } = useMenuList();\n\n return (\n <div {...props} ref={ref} className={cn(styles.root, className)} data-test-id={dataTestId}>\n {collapsed ? null : <div className={cn(styles.label, typographyStyles.bodyXs)}>{label}</div>}\n {children}\n </div>\n );\n }\n);\n\nMenuListGroup.displayName = 'MenuList.Group';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const menuListItemVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n active: {\n true: styles.active,\n false: null,\n },\n open: {\n true: styles.open,\n false: null,\n },\n collapsed: {\n true: styles.collapsed,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n active: false,\n open: false,\n collapsed: false,\n },\n});\n","import { type ElementType, type MouseEvent } from 'react';\n\nimport cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { ChevronRight } from '@/icons';\nimport { useAuiLink } from '@/provider';\nimport { Tooltip } from '@/tooltip';\n\nimport { useMenuList } from '../../context';\nimport { type TMenuListItemProps } from '../../types';\n\nimport { menuListItemVariants } from './theme';\n\nimport styles from './styles.module.css';\n\nconst itemTypography = {\n sm: typographyStyles.bodyXs,\n md: typographyStyles.bodySTight,\n lg: typographyStyles.bodyM,\n} as const;\n\nexport const MenuListItem = supportRef(\n <P extends ElementType = 'a'>({\n as,\n id,\n children,\n icon: Icon,\n hasChildren = false,\n open = false,\n trailing,\n disabled = false,\n className,\n dataTestId,\n ref,\n onClick,\n href,\n ...props\n }: TMenuListItemProps<P>) => {\n const AuiLink = useAuiLink();\n const { size, activeId, setActiveId, disabled: listDisabled, collapsed } = useMenuList();\n const isDisabled = disabled || listDisabled;\n const isActive = activeId === id;\n const showTrailing = Boolean(trailing) && !collapsed;\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n if (isDisabled) {\n event.preventDefault();\n return;\n }\n\n onClick?.(event as never);\n\n if (event.defaultPrevented || hasChildren) {\n return;\n }\n\n setActiveId(id);\n };\n\n const Component = (as ?? (href != null ? AuiLink : 'button')) as ElementType;\n const leafProps =\n Component === 'button'\n ? { type: 'button' as const, disabled: isDisabled }\n : {\n href,\n 'aria-disabled': isDisabled || undefined,\n tabIndex: isDisabled ? -1 : undefined,\n };\n\n const labelText = typeof children === 'string' ? children : undefined;\n\n const control = (\n <Component\n {...props}\n {...leafProps}\n ref={ref}\n className={cn(\n menuListItemVariants({ size, active: isActive, open, collapsed }),\n showTrailing && styles.rowControl,\n itemTypography[size],\n className\n )}\n data-test-id={dataTestId}\n data-menu-list-item={showTrailing ? undefined : ''}\n data-active={isActive || undefined}\n data-open={open || undefined}\n onClick={handleClick}\n aria-label={collapsed ? labelText : undefined}\n >\n {Icon ? <Icon className={styles.icon} aria-hidden focusable={false} /> : null}\n {collapsed ? null : <span className={styles.label}>{children}</span>}\n {hasChildren && !collapsed ? (\n <ChevronRight className={styles.chevron} aria-hidden focusable={false} />\n ) : null}\n </Component>\n );\n\n const withTrailing = showTrailing ? (\n <div\n className={cn(\n styles.row,\n isActive && styles.active,\n open && styles.open,\n isDisabled && styles.rowDisabled\n )}\n data-menu-list-item=\"\"\n data-active={isActive || undefined}\n data-open={open || undefined}\n >\n {control}\n <span className={styles.trailing}>{trailing}</span>\n </div>\n ) : (\n control\n );\n\n if (collapsed && labelText && !hasChildren) {\n return (\n <Tooltip>\n <Tooltip.Trigger>{withTrailing}</Tooltip.Trigger>\n <Tooltip.Content placement=\"right\">{labelText}</Tooltip.Content>\n </Tooltip>\n );\n }\n\n return withTrailing;\n }\n);\n\nMenuListItem.displayName = 'MenuList.Item';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const menuListShellVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n collapsed: {\n true: styles.collapsed,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n collapsed: false,\n },\n});\n","import { useCallback, useMemo, useState } from 'react';\n\nimport cn from 'classnames';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { MenuListGroup } from './components/Group';\nimport { MenuListItem } from './components/Item';\nimport { MenuListContext } from './context';\nimport { menuListShellVariants } from './theme';\nimport { type IMenuListProps } from './types';\n\nconst MenuListRoot = supportRef(\n ({\n ref,\n children,\n value,\n defaultValue,\n onChange,\n size = 'md',\n variant = 'primary',\n disabled = false,\n collapsed = false,\n className,\n dataTestId,\n ...props\n }: IMenuListProps) => {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const activeId = value !== undefined ? value : uncontrolled;\n\n const setActiveId = useCallback(\n (id: string) => {\n if (value === undefined) {\n setUncontrolled(id);\n }\n\n onChange?.(id);\n },\n [onChange, value]\n );\n\n const contextValue = useMemo(\n () => ({\n size,\n variant,\n activeId,\n setActiveId,\n disabled,\n collapsed,\n }),\n [activeId, collapsed, disabled, setActiveId, size, variant]\n );\n\n return (\n <MenuListContext.Provider value={contextValue}>\n <nav\n {...props}\n ref={ref}\n className={cn(menuListShellVariants({ size, variant, collapsed }), className)}\n data-size={size}\n data-collapsed={collapsed || undefined}\n data-disabled={disabled || undefined}\n data-test-id={dataTestId}\n >\n {children}\n </nav>\n </MenuListContext.Provider>\n );\n }\n);\n\nMenuListRoot.displayName = 'MenuList';\n\nexport const MenuList = Object.assign(MenuListRoot, {\n Group: MenuListGroup,\n Item: MenuListItem,\n});\n"],"names":["MenuListContext","createContext","useMenuList","context","useContext","MenuListGroup","supportRef","ref","label","children","className","dataTestId","props","collapsed","jsxs","cn","styles","jsx","typographyStyles","menuListItemVariants","cva","itemTypography","MenuListItem","as","id","Icon","hasChildren","open","trailing","disabled","onClick","href","AuiLink","useAuiLink","size","activeId","setActiveId","listDisabled","isDisabled","isActive","showTrailing","handleClick","event","Component","leafProps","labelText","control","ChevronRight","withTrailing","Tooltip","menuListShellVariants","MenuListRoot","value","defaultValue","onChange","variant","uncontrolled","setUncontrolled","useState","useCallback","contextValue","useMemo","MenuList"],"mappings":";;;;;;;;;AAIO,MAAMA,IAAkBC,EAAiD,MAAS,GAE5EC,IAAc,MAA6B;AACpD,QAAMC,IAAUC,EAAWJ,CAAe;AAE1C,MAAI,CAACG;AACD,UAAM,IAAI,MAAM,2DAA2D;AAG/E,SAAOA;AACX;;;GCJaE,IAAgBC;AAAA,EACzB,CAAC,EAAE,KAAAC,GAAK,OAAAC,GAAO,UAAAC,GAAU,WAAAC,GAAW,YAAAC,GAAY,GAAGC,QAAiC;AAChF,UAAM,EAAE,WAAAC,EAAA,IAAcX,EAAA;AAEtB,WACI,gBAAAY,EAAC,OAAA,EAAK,GAAGF,GAAO,KAAAL,GAAU,WAAWQ,EAAGC,EAAO,MAAMN,CAAS,GAAG,gBAAcC,GAC1E,UAAA;AAAA,MAAAE,IAAY,OAAO,gBAAAI,EAAC,OAAA,EAAI,WAAWF,EAAGC,EAAO,OAAOE,EAAiB,MAAM,GAAI,UAAAV,EAAA,CAAM;AAAA,MACrFC;AAAA,IAAA,GACL;AAAA,EAER;AACJ;AAEAJ,EAAc,cAAc;;;;;;;;;;;;;;;;GCnBfc,KAAuBC,EAAIJ,EAAO,MAAM;AAAA,EACjD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEf,QAAQ;AAAA,MACJ,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,IAEX,MAAM;AAAA,MACF,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,IAEX,WAAW;AAAA,MACP,MAAMA,EAAO;AAAA,MACb,OAAO;AAAA,IAAA;AAAA,EACX;AAAA,EAEJ,iBAAiB;AAAA,IACb,MAAM;AAAA,IACN,QAAQ;AA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MAEJ,CAACsB,GAAUtB,GAAWgB,GAAUO,GAAaF,GAAMqB,CAAO;AAAA,IAAA;AAG9D,WACI,gBAAAtC,EAACjB,EAAgB,UAAhB,EAAyB,OAAO4D,GAC7B,UAAA,gBAAA3C;AAAA,MAAC;AAAA,MAAA;AAAA,QACI,GAAGL;AAAA,QACJ,KAAAL;AAAA,QACA,WAAWQ,EAAGmC,GAAsB,EAAE,MAAAhB,GAAM,SAAAqB,GAAS,WAAA1C,EAAA,CAAW,GAAGH,CAAS;AAAA,QAC5E,aAAWwB;AAAA,QACX,kBAAgBrB,KAAa;AAAA,QAC7B,iBAAegB,KAAY;AAAA,QAC3B,gBAAclB;AAAA,QAEb,UAAAF;AAAA,MAAA;AAAA,IAAA,GAET;AAAA,EAER;AACJ;AAEA0C,EAAa,cAAc;AAEpB,MAAMW,KAAW,OAAO,OAAOX,GAAc;AAAA,EAChD,OAAO9C;AAAA,EACP,MAAMiB;AACV,CAAC;"}
|
|
@@ -5,7 +5,7 @@ import { Focusable as T, TooltipTrigger as f, Tooltip as b, OverlayArrow as v }
|
|
|
5
5
|
import { s as e } from "./index-h8z54aFR.js";
|
|
6
6
|
import { typographyStyles as w } from "./typography/index.js";
|
|
7
7
|
import { cva as h } from "class-variance-authority";
|
|
8
|
-
import './assets/
|
|
8
|
+
import './assets/Component4.css';const N = "aub_styles-module_root_faf48", S = "aub_styles-module_sm_43b7e", x = "aub_styles-module_md_c28ea", j = "aub_styles-module_lg_1bf7e", C = "aub_styles-module_primary_20229", z = "aub_styles-module_arrow_a5d00", L = "aub_styles-module_arrowSvg_5fd2e", o = {
|
|
9
9
|
root: N,
|
|
10
10
|
sm: S,
|
|
11
11
|
md: x,
|
|
@@ -66,4 +66,4 @@ const X = Object.assign(i, {
|
|
|
66
66
|
export {
|
|
67
67
|
X as T
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=Component-
|
|
69
|
+
//# sourceMappingURL=Component-uHkw3SDR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component-
|
|
1
|
+
{"version":3,"file":"Component-uHkw3SDR.js","sources":["../src/tooltip/theme.ts","../src/tooltip/Component.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const tooltipVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n },\n});\n","import { type ComponentProps } from 'react';\n\nimport cn from 'classnames';\nimport {\n Focusable,\n OverlayArrow,\n Tooltip as RacTooltip,\n TooltipTrigger as RacTooltipTrigger,\n} from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { tooltipVariants } from './theme';\nimport { type ITooltipContentProps, type ITooltipTriggerProps, type TTooltipProps } from './types';\n\nimport styles from './styles.module.css';\n\ntype TFocusableChild = NonNullable<ComponentProps<typeof Focusable>['children']>;\n\nconst TooltipRoot = supportRef(({ delay = 200, closeDelay = 100, ...props }: TTooltipProps) => (\n <RacTooltipTrigger delay={delay} closeDelay={closeDelay} {...props} />\n));\n\nTooltipRoot.displayName = 'Tooltip';\n\n/** Wraps a custom trigger (e.g. our Button) for RAC TooltipTrigger. */\nconst TooltipTrigger = ({ children }: ITooltipTriggerProps) => <Focusable>{children as TFocusableChild}</Focusable>;\n\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nconst TooltipContent = supportRef(\n ({\n ref,\n children,\n size = 'md',\n variant = 'primary',\n arrow = false,\n offset = 4,\n className,\n dataTestId,\n ...props\n }: ITooltipContentProps) => (\n <RacTooltip\n {...props}\n ref={ref}\n offset={offset}\n className={cn(tooltipVariants({ size, variant }), typographyStyles.bodyXs, className)}\n data-test-id={dataTestId}\n >\n {arrow ? (\n <OverlayArrow className={styles.arrow}>\n <svg className={styles.arrowSvg} viewBox=\"0 0 12 12\" aria-hidden>\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n ) : null}\n {children}\n </RacTooltip>\n )\n);\n\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = Object.assign(TooltipRoot, {\n Trigger: TooltipTrigger,\n Content: TooltipContent,\n});\n"],"names":["tooltipVariants","cva","styles","TooltipRoot","supportRef","delay","closeDelay","props","jsx","RacTooltipTrigger","TooltipTrigger","children","Focusable","TooltipContent","ref","size","variant","arrow","offset","className","dataTestId","jsxs","RacTooltip","cn","typographyStyles","OverlayArrow","Tooltip"],"mappings":";;;;;;;;;;;;;;;GAIaA,IAAkBC,EAAIC,EAAO,MAAM;AAAA,EAC5C,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACL,SAASA,EAAO;AAAA,IAAA;AAAA,EACpB;AAAA,EAEJ,iBAAiB;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAEjB,CAAC,GCCKC,IAAcC,EAAW,CAAC,EAAE,OAAAC,IAAQ,KAAK,YAAAC,IAAa,KAAK,GAAGC,EAAA,MAChE,gBAAAC,EAACC,GAAA,EAAkB,OAAAJ,GAAc,YAAAC,GAAyB,GAAGC,GAAO,CACvE;AAEDJ,EAAY,cAAc;AAG1B,MAAMO,IAAiB,CAAC,EAAE,UAAAC,QAAqC,gBAAAH,EAACI,KAAW,UAAAD,GAA4B;AAEvGD,EAAe,cAAc;AAE7B,MAAMG,IAAiBT;AAAA,EACnB,CAAC;AAAA,IACG,KAAAU;AAAA,IACA,UAAAH;AAAA,IACA,MAAAI,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,GAAGb;AAAA,EAAA,MAEH,gBAAAc;AAAA,IAACC;AAAAA,IAAA;AAAA,MACI,GAAGf;AAAA,MACJ,KAAAO;AAAA,MACA,QAAAI;AAAA,MACA,WAAWK,EAAGvB,EAAgB,EAAE,MAAAe,GAAM,SAAAC,GAAS,GAAGQ,EAAiB,QAAQL,CAAS;AAAA,MACpF,gBAAcC;AAAA,MAEb,UAAA;AAAA,QAAAH,IACG,gBAAAT,EAACiB,KAAa,WAAWvB,EAAO,OAC5B,UAAA,gBAAAM,EAAC,OAAA,EAAI,WAAWN,EAAO,UAAU,SAAQ,aAAY,eAAW,IAC5D,UAAA,gBAAAM,EAAC,QAAA,EAAK,GAAE,kBAAA,CAAkB,GAC9B,GACJ,IACA;AAAA,QACHG;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAE,EAAe,cAAc;AAEtB,MAAMa,IAAU,OAAO,OAAOvB,GAAa;AAAA,EAC9C,SAASO;AAAA,EACT,SAASG;AACb,CAAC;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as P } from "react";
|
|
3
|
-
import { B as d } from "../Component-
|
|
4
|
-
import { M as n } from "../Component-
|
|
3
|
+
import { B as d } from "../Component-DlBYWjUa.js";
|
|
4
|
+
import { M as n } from "../Component-CDURmZCP.js";
|
|
5
5
|
import { u as m } from "../hooks-CekMiYbX.js";
|
|
6
6
|
const i = ({
|
|
7
7
|
open: l,
|
|
@@ -2,10 +2,10 @@ import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as v, useRef as k, useCallback as x, useLayoutEffect as I, Children as S } from "react";
|
|
3
3
|
import b from "classnames";
|
|
4
4
|
import { s as _ } from "../index-h8z54aFR.js";
|
|
5
|
-
import { L as T } from "../Component-
|
|
5
|
+
import { L as T } from "../Component-D92F9hx-.js";
|
|
6
6
|
import { u as N } from "../hooks-CekMiYbX.js";
|
|
7
7
|
import { C as W } from "../ChevronDown-Dzp7mD66.js";
|
|
8
|
-
import { P as p } from "../Component-
|
|
8
|
+
import { P as p } from "../Component-CQyBQxAb.js";
|
|
9
9
|
import { t as C } from "../theme-OKaLFzOc.js";
|
|
10
10
|
import { C as $ } from "../Clear-DcxADxz6.js";
|
|
11
11
|
import '../assets/index25.css';const j = '[role="listbox"], [role="dialog"]', G = (t) => !!t.closest(j), w = "aub_styles-module_remove_4a273", z = "aub_styles-module_icon_fa5c7", g = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as L, createContext as P, useContext as q, useState as _ } from "react";
|
|
3
|
-
import { B } from "../Component-
|
|
4
|
-
import { D as g } from "../Component-
|
|
3
|
+
import { B } from "../Component-DlBYWjUa.js";
|
|
4
|
+
import { D as g } from "../Component-D_c3xBcb.js";
|
|
5
5
|
import { u as R } from "../hooks-CekMiYbX.js";
|
|
6
6
|
import H from "classnames";
|
|
7
7
|
import { useDragAndDrop as V, DropIndicator as G, GridList as M, GridListItem as O, Button as T } from "react-aria-components";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.aub_styles-
|
|
1
|
+
.aub_styles-module_root_1a08f{display:flex;flex-direction:column;gap:var(--aui-color-picker-gap-md);width:100%}.aub_styles-module_area_bc0ba{width:100%;aspect-ratio:1;border-radius:var(--aui-color-picker-radius-md);touch-action:none}.aub_styles-module_hue_431a1{width:100%}.aub_styles-module_hueTrack_aed1b{width:100%;height:var(--aui-color-picker-slider-h);border-radius:var(--aui-color-picker-radius-md);touch-action:none}.aub_styles-module_thumb_3861b{box-sizing:border-box;width:var(--aui-color-picker-thumb);height:var(--aui-color-picker-thumb);border:var(--aui-color-picker-thumb-ring) solid var(--aui-color-picker-thumb-border);border-radius:var(--aui-color-picker-thumb);box-shadow:var(--aui-color-picker-shadow)}.aub_styles-module_presets_b941b{display:flex;flex-wrap:wrap;gap:var(--aui-color-picker-gap-md)}.aub_styles-module_preset_94276{width:var(--aui-color-picker-preset);height:var(--aui-color-picker-preset);border-radius:var(--aui-color-picker-swatch-radius)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.aub_styles-
|
|
1
|
+
.aub_styles-module_root_50457{min-width:0}.aub_styles-module_block_95024{width:100%}
|