jenosize-ui 0.1.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/LICENSE +28 -0
- package/README.md +100 -0
- package/THIRD-PARTY-NOTICES.md +163 -0
- package/dist/Button-Bt7pzM4R.d.ts +82 -0
- package/dist/PaymentInput-CKPIPNWH.d.ts +141 -0
- package/dist/Select-CVbEQ2Ep.d.ts +118 -0
- package/dist/TagInput-CTJYOB4J.d.ts +90 -0
- package/dist/avatar.d.ts +161 -0
- package/dist/avatar.js +11 -0
- package/dist/badge.d.ts +109 -0
- package/dist/badge.js +10 -0
- package/dist/breadcrumb.d.ts +58 -0
- package/dist/breadcrumb.js +7 -0
- package/dist/button.d.ts +54 -0
- package/dist/button.js +14 -0
- package/dist/calendar.d.ts +368 -0
- package/dist/calendar.js +21 -0
- package/dist/callout.d.ts +70 -0
- package/dist/callout.js +16 -0
- package/dist/card-nWicloNi.d.ts +80 -0
- package/dist/card.d.ts +2 -0
- package/dist/card.js +7 -0
- package/dist/checkbox.d.ts +133 -0
- package/dist/checkbox.js +11 -0
- package/dist/chunk-24TO7E32.js +42 -0
- package/dist/chunk-3Y5X7B5C.js +146 -0
- package/dist/chunk-4OLULPQG.js +202 -0
- package/dist/chunk-4P2NBLBW.js +103 -0
- package/dist/chunk-52IFGFTL.js +11 -0
- package/dist/chunk-5FATN5YD.js +115 -0
- package/dist/chunk-5NOBSXJN.js +297 -0
- package/dist/chunk-5RAPA22E.js +106 -0
- package/dist/chunk-7EUAMHMU.js +16 -0
- package/dist/chunk-7EWQKTNQ.js +1336 -0
- package/dist/chunk-7HOIZ3UO.js +110 -0
- package/dist/chunk-7IU5TMFL.js +452 -0
- package/dist/chunk-7JBNLEJ7.js +29 -0
- package/dist/chunk-7S2TBALK.js +23 -0
- package/dist/chunk-BJUZVYQC.js +188 -0
- package/dist/chunk-BVJWBYIG.js +66 -0
- package/dist/chunk-CME4DIML.js +65 -0
- package/dist/chunk-CYPPEUX5.js +73 -0
- package/dist/chunk-D5BTFSL7.js +71 -0
- package/dist/chunk-D6TPWNRK.js +387 -0
- package/dist/chunk-DJSXIAFH.js +66 -0
- package/dist/chunk-DRZCJCBO.js +46 -0
- package/dist/chunk-DWKILXHE.js +17 -0
- package/dist/chunk-E7ZSWBAK.js +70 -0
- package/dist/chunk-EDSK6FEH.js +8 -0
- package/dist/chunk-F2K7VJUV.js +114 -0
- package/dist/chunk-F6NLE6XJ.js +40 -0
- package/dist/chunk-FHHAPGCR.js +32 -0
- package/dist/chunk-FXIBGTS5.js +14 -0
- package/dist/chunk-GCVA3OIV.js +72 -0
- package/dist/chunk-GFOAJVW5.js +336 -0
- package/dist/chunk-GRLSUQQE.js +136 -0
- package/dist/chunk-GTHJWR3Q.js +77 -0
- package/dist/chunk-HMUZE6EK.js +67 -0
- package/dist/chunk-I7WU4GTY.js +503 -0
- package/dist/chunk-J2BCKBHC.js +151 -0
- package/dist/chunk-J36M3KRX.js +1315 -0
- package/dist/chunk-J7ZQQFPT.js +113 -0
- package/dist/chunk-JP26LPCY.js +234 -0
- package/dist/chunk-JTNFJLIY.js +1046 -0
- package/dist/chunk-JVJRHBTD.js +50 -0
- package/dist/chunk-JYGR44ZC.js +133 -0
- package/dist/chunk-KDLPXXD2.js +173 -0
- package/dist/chunk-KMSYEE23.js +224 -0
- package/dist/chunk-KNYKWUYX.js +52 -0
- package/dist/chunk-LME57Z6J.js +138 -0
- package/dist/chunk-MFJP5FA7.js +20 -0
- package/dist/chunk-MKC5HNA7.js +1692 -0
- package/dist/chunk-MQGD2OUF.js +39 -0
- package/dist/chunk-MUFHLP4S.js +566 -0
- package/dist/chunk-O2LG3PNI.js +74 -0
- package/dist/chunk-O4GRKO3I.js +66 -0
- package/dist/chunk-OHUFNYGN.js +791 -0
- package/dist/chunk-PWKWNDBS.js +243 -0
- package/dist/chunk-QA74ITR4.js +103 -0
- package/dist/chunk-R6RGJF4L.js +170 -0
- package/dist/chunk-S7NNXWIN.js +7 -0
- package/dist/chunk-SV56BSUQ.js +162 -0
- package/dist/chunk-T7FCG7XV.js +435 -0
- package/dist/chunk-THC2ISYP.js +57 -0
- package/dist/chunk-VWC72TR3.js +115 -0
- package/dist/chunk-W46K56XU.js +216 -0
- package/dist/chunk-W5GGOUUI.js +75 -0
- package/dist/chunk-WEUJYDCV.js +269 -0
- package/dist/chunk-WFY7DKQD.js +279 -0
- package/dist/chunk-WZQFC7ZN.js +448 -0
- package/dist/chunk-Z3ETJN5G.js +136 -0
- package/dist/chunk-ZOOX3TUB.js +192 -0
- package/dist/chunk-ZSNJ6UA3.js +42 -0
- package/dist/chunk-ZZA2LUTL.js +130 -0
- package/dist/chunk-ZZT2E5VT.js +24 -0
- package/dist/color-CtSxc1Rh.d.ts +6 -0
- package/dist/combobox.d.ts +184 -0
- package/dist/combobox.js +21 -0
- package/dist/date-input.d.ts +83 -0
- package/dist/date-input.js +16 -0
- package/dist/date-picker.d.ts +249 -0
- package/dist/date-picker.js +29 -0
- package/dist/date-utils-7hTFTXNK.d.ts +34 -0
- package/dist/date-vMJBKAFK.d.ts +22 -0
- package/dist/dialog.d.ts +86 -0
- package/dist/dialog.js +15 -0
- package/dist/drawer.d.ts +77 -0
- package/dist/drawer.js +14 -0
- package/dist/dropdown-menu.d.ts +218 -0
- package/dist/dropdown-menu.js +10 -0
- package/dist/file-trigger.d.ts +42 -0
- package/dist/file-trigger.js +3 -0
- package/dist/form.d.ts +487 -0
- package/dist/form.js +1179 -0
- package/dist/header-navigation.d.ts +74 -0
- package/dist/header-navigation.js +23 -0
- package/dist/icons/app.d.ts +48 -0
- package/dist/icons/app.js +282 -0
- package/dist/icons/flag.d.ts +817 -0
- package/dist/icons/flag.js +58336 -0
- package/dist/icons/integration.d.ts +36 -0
- package/dist/icons/integration.js +531 -0
- package/dist/icons/payment.d.ts +116 -0
- package/dist/icons/payment.js +2418 -0
- package/dist/icons.d.ts +2013 -0
- package/dist/icons.js +2012 -0
- package/dist/illustration.d.ts +48 -0
- package/dist/illustration.js +4 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +73 -0
- package/dist/indicator.d.ts +51 -0
- package/dist/indicator.js +7 -0
- package/dist/input.d.ts +66 -0
- package/dist/input.js +15 -0
- package/dist/multi-value-CJb_tnvi.d.ts +8 -0
- package/dist/nav-Bla0o_-1.d.ts +98 -0
- package/dist/number-input.d.ts +80 -0
- package/dist/number-input.js +15 -0
- package/dist/options-CPEIgjtd.d.ts +68 -0
- package/dist/overflow-Df0h42Oi.d.ts +29 -0
- package/dist/pagination.d.ts +77 -0
- package/dist/pagination.js +17 -0
- package/dist/payment-input.d.ts +7 -0
- package/dist/payment-input.js +15 -0
- package/dist/popover.d.ts +60 -0
- package/dist/popover.js +14 -0
- package/dist/progress.d.ts +87 -0
- package/dist/progress.js +5 -0
- package/dist/radio.d.ts +77 -0
- package/dist/radio.js +12 -0
- package/dist/select.d.ts +68 -0
- package/dist/select.js +24 -0
- package/dist/shared-BNXAdgh2.d.ts +9 -0
- package/dist/shared-BYXJPnsN.d.ts +11 -0
- package/dist/shared-Dc-GgA16.d.ts +42 -0
- package/dist/sidebar-navigation.d.ts +129 -0
- package/dist/sidebar-navigation.js +15 -0
- package/dist/styles.css +2 -0
- package/dist/switch.d.ts +23 -0
- package/dist/switch.js +7 -0
- package/dist/table.d.ts +692 -0
- package/dist/table.js +44 -0
- package/dist/tabs.d.ts +111 -0
- package/dist/tabs.js +8 -0
- package/dist/tag-input.d.ts +12 -0
- package/dist/tag-input.js +19 -0
- package/dist/tag.d.ts +98 -0
- package/dist/tag.js +9 -0
- package/dist/textarea.d.ts +40 -0
- package/dist/textarea.js +12 -0
- package/dist/theme-script.d.ts +29 -0
- package/dist/theme-script.js +15 -0
- package/dist/theme.css +929 -0
- package/dist/theme.d.ts +71 -0
- package/dist/theme.js +15 -0
- package/dist/toast.d.ts +242 -0
- package/dist/toast.js +15 -0
- package/dist/tooltip.d.ts +70 -0
- package/dist/tooltip.js +6 -0
- package/dist/tree.d.ts +308 -0
- package/dist/tree.js +11 -0
- package/package.json +352 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { b as Option } from './options-CPEIgjtd.js';
|
|
3
|
+
|
|
4
|
+
type CheckboxGroupOrientation = "vertical" | "horizontal";
|
|
5
|
+
/** A data-first option for `CheckboxGroup` `options` — the flat-props shape each
|
|
6
|
+
* child `Checkbox` already takes. `label` is a **required string** (the item's
|
|
7
|
+
* accessible name), not the base's optional `ReactNode` (AGENTS §11: each
|
|
8
|
+
* data-first control extends the shared `Option` base with its own fields,
|
|
9
|
+
* mirroring `RadioOption`). */
|
|
10
|
+
interface CheckboxGroupOption<V extends string = string> extends Option<V> {
|
|
11
|
+
/** Primary text; also the item's accessible name. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Optional secondary text rendered under the label. */
|
|
14
|
+
hint?: string;
|
|
15
|
+
}
|
|
16
|
+
interface CheckboxGroupProps<V extends string = string> extends Omit<React.ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange" | "color"> {
|
|
17
|
+
/** Controlled ticked values (each child `Checkbox`'s `value`). Pair with `onValueChange`.
|
|
18
|
+
* **Checked against `options`** — `V` is inferred from the values you passed there, so one bad
|
|
19
|
+
* member is a compile error instead of a box that never appears ticked. `NoInfer` keeps this prop
|
|
20
|
+
* out of inference so the union can't widen to admit it. A widened `options` annotation leaves
|
|
21
|
+
* `V = string` (unchanged behaviour). See `docs/type-safety-policy.md`. */
|
|
22
|
+
value?: NoInfer<V>[];
|
|
23
|
+
/** Initially ticked values (uncontrolled) — checked against `options` like {@link value}. */
|
|
24
|
+
defaultValue?: NoInfer<V>[];
|
|
25
|
+
/** Fires when any checkbox in the group toggles, with the next value array and the native event. */
|
|
26
|
+
onValueChange?: (value: V[], event: Event) => void;
|
|
27
|
+
/** Data-first options — renders one `Checkbox` per entry. The canonical API;
|
|
28
|
+
* `children` (raw `Checkbox value="…"`s) still work and render after them. */
|
|
29
|
+
options?: readonly CheckboxGroupOption<V>[];
|
|
30
|
+
/** Renders a tri-state “select all” parent checkbox above the items: dash while
|
|
31
|
+
* the selection is partial, check when every value is ticked, empty when none.
|
|
32
|
+
* Toggling it ticks/unticks the whole group (Base UI parent-checkbox logic —
|
|
33
|
+
* disabled children keep their state). */
|
|
34
|
+
selectAllLabel?: React.ReactNode;
|
|
35
|
+
/** Every value the parent checkbox controls. Defaults to `options` values; pass
|
|
36
|
+
* explicitly when composing `children` with your own `<Checkbox parent />`. */
|
|
37
|
+
allValues?: readonly NoInfer<V>[];
|
|
38
|
+
/** Control + text scale; inherited by every child (a child's own `size` wins). @default "md" */
|
|
39
|
+
size?: CheckboxSize;
|
|
40
|
+
/** Stack items in a column or a wrapping row. @default "vertical" */
|
|
41
|
+
orientation?: CheckboxGroupOrientation;
|
|
42
|
+
/** Disables every checkbox in the group. @default false */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** Visible label naming the whole group (`aria-labelledby`-associated). Omit and
|
|
45
|
+
* pass `aria-label`/`aria-labelledby` for a group with no visible heading. */
|
|
46
|
+
label?: React.ReactNode;
|
|
47
|
+
/** Append a required `*` after the group label. @default false */
|
|
48
|
+
required?: boolean;
|
|
49
|
+
/** Suppress the visual required `*` while keeping `required` semantics. @default false */
|
|
50
|
+
hideRequiredIndicator?: boolean;
|
|
51
|
+
/** Help-circle tooltip after the group label (title line). */
|
|
52
|
+
tooltip?: string;
|
|
53
|
+
/** Optional secondary line under {@link tooltip}. */
|
|
54
|
+
tooltipDescription?: string;
|
|
55
|
+
/** Helper text under the group; hidden while an error shows. */
|
|
56
|
+
hint?: React.ReactNode;
|
|
57
|
+
/** Error state for the whole group: red rings + error focus rings and `aria-invalid` on every child. @default false */
|
|
58
|
+
invalid?: boolean;
|
|
59
|
+
/** Optional error message rendered below the group. A truthy `error` also implies `invalid`. */
|
|
60
|
+
error?: string;
|
|
61
|
+
/** Render every item as a bordered card whose border turns brand when checked. @default false */
|
|
62
|
+
bordered?: boolean;
|
|
63
|
+
/** Whether the group column takes `w-full`. Only OBSERVABLE where the parent would otherwise let
|
|
64
|
+
* the column shrink-to-fit (a flex row / grid cell) — in a plain block container it fills either
|
|
65
|
+
* way. Bound the group with a width in `className`. @default true */
|
|
66
|
+
fullWidth?: boolean;
|
|
67
|
+
/** Layout/spacing only (margin, width, flex/grid placement), merged via `cn()`. */
|
|
68
|
+
className?: string;
|
|
69
|
+
/** Escape hatch: raw `<Checkbox value="…" />` children (and/or your own markup —
|
|
70
|
+
* e.g. a table whose rows contain grouped checkboxes). Prefer `options`. */
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Shared state for a set of checkboxes (Base UI CheckboxGroup): one `value`
|
|
75
|
+
* string array instead of N booleans, with an optional one-liner tri-state
|
|
76
|
+
* “select all” parent (`selectAllLabel`). Data-first `options` is the canonical
|
|
77
|
+
* API (AGENTS §11); `children` stay as the composition escape hatch.
|
|
78
|
+
*/
|
|
79
|
+
declare function CheckboxGroup<V extends string = string>(props: CheckboxGroupProps<V>): React.JSX.Element;
|
|
80
|
+
declare namespace CheckboxGroup {
|
|
81
|
+
var displayName: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** `md` = 16px box (the default; UUI's `sm`) · `lg` = 20px box (UUI's `md`).
|
|
85
|
+
* There is no `sm` — see the NAMING note in `field/option-row.tsx`. */
|
|
86
|
+
type CheckboxSize = "md" | "lg";
|
|
87
|
+
interface CheckboxProps extends React.AriaAttributes {
|
|
88
|
+
/** Control + text size. `md` = 16px box (default), `lg` = 20px box. Inherited
|
|
89
|
+
* from an enclosing `CheckboxGroup` when omitted. @default "md" */
|
|
90
|
+
size?: CheckboxSize;
|
|
91
|
+
/** Visible label text. Renders the text column; clicking it toggles the box. */
|
|
92
|
+
label?: React.ReactNode;
|
|
93
|
+
/** Optional supporting/hint text under the label. Linked via `aria-describedby`. */
|
|
94
|
+
hint?: React.ReactNode;
|
|
95
|
+
/** Controlled checked state. Pair with `onCheckedChange`. */
|
|
96
|
+
checked?: boolean;
|
|
97
|
+
/** Initial checked state when uncontrolled. @default false */
|
|
98
|
+
defaultChecked?: boolean;
|
|
99
|
+
/** Tri-state "mixed" visual (dash); sets `aria-checked="mixed"`. @default false */
|
|
100
|
+
indeterminate?: boolean;
|
|
101
|
+
/** Fires on toggle with the next checked value and the originating native event. */
|
|
102
|
+
onCheckedChange?: (checked: boolean, event: Event) => void;
|
|
103
|
+
/** Non-interactive + muted styling. @default false */
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
/** Marks the field required for form submission (`aria-required`). @default false */
|
|
106
|
+
required?: boolean;
|
|
107
|
+
/** Error state: red border + error focus ring and `aria-invalid`. @default false */
|
|
108
|
+
invalid?: boolean;
|
|
109
|
+
/** Optional error message (Base UI `Field.Error`). A truthy `error` also implies `invalid`. */
|
|
110
|
+
error?: string;
|
|
111
|
+
/** Wrap the box + text in a full-width card whose border turns brand when checked. @default false */
|
|
112
|
+
bordered?: boolean;
|
|
113
|
+
/** Form field name for the hidden native input. */
|
|
114
|
+
name?: string;
|
|
115
|
+
/** Submitted value when checked (standalone `@default "on"`). Inside a
|
|
116
|
+
* `CheckboxGroup` there is **no default** — the value is the checkbox's
|
|
117
|
+
* identity in the group's `value` array, so each child must pass its own. */
|
|
118
|
+
value?: string;
|
|
119
|
+
/** Marks this checkbox as the tri-state “select all” parent of the enclosing
|
|
120
|
+
* `CheckboxGroup` (requires the group's `allValues`). Base UI then drives its
|
|
121
|
+
* checked/indeterminate state from the group. No effect outside a group.
|
|
122
|
+
* Prefer the group's `selectAllLabel` one-liner. @default false */
|
|
123
|
+
parent?: boolean;
|
|
124
|
+
/** Input id; auto-generated for label association if omitted. */
|
|
125
|
+
id?: string;
|
|
126
|
+
/** Ref forwarded to the hidden native input (Base UI passthrough). */
|
|
127
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
128
|
+
/** **Layout/spacing only** (margin, width, flex/grid placement), merged via `cn()`. */
|
|
129
|
+
className?: string;
|
|
130
|
+
}
|
|
131
|
+
declare function Checkbox(props: CheckboxProps): React.JSX.Element;
|
|
132
|
+
|
|
133
|
+
export { Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupOrientation, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize };
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";export { Checkbox, CheckboxGroup } from './chunk-ZOOX3TUB.js';
|
|
2
|
+
import './chunk-GTHJWR3Q.js';
|
|
3
|
+
import './chunk-MFJP5FA7.js';
|
|
4
|
+
import './chunk-J2BCKBHC.js';
|
|
5
|
+
import './chunk-24TO7E32.js';
|
|
6
|
+
import './chunk-ZZA2LUTL.js';
|
|
7
|
+
import './chunk-O4GRKO3I.js';
|
|
8
|
+
import './chunk-GCVA3OIV.js';
|
|
9
|
+
import './chunk-ZSNJ6UA3.js';
|
|
10
|
+
//# sourceMappingURL=checkbox.js.map
|
|
11
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ArrowDown, ArrowRight, Bell, Calendar, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, ChevronsLeft, ChevronsRight, ChevronsUpDown, CircleAlert, CircleCheck, CircleHelp, CircleX, Columns3, EllipsisVertical, Eye, EyeOff, GripVertical, Inbox, Info, LoaderCircle, Menu, Minus, Moon, PanelLeft, Plus, Search, Slash, Sun, TriangleAlert, User, X } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
// src/components/icons/core/index.ts
|
|
4
|
+
var ArrowDownIcon = ArrowDown;
|
|
5
|
+
var ArrowRightIcon = ArrowRight;
|
|
6
|
+
var BellIcon = Bell;
|
|
7
|
+
var CalendarIcon = Calendar;
|
|
8
|
+
var CheckIcon = Check;
|
|
9
|
+
var ChevronDownIcon = ChevronDown;
|
|
10
|
+
var ChevronLeftIcon = ChevronLeft;
|
|
11
|
+
var ChevronRightIcon = ChevronRight;
|
|
12
|
+
var ChevronsLeftIcon = ChevronsLeft;
|
|
13
|
+
var ChevronsRightIcon = ChevronsRight;
|
|
14
|
+
var ChevronsUpDownIcon = ChevronsUpDown;
|
|
15
|
+
var ChevronUpIcon = ChevronUp;
|
|
16
|
+
var CircleAlertIcon = CircleAlert;
|
|
17
|
+
var CircleCheckIcon = CircleCheck;
|
|
18
|
+
var CircleHelpIcon = CircleHelp;
|
|
19
|
+
var CircleXIcon = CircleX;
|
|
20
|
+
var Columns3Icon = Columns3;
|
|
21
|
+
var EllipsisVerticalIcon = EllipsisVertical;
|
|
22
|
+
var EyeIcon = Eye;
|
|
23
|
+
var EyeOffIcon = EyeOff;
|
|
24
|
+
var GripVerticalIcon = GripVertical;
|
|
25
|
+
var InboxIcon = Inbox;
|
|
26
|
+
var InfoIcon = Info;
|
|
27
|
+
var LoaderCircleIcon = LoaderCircle;
|
|
28
|
+
var MenuIcon = Menu;
|
|
29
|
+
var MinusIcon = Minus;
|
|
30
|
+
var MoonIcon = Moon;
|
|
31
|
+
var PanelLeftIcon = PanelLeft;
|
|
32
|
+
var PlusIcon = Plus;
|
|
33
|
+
var SearchIcon = Search;
|
|
34
|
+
var SlashIcon = Slash;
|
|
35
|
+
var SunIcon = Sun;
|
|
36
|
+
var TriangleAlertIcon = TriangleAlert;
|
|
37
|
+
var UserIcon = User;
|
|
38
|
+
var XIcon = X;
|
|
39
|
+
|
|
40
|
+
export { ArrowDownIcon, ArrowRightIcon, BellIcon, CalendarIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleHelpIcon, CircleXIcon, Columns3Icon, EllipsisVerticalIcon, EyeIcon, EyeOffIcon, GripVerticalIcon, InboxIcon, InfoIcon, LoaderCircleIcon, MenuIcon, MinusIcon, MoonIcon, PanelLeftIcon, PlusIcon, SearchIcon, SlashIcon, SunIcon, TriangleAlertIcon, UserIcon, XIcon };
|
|
41
|
+
//# sourceMappingURL=chunk-24TO7E32.js.map
|
|
42
|
+
//# sourceMappingURL=chunk-24TO7E32.js.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { useControllableOpen } from './chunk-CYPPEUX5.js';
|
|
2
|
+
import { PanelChrome } from './chunk-J7ZQQFPT.js';
|
|
3
|
+
import { CloseButton } from './chunk-MQGD2OUF.js';
|
|
4
|
+
import { EXPLICIT_CLOSE, NO_RETURN_FOCUS } from './chunk-S7NNXWIN.js';
|
|
5
|
+
import { useScrollFade } from './chunk-O2LG3PNI.js';
|
|
6
|
+
import { POPUP_MOTION } from './chunk-O4GRKO3I.js';
|
|
7
|
+
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
8
|
+
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
9
|
+
import * as React2 from 'react';
|
|
10
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var POPOVER_SIZE = {
|
|
13
|
+
sm: "max-w-64",
|
|
14
|
+
md: "max-w-80",
|
|
15
|
+
lg: "max-w-96"
|
|
16
|
+
};
|
|
17
|
+
var POPUP_SURFACE = cn("rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt ring-inset", "text-primary");
|
|
18
|
+
var POPUP_MAX_H = "max-h-[min(var(--available-height),24rem)]";
|
|
19
|
+
function PopoverSurface(props) {
|
|
20
|
+
const {
|
|
21
|
+
size,
|
|
22
|
+
side,
|
|
23
|
+
align,
|
|
24
|
+
sideOffset,
|
|
25
|
+
alignOffset,
|
|
26
|
+
showClose,
|
|
27
|
+
dividers,
|
|
28
|
+
keepMounted,
|
|
29
|
+
title,
|
|
30
|
+
description,
|
|
31
|
+
leading,
|
|
32
|
+
trailing,
|
|
33
|
+
footer,
|
|
34
|
+
className,
|
|
35
|
+
children,
|
|
36
|
+
close,
|
|
37
|
+
closeReasonRef
|
|
38
|
+
} = props;
|
|
39
|
+
const ariaLabel = props["aria-label"];
|
|
40
|
+
const bodyRef = React2.useRef(null);
|
|
41
|
+
const { maskImage } = useScrollFade(bodyRef, { axis: "vertical" });
|
|
42
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { keepMounted, children: /* @__PURE__ */ jsx(Popover$1.Positioner, { side, align, sideOffset, alignOffset, className: "z-50 outline-none", children: /* @__PURE__ */ jsx(
|
|
43
|
+
PanelChrome,
|
|
44
|
+
{
|
|
45
|
+
render: /* @__PURE__ */ jsx(
|
|
46
|
+
Popover$1.Popup,
|
|
47
|
+
{
|
|
48
|
+
"aria-label": ariaLabel,
|
|
49
|
+
finalFocus: () => !NO_RETURN_FOCUS.has(closeReasonRef.current ?? "none")
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
className: cn("relative w-max outline-none", POPUP_MAX_H, POPUP_SURFACE, POPUP_MOTION, POPOVER_SIZE[size], className),
|
|
53
|
+
padding: "md",
|
|
54
|
+
titleScale: "md",
|
|
55
|
+
footerAlign: "end",
|
|
56
|
+
scrollBody: true,
|
|
57
|
+
bodyRef,
|
|
58
|
+
bodyMask: maskImage,
|
|
59
|
+
dividers,
|
|
60
|
+
title,
|
|
61
|
+
description,
|
|
62
|
+
leading,
|
|
63
|
+
trailing,
|
|
64
|
+
footer: footer != null ? typeof footer === "function" ? footer(close) : footer : null,
|
|
65
|
+
renderTitle: (p) => /* @__PURE__ */ jsx(Popover$1.Title, { ...p }),
|
|
66
|
+
renderDescription: (p) => /* @__PURE__ */ jsx(Popover$1.Description, { ...p }),
|
|
67
|
+
closeSlot: showClose ? (cls) => /* @__PURE__ */ jsx(Popover$1.Close, { render: /* @__PURE__ */ jsx(CloseButton, { size: "sm" }), className: cls }) : void 0,
|
|
68
|
+
children
|
|
69
|
+
}
|
|
70
|
+
) }) });
|
|
71
|
+
}
|
|
72
|
+
function Popover(props) {
|
|
73
|
+
const {
|
|
74
|
+
trigger,
|
|
75
|
+
open,
|
|
76
|
+
defaultOpen = false,
|
|
77
|
+
onOpenChange,
|
|
78
|
+
side = "bottom",
|
|
79
|
+
align = "center",
|
|
80
|
+
sideOffset = 8,
|
|
81
|
+
alignOffset = 0,
|
|
82
|
+
size = "md",
|
|
83
|
+
showClose = false,
|
|
84
|
+
dividers = false,
|
|
85
|
+
modal = false,
|
|
86
|
+
keepMounted = false,
|
|
87
|
+
dismissible = true,
|
|
88
|
+
title,
|
|
89
|
+
description,
|
|
90
|
+
leading,
|
|
91
|
+
trailing,
|
|
92
|
+
footer,
|
|
93
|
+
className,
|
|
94
|
+
children
|
|
95
|
+
} = props;
|
|
96
|
+
const ariaLabel = props["aria-label"];
|
|
97
|
+
const [value, setOpen] = useControllableOpen(open, defaultOpen, onOpenChange);
|
|
98
|
+
const close = React2.useCallback(() => setOpen(false), [setOpen]);
|
|
99
|
+
const closeReasonRef = React2.useRef(void 0);
|
|
100
|
+
return /* @__PURE__ */ jsxs(
|
|
101
|
+
Popover$1.Root,
|
|
102
|
+
{
|
|
103
|
+
modal,
|
|
104
|
+
open: value,
|
|
105
|
+
onOpenChange: (nextOpen, details) => {
|
|
106
|
+
if (!dismissible && nextOpen === false && !EXPLICIT_CLOSE.has(details.reason)) {
|
|
107
|
+
details.cancel();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!nextOpen) closeReasonRef.current = details.reason;
|
|
111
|
+
setOpen(nextOpen);
|
|
112
|
+
},
|
|
113
|
+
children: [
|
|
114
|
+
trigger ? /* @__PURE__ */ jsx(Popover$1.Trigger, { render: trigger }) : null,
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
PopoverSurface,
|
|
117
|
+
{
|
|
118
|
+
size,
|
|
119
|
+
side,
|
|
120
|
+
align,
|
|
121
|
+
sideOffset,
|
|
122
|
+
alignOffset,
|
|
123
|
+
showClose,
|
|
124
|
+
dividers,
|
|
125
|
+
keepMounted,
|
|
126
|
+
title,
|
|
127
|
+
description,
|
|
128
|
+
leading,
|
|
129
|
+
trailing,
|
|
130
|
+
footer,
|
|
131
|
+
className,
|
|
132
|
+
"aria-label": ariaLabel,
|
|
133
|
+
close,
|
|
134
|
+
closeReasonRef,
|
|
135
|
+
children
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
Popover.displayName = "Popover";
|
|
143
|
+
|
|
144
|
+
export { Popover };
|
|
145
|
+
//# sourceMappingURL=chunk-3Y5X7B5C.js.map
|
|
146
|
+
//# sourceMappingURL=chunk-3Y5X7B5C.js.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Slot } from './chunk-52IFGFTL.js';
|
|
2
|
+
import { useScrollFade } from './chunk-O2LG3PNI.js';
|
|
3
|
+
import { useIsomorphicLayoutEffect } from './chunk-EDSK6FEH.js';
|
|
4
|
+
import { warnStickyNoScrollport, nearestScrollport, warnNeedsName } from './chunk-GCVA3OIV.js';
|
|
5
|
+
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
6
|
+
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var LIST_OUTER = {
|
|
11
|
+
underline: {
|
|
12
|
+
// The divider is an INSET shadow, not a `border-b`/`border-l`. A real border sits below the
|
|
13
|
+
// List's clip box, so the (clipped) indicator can never reach down to cover it — leaving a gray
|
|
14
|
+
// sliver under the active tab. An inset shadow draws the 1px line just INSIDE the bottom/left
|
|
15
|
+
// edge (within the indicator's reach) and behind the List content, so the active indicator paints
|
|
16
|
+
// over it (no sliver) while it still shows as the baseline under inactive tabs.
|
|
17
|
+
horizontal: "shadow-[inset_0_-1px_0_0_var(--color-border-secondary)]",
|
|
18
|
+
// `flex` establishes a height context so a `max-h-*` on the root bounds the inner scroll
|
|
19
|
+
// viewport — without it the block wrapper clips but the list can't scroll.
|
|
20
|
+
// (The pill outers are already `inline-flex`, so only underline-vertical needs this.)
|
|
21
|
+
vertical: "flex shadow-[inset_1px_0_0_0_var(--color-border-secondary)]"
|
|
22
|
+
},
|
|
23
|
+
pill: {
|
|
24
|
+
horizontal: "inline-flex rounded-[10px] bg-tertiary p-1",
|
|
25
|
+
vertical: "inline-flex rounded-[10px] bg-tertiary p-1"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var LIST_INNER = {
|
|
29
|
+
underline: {
|
|
30
|
+
horizontal: "relative flex min-w-0 flex-row gap-1",
|
|
31
|
+
vertical: "relative flex min-h-0 flex-col items-start gap-1"
|
|
32
|
+
},
|
|
33
|
+
pill: {
|
|
34
|
+
horizontal: "relative flex min-w-0 flex-row gap-1",
|
|
35
|
+
vertical: "relative flex min-h-0 flex-col gap-1"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var NO_SCROLLBAR = "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
39
|
+
var STICKY_WRAP = {
|
|
40
|
+
horizontal: "sticky top-[var(--tabs-sticky-top,0px)] z-4 flex flex-col bg-[var(--tabs-sticky-bg,var(--color-bg-primary))]",
|
|
41
|
+
// No fill: a vertical rail sits BESIDE the panel, so nothing ever scrolls under it — and an
|
|
42
|
+
// opaque patch the exact size of the rail would be the wrong surface on any host that is not
|
|
43
|
+
// `bg` (a Card in dark, a well), which is a defect you only see once it ships.
|
|
44
|
+
//
|
|
45
|
+
// `self-start` is what makes the rail movable at all. As a stretched flex item of the row root it
|
|
46
|
+
// is exactly as tall as the panel beside it, so there is no distance between its top and its
|
|
47
|
+
// containing block's bottom — the sticky range is zero and it never appears to pin.
|
|
48
|
+
//
|
|
49
|
+
// The `max-h` is the other half of that: a rail TALLER than the box it docks to cannot pin either
|
|
50
|
+
// (measured: a 12-tab rail at 524px inside a 256px scrollport just made the box taller and rode up
|
|
51
|
+
// with the content). Bounded to the scrollport's visible height minus the dock offset, the rail
|
|
52
|
+
// fits, docks, and hands its own overflow to the scroll-fade — which needs a bounded height to
|
|
53
|
+
// engage at all. `--tabs-sticky-port` is measured onto the wrapper for an element scrollport; the
|
|
54
|
+
// `100dvh` fallback is right for the document, and for SSR, where there is nothing to measure.
|
|
55
|
+
vertical: "sticky top-[var(--tabs-sticky-top,0px)] z-4 flex max-h-[calc(var(--tabs-sticky-port,100dvh)-var(--tabs-sticky-top,0px))] self-start"
|
|
56
|
+
};
|
|
57
|
+
var INDICATOR_BASE = "pointer-events-none absolute z-0 transition-all duration-200 ease-out";
|
|
58
|
+
var INDICATOR = {
|
|
59
|
+
underline: {
|
|
60
|
+
// `bottom-0` / `left-0` (NOT `-bottom-px` / `-left-px`): the indicator must not overhang the
|
|
61
|
+
// Tabs.List box. When a strip overflows its axis we set `overflow-*-auto` for the scroll-fade,
|
|
62
|
+
// and CSS forces the CROSS axis from `visible` to `auto` too — turning the List into a scroll
|
|
63
|
+
// container that clips BOTH axes. A 1px overhang then gets sheared off, so the 2px accent renders
|
|
64
|
+
// as 1px on overflowing strips and a full 2px on fitting ones. Sitting flush on the box edge (on
|
|
65
|
+
// top of the static divider) keeps it a consistent, un-clipped 2px everywhere.
|
|
66
|
+
horizontal: "left-0 bottom-0 h-0.5 w-[var(--active-tab-width)] translate-x-[var(--active-tab-left)] bg-brand-solid",
|
|
67
|
+
vertical: "top-0 left-0 w-0.5 h-[var(--active-tab-height)] translate-y-[var(--active-tab-top)] bg-brand-solid"
|
|
68
|
+
},
|
|
69
|
+
pill: {
|
|
70
|
+
horizontal: "top-0 left-0 h-[var(--active-tab-height)] w-[var(--active-tab-width)] translate-x-[var(--active-tab-left)] translate-y-[var(--active-tab-top)] rounded-lg bg-primary shadow-sm",
|
|
71
|
+
vertical: "top-0 left-0 h-[var(--active-tab-height)] w-[var(--active-tab-width)] translate-x-[var(--active-tab-left)] translate-y-[var(--active-tab-top)] rounded-lg bg-primary shadow-sm"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var TAB_BASE = "group relative z-10 inline-flex items-center justify-center font-semibold whitespace-nowrap select-none cursor-pointer outline-focus-ring transition-colors duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50";
|
|
75
|
+
var TAB_SIZE = {
|
|
76
|
+
sm: "px-2.5 py-1.5 gap-1.5 text-sm",
|
|
77
|
+
md: "px-3.5 py-2.5 gap-2 text-sm",
|
|
78
|
+
lg: "px-4 py-3 gap-2 text-md"
|
|
79
|
+
};
|
|
80
|
+
var TAB_SLOT_ICON = {
|
|
81
|
+
sm: "[&>svg]:size-4",
|
|
82
|
+
md: "[&>svg]:size-5",
|
|
83
|
+
lg: "[&>svg]:size-5"
|
|
84
|
+
};
|
|
85
|
+
var TAB_VARIANT = {
|
|
86
|
+
underline: "rounded-md text-tertiary enabled:not-data-[active]:hover:text-secondary data-[active]:text-brand-secondary",
|
|
87
|
+
pill: "rounded-lg text-tertiary enabled:not-data-[active]:hover:bg-secondary enabled:not-data-[active]:hover:text-secondary data-[active]:text-primary"
|
|
88
|
+
};
|
|
89
|
+
var PANEL_CLASS = cn("text-primary outline-focus-ring", "focus-visible:rounded-lg focus-visible:outline-2 focus-visible:outline-offset-2");
|
|
90
|
+
function LazyPanel({ render }) {
|
|
91
|
+
return /* @__PURE__ */ jsx(Fragment, { children: render() });
|
|
92
|
+
}
|
|
93
|
+
function Tabs(props) {
|
|
94
|
+
const {
|
|
95
|
+
items,
|
|
96
|
+
value,
|
|
97
|
+
defaultValue,
|
|
98
|
+
onValueChange,
|
|
99
|
+
variant = "underline",
|
|
100
|
+
size = "md",
|
|
101
|
+
orientation = "horizontal",
|
|
102
|
+
keepMounted = false,
|
|
103
|
+
fitted = false,
|
|
104
|
+
sticky = false,
|
|
105
|
+
className
|
|
106
|
+
} = props;
|
|
107
|
+
const ariaLabel = props["aria-label"];
|
|
108
|
+
const ariaLabelledby = props["aria-labelledby"];
|
|
109
|
+
const horizontal = orientation === "horizontal";
|
|
110
|
+
const listRef = React.useRef(null);
|
|
111
|
+
const { maskImage, scrollable } = useScrollFade(listRef, { axis: horizontal ? "horizontal" : "vertical" });
|
|
112
|
+
const stickyRef = React.useRef(null);
|
|
113
|
+
useIsomorphicLayoutEffect(() => {
|
|
114
|
+
if (sticky) warnStickyNoScrollport("Tabs", "sticky", stickyRef.current);
|
|
115
|
+
}, [sticky]);
|
|
116
|
+
const [portHeight, setPortHeight] = React.useState(null);
|
|
117
|
+
useIsomorphicLayoutEffect(() => {
|
|
118
|
+
if (!sticky || horizontal) {
|
|
119
|
+
setPortHeight(null);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const port = nearestScrollport(stickyRef.current)?.el;
|
|
123
|
+
if (port == null) {
|
|
124
|
+
setPortHeight(null);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const measure = () => setPortHeight(port.clientHeight > 0 ? port.clientHeight : null);
|
|
128
|
+
measure();
|
|
129
|
+
const ro = new ResizeObserver(measure);
|
|
130
|
+
ro.observe(port);
|
|
131
|
+
return () => ro.disconnect();
|
|
132
|
+
}, [sticky, horizontal]);
|
|
133
|
+
warnNeedsName("Tabs", Boolean(ariaLabel || ariaLabelledby), "`aria-label` or `aria-labelledby` to name the tablist");
|
|
134
|
+
const panels = items.filter((it) => it.content != null);
|
|
135
|
+
const strip = /* @__PURE__ */ jsx("div", { className: LIST_OUTER[variant][orientation], children: /* @__PURE__ */ jsxs(
|
|
136
|
+
Tabs$1.List,
|
|
137
|
+
{
|
|
138
|
+
activateOnFocus: true,
|
|
139
|
+
"aria-label": ariaLabel,
|
|
140
|
+
"aria-labelledby": ariaLabelledby,
|
|
141
|
+
ref: listRef,
|
|
142
|
+
style: maskImage ? { maskImage, WebkitMaskImage: maskImage } : void 0,
|
|
143
|
+
className: cn(
|
|
144
|
+
LIST_INNER[variant][orientation],
|
|
145
|
+
// `fitted` only has to stretch the INNER list: the outer wrapper is already a stretched
|
|
146
|
+
// flex item of the root, so it spans the container on its own — but the list is the
|
|
147
|
+
// outer's only (non-growing) flex item, so without this it stays at its content width
|
|
148
|
+
// and the `flex-1` tabs have no free space to share.
|
|
149
|
+
fitted && (horizontal ? "w-full" : "h-full"),
|
|
150
|
+
// Clip (and thus scroll) ONLY when overflowing — otherwise overflow stays visible so the
|
|
151
|
+
// pill shadow + a tab's outset focus outline aren't sheared by the scroll box. See above.
|
|
152
|
+
scrollable && (horizontal ? "overflow-x-auto" : "overflow-y-auto"),
|
|
153
|
+
NO_SCROLLBAR
|
|
154
|
+
),
|
|
155
|
+
children: [
|
|
156
|
+
items.map((it) => /* @__PURE__ */ jsxs(
|
|
157
|
+
Tabs$1.Tab,
|
|
158
|
+
{
|
|
159
|
+
value: it.value,
|
|
160
|
+
disabled: it.disabled,
|
|
161
|
+
"aria-label": it.ariaLabel,
|
|
162
|
+
className: cn(TAB_BASE, TAB_SIZE[size], TAB_VARIANT[variant], fitted && (horizontal ? "min-w-0 flex-1" : "flex-1"), it.className),
|
|
163
|
+
children: [
|
|
164
|
+
it.leading != null ? /* @__PURE__ */ jsx(Slot, { className: TAB_SLOT_ICON[size], children: it.leading }) : null,
|
|
165
|
+
fitted && horizontal && it.label != null ? /* @__PURE__ */ jsx("span", { className: "truncate", children: it.label }) : it.label,
|
|
166
|
+
it.trailing != null ? /* @__PURE__ */ jsx(Slot, { className: TAB_SLOT_ICON[size], children: it.trailing }) : null
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
it.value
|
|
170
|
+
)),
|
|
171
|
+
/* @__PURE__ */ jsx(Tabs$1.Indicator, { renderBeforeHydration: true, className: cn(INDICATOR_BASE, INDICATOR[variant][orientation]) })
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
) });
|
|
175
|
+
return /* @__PURE__ */ jsxs(
|
|
176
|
+
Tabs$1.Root,
|
|
177
|
+
{
|
|
178
|
+
value,
|
|
179
|
+
defaultValue: defaultValue ?? items.find((it) => !it.disabled)?.value ?? items[0]?.value,
|
|
180
|
+
orientation,
|
|
181
|
+
onValueChange: onValueChange ? (next, details) => onValueChange(next, details.event) : void 0,
|
|
182
|
+
className: cn("flex gap-4", "data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row", className),
|
|
183
|
+
children: [
|
|
184
|
+
sticky ? /* @__PURE__ */ jsx(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
ref: stickyRef,
|
|
188
|
+
className: STICKY_WRAP[orientation],
|
|
189
|
+
style: portHeight == null ? void 0 : { "--tabs-sticky-port": `${portHeight}px` },
|
|
190
|
+
children: strip
|
|
191
|
+
}
|
|
192
|
+
) : strip,
|
|
193
|
+
panels.map((it) => /* @__PURE__ */ jsx(Tabs$1.Panel, { value: it.value, keepMounted: it.keepMounted ?? keepMounted, className: PANEL_CLASS, children: typeof it.content === "function" ? /* @__PURE__ */ jsx(LazyPanel, { render: it.content }) : it.content }, it.value))
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
Tabs.displayName = "Tabs";
|
|
199
|
+
|
|
200
|
+
export { Tabs };
|
|
201
|
+
//# sourceMappingURL=chunk-4OLULPQG.js.map
|
|
202
|
+
//# sourceMappingURL=chunk-4OLULPQG.js.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { overflowClasses } from './chunk-DWKILXHE.js';
|
|
2
|
+
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
3
|
+
|
|
4
|
+
// src/components/tag/shared.ts
|
|
5
|
+
var TAG_BASE = "group/tag inline-flex items-center gap-0.75 rounded-md bg-primary text-secondary ring-1 ring-inset ring-primary font-medium select-none transition duration-50 ease-linear";
|
|
6
|
+
var TAG_SIZE = {
|
|
7
|
+
sm: {
|
|
8
|
+
root: "px-2 py-0.75 text-xs",
|
|
9
|
+
padCheckbox: "pl-1.25",
|
|
10
|
+
padLeading: "pl-1.25",
|
|
11
|
+
padTrailing: "pr-1",
|
|
12
|
+
padClose: "pr-1",
|
|
13
|
+
content: "gap-1",
|
|
14
|
+
checkboxBox: "size-3.5",
|
|
15
|
+
checkIcon: "size-2.5",
|
|
16
|
+
slotIcon: "[&>svg]:size-3",
|
|
17
|
+
closeRoot: "p-0.5",
|
|
18
|
+
closeIcon: "[&_svg]:size-2.5 [&_svg]:stroke-[3.6px]"
|
|
19
|
+
},
|
|
20
|
+
md: {
|
|
21
|
+
root: "px-2.25 py-0.5 text-sm",
|
|
22
|
+
padCheckbox: "pl-1",
|
|
23
|
+
padLeading: "pl-1.5",
|
|
24
|
+
padTrailing: "pr-0.75",
|
|
25
|
+
padClose: "pr-1",
|
|
26
|
+
content: "gap-1.25",
|
|
27
|
+
checkboxBox: "size-4",
|
|
28
|
+
checkIcon: "size-3",
|
|
29
|
+
slotIcon: "[&>svg]:size-3.5",
|
|
30
|
+
closeRoot: "p-0.5",
|
|
31
|
+
closeIcon: "[&_svg]:size-3 [&_svg]:stroke-[2.86px]"
|
|
32
|
+
},
|
|
33
|
+
lg: {
|
|
34
|
+
root: "px-2.5 py-1 text-sm",
|
|
35
|
+
padCheckbox: "pl-1.25",
|
|
36
|
+
padLeading: "pl-2",
|
|
37
|
+
padTrailing: "pr-1",
|
|
38
|
+
padClose: "pr-1",
|
|
39
|
+
content: "gap-1.5",
|
|
40
|
+
checkboxBox: "size-4.5",
|
|
41
|
+
checkIcon: "size-3.5",
|
|
42
|
+
slotIcon: "[&>svg]:size-4",
|
|
43
|
+
closeRoot: "p-0.75",
|
|
44
|
+
closeIcon: "[&_svg]:size-3.5 [&_svg]:stroke-3"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function tagRootClass(size, flags) {
|
|
48
|
+
const s = TAG_SIZE[size];
|
|
49
|
+
return cn(
|
|
50
|
+
TAG_BASE,
|
|
51
|
+
// nowrap + the `min-w-0` that lets the pill shrink inside a `max-w-*` / constrained
|
|
52
|
+
// parent both come from the ONE overflow table.
|
|
53
|
+
overflowClasses(flags.overflow ?? "visible").root,
|
|
54
|
+
s.root,
|
|
55
|
+
flags.withLeading && s.padLeading,
|
|
56
|
+
flags.withClose && s.padClose,
|
|
57
|
+
flags.withTrailing && s.padTrailing,
|
|
58
|
+
flags.withCheckbox && s.padCheckbox,
|
|
59
|
+
flags.disabled && "cursor-not-allowed"
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
var TAG_SELECTED = "data-[pressed]:bg-brand-primary data-[pressed]:text-brand-secondary data-[pressed]:ring-brand";
|
|
63
|
+
function tagContentClass(size, shrink = false) {
|
|
64
|
+
return cn("flex items-center", shrink && "min-w-0", TAG_SIZE[size].content);
|
|
65
|
+
}
|
|
66
|
+
function tagSlotClass(size) {
|
|
67
|
+
return cn("inline-flex shrink-0 items-center", TAG_SIZE[size].slotIcon);
|
|
68
|
+
}
|
|
69
|
+
function tagLabelClass(overflow) {
|
|
70
|
+
return overflowClasses(overflow).label;
|
|
71
|
+
}
|
|
72
|
+
function tagCheckboxBoxClass(size) {
|
|
73
|
+
return cn(
|
|
74
|
+
"flex shrink-0 cursor-pointer appearance-none items-center justify-center rounded-sm bg-primary ring-1 ring-primary ring-inset",
|
|
75
|
+
"transition duration-50 ease-linear",
|
|
76
|
+
"group-data-[pressed]/tag:bg-brand-solid group-data-[pressed]/tag:ring-brand-solid",
|
|
77
|
+
"group-data-[disabled]/tag:cursor-not-allowed group-data-[disabled]/tag:opacity-50",
|
|
78
|
+
"group-data-[disabled]/tag:not-group-data-[pressed]/tag:bg-tertiary",
|
|
79
|
+
TAG_SIZE[size].checkboxBox
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function tagCheckboxGlyphClass(size) {
|
|
83
|
+
return cn(
|
|
84
|
+
"pointer-events-none absolute text-fg-white opacity-0 transition duration-50 ease-linear",
|
|
85
|
+
"group-data-[pressed]/tag:opacity-100",
|
|
86
|
+
TAG_SIZE[size].checkIcon
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function tagCloseClass(size) {
|
|
90
|
+
const s = TAG_SIZE[size];
|
|
91
|
+
return cn(
|
|
92
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-fg-quaternary outline-none",
|
|
93
|
+
"transition duration-100 ease-linear hover:bg-secondary hover:text-quaternary",
|
|
94
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring",
|
|
95
|
+
"disabled:cursor-not-allowed",
|
|
96
|
+
s.closeRoot,
|
|
97
|
+
s.closeIcon
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { TAG_SELECTED, tagCheckboxBoxClass, tagCheckboxGlyphClass, tagCloseClass, tagContentClass, tagLabelClass, tagRootClass, tagSlotClass };
|
|
102
|
+
//# sourceMappingURL=chunk-4P2NBLBW.js.map
|
|
103
|
+
//# sourceMappingURL=chunk-4P2NBLBW.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Slot({ children, tone = "node", className }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": tone === "text" ? true : void 0, className: cn("inline-flex shrink-0", className), children });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Slot };
|
|
10
|
+
//# sourceMappingURL=chunk-52IFGFTL.js.map
|
|
11
|
+
//# sourceMappingURL=chunk-52IFGFTL.js.map
|