@stll/ui 0.75.0 → 0.77.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/dist/components/button-classes.d.ts +66 -0
- package/dist/components/button-classes.js +62 -0
- package/dist/components/button.d.ts +11 -4
- package/dist/components/button.js +8 -48
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/composer-tokens.d.ts +9 -1
- package/dist/components/composer-tokens.js +9 -1
- package/dist/components/composer.d.ts +2 -2
- package/dist/components/composer.js +4 -4
- package/dist/components/control-face.d.ts +158 -0
- package/dist/components/control-face.js +192 -0
- package/dist/components/court-badge.d.ts +4 -2
- package/dist/components/court-badge.js +5 -3
- package/dist/components/details-grid.d.ts +8 -3
- package/dist/components/details-grid.js +28 -15
- package/dist/components/details-list-face.d.ts +7 -0
- package/dist/components/details-list-face.js +25 -0
- package/dist/components/document-mark.shared.d.ts +149 -0
- package/dist/components/document-mark.shared.js +62 -0
- package/dist/components/field-classes.d.ts +4 -0
- package/dist/components/field-classes.js +6 -0
- package/dist/components/field.js +5 -3
- package/dist/components/frame.d.ts +5 -1
- package/dist/components/frame.js +2 -2
- package/dist/components/input-otp-face.d.ts +4 -0
- package/dist/components/input-otp-face.js +15 -0
- package/dist/components/input-otp.d.ts +1 -1
- package/dist/components/input-otp.js +3 -8
- package/dist/components/label-classes.d.ts +20 -0
- package/dist/components/label-classes.js +21 -0
- package/dist/components/label.d.ts +2 -20
- package/dist/components/label.js +2 -19
- package/dist/components/landing-shell.d.ts +64 -0
- package/dist/components/landing-shell.js +189 -0
- package/dist/components/landing.d.ts +2 -39
- package/dist/components/landing.js +2 -66
- package/dist/components/list-shell.d.ts +39 -0
- package/dist/components/list-shell.js +99 -0
- package/dist/components/list.d.ts +3 -24
- package/dist/components/list.js +2 -49
- package/dist/components/outcome-screen-core.d.ts +25 -0
- package/dist/components/outcome-screen-core.js +76 -0
- package/dist/components/outcome-screen-face.d.ts +3 -0
- package/dist/components/outcome-screen-face.js +6 -0
- package/dist/components/outcome-screen-view.d.ts +9 -21
- package/dist/components/outcome-screen-view.js +36 -101
- package/dist/components/segmented-icon-toggle.d.ts +4 -1
- package/dist/components/segmented-icon-toggle.js +5 -4
- package/dist/components/select-classes.d.ts +10 -0
- package/dist/components/select-classes.js +13 -0
- package/dist/components/select.js +3 -7
- package/dist/components/skeleton.d.ts +3 -1
- package/dist/components/skeleton.js +9 -2
- package/dist/components/split-button.d.ts +2 -1
- package/dist/components/split-button.js +6 -14
- package/dist/components/switch.d.ts +1 -5
- package/dist/components/switch.js +2 -5
- package/dist/components/table-cell.d.ts +35 -0
- package/dist/components/table-cell.js +26 -0
- package/dist/components/table-shell.d.ts +131 -0
- package/dist/components/table-shell.js +141 -0
- package/dist/components/table.d.ts +4 -88
- package/dist/components/table.js +21 -70
- package/dist/components/tabs-classes.d.ts +8 -0
- package/dist/components/tabs-classes.js +10 -0
- package/dist/components/tabs.js +4 -3
- package/dist/components/toggle-classes.d.ts +13 -0
- package/dist/components/toggle-classes.js +10 -0
- package/dist/components/toggle-group-classes.d.ts +12 -0
- package/dist/components/toggle-group-classes.js +13 -0
- package/dist/components/toggle-group.js +3 -2
- package/dist/components/truncated-text-face.d.ts +33 -0
- package/dist/components/truncated-text-face.js +30 -0
- package/dist/components/truncated-text.d.ts +1 -6
- package/dist/components/truncated-text.js +1 -15
- package/dist/components/view-toolbar-classes.d.ts +13 -0
- package/dist/components/view-toolbar-classes.js +15 -0
- package/dist/components/view-toolbar-shell.d.ts +24 -0
- package/dist/components/view-toolbar-shell.js +43 -0
- package/dist/components/view-toolbar.d.ts +2 -15
- package/dist/components/view-toolbar.js +8 -26
- package/dist/data-table/table.js +2 -1
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +2 -2
- package/dist/index.d.ts +15 -9
- package/dist/index.js +11 -8
- package/dist/kanban/card-shell.js +1 -1
- package/dist/kanban/column-bands.d.ts +0 -8
- package/dist/kanban/column-bands.js +1 -18
- package/dist/kanban/column-header-shell.d.ts +39 -0
- package/dist/kanban/column-header-shell.js +48 -0
- package/dist/kanban/column-header.js +9 -12
- package/dist/kanban/index.d.ts +2 -2
- package/dist/kanban/index.js +3 -3
- package/dist/kanban/layout-tokens.d.ts +18 -1
- package/dist/kanban/layout-tokens.js +18 -1
- package/dist/kanban/sticky-lane.d.ts +2 -7
- package/dist/kanban/sticky-lane.js +1 -6
- package/dist/kanban/subgroup-board.js +2 -2
- package/dist/lib/{menu-row.js → list-row-metric.js} +1 -1
- package/package.json +52 -4
- /package/dist/lib/{menu-row.d.ts → list-row-metric.d.ts} +0 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { ChevronDownIcon, ChevronsUpDownIcon } from "../icons.js";
|
|
2
|
+
import { CONTROL_SIZE } from "../lib/control-size.js";
|
|
3
|
+
import { FIELD_TRIGGER_CLASS_NAME } from "../lib/field-trigger.js";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { BUTTON_BASE_CLASS, BUTTON_FACE_SIZE_CLASS_NAMES, BUTTON_LAYOUT_CLASS_NAMES, BUTTON_SIZE_CLASS_NAMES, BUTTON_VARIANT_CLASS_NAMES } from "./button-classes.js";
|
|
6
|
+
import { FIELD_CLASS_NAME, FIELD_DESCRIPTION_CLASS_NAME } from "./field-classes.js";
|
|
7
|
+
import { INPUT_CONTROL_CLASS_NAME, INPUT_ELEMENT_CLASS_NAME, INPUT_SIZE_CLASS_NAMES } from "./input-control.js";
|
|
8
|
+
import { LABEL_VARIANT_CLASS_NAME } from "./label-classes.js";
|
|
9
|
+
import { SELECT_TRIGGER_ICON_CLASS_NAME, SELECT_TRIGGER_SIZE_CLASS_NAMES, SELECT_VALUE_CLASS_NAME } from "./select-classes.js";
|
|
10
|
+
import { InlineSkeleton } from "./skeleton.js";
|
|
11
|
+
import { TABS_LIST_BASE_CLASS, TABS_LIST_DEFAULT_CLASS, TABS_TAB_CLASS } from "./tabs-classes.js";
|
|
12
|
+
import { CHECKBOX_CLASS_NAME, SWITCH_ROOT_CLASS_NAME, SWITCH_ROOT_SIZE_CLASS_NAME } from "./toggle-classes.js";
|
|
13
|
+
import { SEGMENTED_ICON_TOGGLE_ICON_CLASS_NAME, TOGGLE_GROUP_CLASS_NAME, TOGGLE_GROUP_ITEM_CLASS_NAME, segmentedIconToggleClassName, segmentedIconToggleItemClassName } from "./toggle-group-classes.js";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
// src/components/control-face.tsx
|
|
16
|
+
/** How an unavailable control reads: the dimming a disabled one gets. */
|
|
17
|
+
const FACE_UNAVAILABLE_CLASS = "pointer-events-none opacity-64";
|
|
18
|
+
/**
|
|
19
|
+
* A button face's classes: the box, size and variant colours of the button
|
|
20
|
+
* it stands in for, unavailable. For the face of a button its caller
|
|
21
|
+
* restyles, on an element of that caller's own.
|
|
22
|
+
*/
|
|
23
|
+
const buttonFaceClassName = ({ size, variant }) => cn(BUTTON_BASE_CLASS, BUTTON_SIZE_CLASS_NAMES[size], BUTTON_VARIANT_CLASS_NAMES[variant], size === "inline" && variant === "link" && "underline", FACE_UNAVAILABLE_CLASS);
|
|
24
|
+
/** A button's face: its box, colours and content, disabled. */
|
|
25
|
+
const ButtonFace = ({ children, className, layout, size, variant }) => /* @__PURE__ */ jsx("span", {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
className: cn(buttonFaceClassName({
|
|
28
|
+
size,
|
|
29
|
+
variant
|
|
30
|
+
}), layout === void 0 ? void 0 : BUTTON_LAYOUT_CLASS_NAMES[layout], className),
|
|
31
|
+
"data-slot": "button-face",
|
|
32
|
+
children
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* A bar on the line of text that waits on data (a chip's current choice, a
|
|
36
|
+
* picker's selection, a message's line): one line box of the surrounding
|
|
37
|
+
* text, so the text that replaces it keeps the line's height.
|
|
38
|
+
*/
|
|
39
|
+
const FaceLabelPending = ({ className = "w-16" }) => /* @__PURE__ */ jsx("span", {
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: "inline-flex h-[1lh] items-center align-top",
|
|
42
|
+
"data-slot": "face-label-skeleton",
|
|
43
|
+
children: /* @__PURE__ */ jsx(InlineSkeleton, { className: cn("h-[0.75em]", className) })
|
|
44
|
+
});
|
|
45
|
+
/** A text field's face: its box and the placeholder. */
|
|
46
|
+
const InputFace = ({ children, className, fieldClassName, icon, size = CONTROL_SIZE.default }) => /* @__PURE__ */ jsxs("span", {
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
className: cn(INPUT_CONTROL_CLASS_NAME, "items-center", FACE_UNAVAILABLE_CLASS, className),
|
|
49
|
+
"data-slot": "input-face",
|
|
50
|
+
children: [icon !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
51
|
+
className: "text-muted-foreground pointer-events-none absolute inset-y-0 start-2.5 z-1 flex items-center opacity-80 [&_svg]:size-3.5",
|
|
52
|
+
children: icon
|
|
53
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: cn(INPUT_ELEMENT_CLASS_NAME, INPUT_SIZE_CLASS_NAMES[size], "text-foreground-placeholder flex items-center overflow-hidden whitespace-nowrap", icon !== void 0 && "ps-8", fieldClassName),
|
|
55
|
+
children
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
/** A select trigger's face: its box, the chosen value and the chevrons. */
|
|
59
|
+
const SelectTriggerFace = ({ children, className, size = CONTROL_SIZE.default }) => /* @__PURE__ */ jsxs("span", {
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
className: cn(FIELD_TRIGGER_CLASS_NAME, SELECT_TRIGGER_SIZE_CLASS_NAMES[size], FACE_UNAVAILABLE_CLASS, className),
|
|
62
|
+
"data-slot": "select-trigger-face",
|
|
63
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: SELECT_VALUE_CLASS_NAME,
|
|
65
|
+
children
|
|
66
|
+
}), /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: SELECT_TRIGGER_ICON_CLASS_NAME }) })]
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* A segmented icon toggle's face (./segmented-icon-toggle.tsx): the tray and
|
|
70
|
+
* its icon items, the chosen one raised as the toggle raises it.
|
|
71
|
+
*/
|
|
72
|
+
const SegmentedIconToggleFace = ({ options, size = "compact", value }) => /* @__PURE__ */ jsx("span", {
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: cn(TOGGLE_GROUP_CLASS_NAME, segmentedIconToggleClassName(size), FACE_UNAVAILABLE_CLASS),
|
|
75
|
+
"data-slot": "segmented-icon-toggle-face",
|
|
76
|
+
children: options.map((option) => {
|
|
77
|
+
const Icon = option.icon;
|
|
78
|
+
return /* @__PURE__ */ jsx("span", {
|
|
79
|
+
className: cn(BUTTON_BASE_CLASS, BUTTON_FACE_SIZE_CLASS_NAMES["icon-xs"], BUTTON_VARIANT_CLASS_NAMES.muted, TOGGLE_GROUP_ITEM_CLASS_NAME, segmentedIconToggleItemClassName(size)),
|
|
80
|
+
"data-pressed": option.value === value ? "" : void 0,
|
|
81
|
+
children: /* @__PURE__ */ jsx(Icon, { className: SEGMENTED_ICON_TOGGLE_ICON_CLASS_NAME })
|
|
82
|
+
}, option.value);
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* The face of a picker's trigger inside a form (a select, a combobox with
|
|
87
|
+
* `variant="field"`): the field box, the current choice, and the up-down
|
|
88
|
+
* chevron at the end.
|
|
89
|
+
*/
|
|
90
|
+
const FieldTriggerFace = ({ children, className }) => /* @__PURE__ */ jsxs("span", {
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
className: cn(FIELD_TRIGGER_CLASS_NAME, FACE_UNAVAILABLE_CLASS, className),
|
|
93
|
+
"data-slot": "field-trigger-face",
|
|
94
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
95
|
+
className: "flex min-w-0 flex-1 items-center overflow-hidden whitespace-nowrap",
|
|
96
|
+
children
|
|
97
|
+
}), /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "-me-1 size-4.5 opacity-80 sm:size-4" })]
|
|
98
|
+
});
|
|
99
|
+
/** A checkbox's face: its box, unticked (the value waits on data). */
|
|
100
|
+
const CheckboxFace = ({ className }) => /* @__PURE__ */ jsx("span", {
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
className: cn(CHECKBOX_CLASS_NAME, FACE_UNAVAILABLE_CLASS, className),
|
|
103
|
+
"data-slot": "checkbox-face"
|
|
104
|
+
});
|
|
105
|
+
/** A switch's face: its track, off (the value waits on data). */
|
|
106
|
+
const SwitchFace = ({ className, size = "default" }) => /* @__PURE__ */ jsx("span", {
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
className: cn(SWITCH_ROOT_CLASS_NAME, SWITCH_ROOT_SIZE_CLASS_NAME[size], "bg-input", FACE_UNAVAILABLE_CLASS, className),
|
|
109
|
+
"data-slot": "switch-face"
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* A field's caption, as `Label` draws it (its `default` variant), for a
|
|
113
|
+
* label whose text a pending view renders itself (a bar until the app's
|
|
114
|
+
* messages are there).
|
|
115
|
+
*/
|
|
116
|
+
const LabelFace = ({ children, className }) => /* @__PURE__ */ jsx("span", {
|
|
117
|
+
className: cn(LABEL_VARIANT_CLASS_NAME.default, className),
|
|
118
|
+
"data-slot": "label-face",
|
|
119
|
+
children
|
|
120
|
+
});
|
|
121
|
+
const FIELD_FACE_LAYOUT_CLASS_NAMES = {
|
|
122
|
+
stack: "",
|
|
123
|
+
inline: "flex-row items-center"
|
|
124
|
+
};
|
|
125
|
+
const FIELD_FACE_DENSITY_CLASS_NAMES = {
|
|
126
|
+
default: "",
|
|
127
|
+
snug: "gap-1"
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* A form field's face, as `Field` draws it: the caption, the control's face
|
|
131
|
+
* and the quiet lines a pending view puts in, in the field's own box.
|
|
132
|
+
*/
|
|
133
|
+
const FieldFace = ({ children, className, density = "default", layout = "stack" }) => /* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: cn(FIELD_CLASS_NAME, FIELD_FACE_LAYOUT_CLASS_NAMES[layout], FIELD_FACE_DENSITY_CLASS_NAMES[density], className),
|
|
135
|
+
"data-slot": "field-face",
|
|
136
|
+
children
|
|
137
|
+
});
|
|
138
|
+
/** A field's quiet line, as `FieldDescription` draws it. */
|
|
139
|
+
const FieldDescriptionFace = ({ children, className }) => /* @__PURE__ */ jsx("p", {
|
|
140
|
+
className: cn(FIELD_DESCRIPTION_CLASS_NAME, className),
|
|
141
|
+
"data-slot": "field-description-face",
|
|
142
|
+
children
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* A `default` tab strip's face: the well, each tab's box and label, and the
|
|
146
|
+
* raised chip under the tab that opens first.
|
|
147
|
+
*/
|
|
148
|
+
const TabsFace = ({ activeIndex = 0, tabs }) => /* @__PURE__ */ jsx("span", {
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
className: cn(TABS_LIST_BASE_CLASS, TABS_LIST_DEFAULT_CLASS, "pointer-events-none overflow-hidden"),
|
|
151
|
+
"data-slot": "tabs-face",
|
|
152
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ jsxs("span", {
|
|
153
|
+
className: cn(TABS_TAB_CLASS, index === activeIndex && "text-foreground"),
|
|
154
|
+
children: [index === activeIndex && /* @__PURE__ */ jsx("span", { className: cn("absolute -inset-px", "bg-background dark:bg-input -z-1 rounded-md shadow-sm/5") }), tab.label]
|
|
155
|
+
}, tab.key))
|
|
156
|
+
});
|
|
157
|
+
/** The quiet chrome around both halves. */
|
|
158
|
+
const SPLIT_BUTTON_ROOT_CLASS = "group/split hover:border-border focus-within:border-border has-[[data-popup-open]]:border-border inline-flex shrink-0 items-center rounded-lg border border-transparent p-0.5";
|
|
159
|
+
/** The primary half, over the `sm` ghost button it is built on. */
|
|
160
|
+
const SPLIT_BUTTON_PRIMARY_CLASS = {
|
|
161
|
+
md: "active:bg-accent/80 rounded-md [&_svg]:mx-0 [&_svg]:size-3.5 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3.5 h-8 ps-2 pe-0.5 sm:h-8 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
162
|
+
sm: "active:bg-accent/80 rounded-md [&_svg]:mx-0 [&_svg]:size-3.5 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3.5 h-7 ps-1.5 pe-0.5 sm:h-7 pointer-coarse:min-h-11 pointer-coarse:min-w-11"
|
|
163
|
+
};
|
|
164
|
+
/** The chevron half, over the `sm` ghost button it is built on. */
|
|
165
|
+
const SPLIT_BUTTON_TRIGGER_CLASS = {
|
|
166
|
+
md: "group-hover/split:bg-muted group-focus-within/split:bg-muted hover:bg-accent active:bg-accent/80 data-popup-open:bg-accent rounded-md [&_svg]:mx-0 h-8 w-4 px-0 sm:h-8 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
167
|
+
sm: "group-hover/split:bg-muted group-focus-within/split:bg-muted hover:bg-accent active:bg-accent/80 data-popup-open:bg-accent rounded-md [&_svg]:mx-0 h-7 w-3.5 px-0 sm:h-7 pointer-coarse:min-h-11 pointer-coarse:min-w-11"
|
|
168
|
+
};
|
|
169
|
+
/** The chevron that opens the secondary surface. */
|
|
170
|
+
const SplitButtonChevron = () => /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
171
|
+
"aria-hidden": "true",
|
|
172
|
+
className: "size-[0.65625rem]",
|
|
173
|
+
strokeWidth: 1.5
|
|
174
|
+
});
|
|
175
|
+
/** A split button's face: both halves, the primary glyph, the chevron. */
|
|
176
|
+
const SplitButtonFace = ({ children, size = "md" }) => /* @__PURE__ */ jsxs("span", {
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
className: cn(SPLIT_BUTTON_ROOT_CLASS, "pointer-events-none"),
|
|
179
|
+
"data-slot": "split-button-face",
|
|
180
|
+
children: [/* @__PURE__ */ jsx(ButtonFace, {
|
|
181
|
+
className: SPLIT_BUTTON_PRIMARY_CLASS[size],
|
|
182
|
+
size: "sm",
|
|
183
|
+
variant: "ghost",
|
|
184
|
+
children
|
|
185
|
+
}), /* @__PURE__ */ jsx(ButtonFace, {
|
|
186
|
+
className: SPLIT_BUTTON_TRIGGER_CLASS[size],
|
|
187
|
+
size: "sm",
|
|
188
|
+
variant: "ghost",
|
|
189
|
+
children: /* @__PURE__ */ jsx(SplitButtonChevron, {})
|
|
190
|
+
})]
|
|
191
|
+
});
|
|
192
|
+
export { ButtonFace, CheckboxFace, FaceLabelPending, FieldDescriptionFace, FieldFace, FieldTriggerFace, InputFace, LabelFace, SPLIT_BUTTON_PRIMARY_CLASS, SPLIT_BUTTON_ROOT_CLASS, SPLIT_BUTTON_TRIGGER_CLASS, SegmentedIconToggleFace, SelectTriggerFace, SplitButtonChevron, SplitButtonFace, SwitchFace, TabsFace, buttonFaceClassName };
|
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
export type CourtBadgeWeight = "solid" | "tinted" | "outline" | "dashed";
|
|
11
11
|
/**
|
|
12
12
|
* `default` stands on its own beside a court's name; `inline` sits inside a
|
|
13
|
-
* line of small text (a list row's meta line) without making it taller
|
|
13
|
+
* line of small text (a list row's meta line) without making it taller;
|
|
14
|
+
* `prose` sits inside running text (an answer's sentence), where it takes the
|
|
15
|
+
* text's own face instead of the monospaced one.
|
|
14
16
|
*/
|
|
15
|
-
export type CourtBadgeSize = "default" | "inline";
|
|
17
|
+
export type CourtBadgeSize = "default" | "inline" | "prose";
|
|
16
18
|
type CourtBadgeProps = {
|
|
17
19
|
/** The court's own abbreviation, in the language its name is in. */
|
|
18
20
|
abbreviation: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
// src/components/court-badge.tsx
|
|
4
|
-
const COURT_BADGE_BASE_CLASS = "inline-flex shrink-0 items-center rounded-sm border font-
|
|
4
|
+
const COURT_BADGE_BASE_CLASS = "inline-flex shrink-0 items-center rounded-sm border font-semibold whitespace-nowrap";
|
|
5
|
+
const COLUMN_FACE_CLASS = "font-mono tracking-wide";
|
|
5
6
|
/**
|
|
6
7
|
* The line box runs a third taller than the type, because these capitals
|
|
7
8
|
* carry diacritics (Ú, Ř, Š) whose ink rises above cap height; a tighter box
|
|
@@ -9,8 +10,9 @@ const COURT_BADGE_BASE_CLASS = "inline-flex shrink-0 items-center rounded-sm bor
|
|
|
9
10
|
* smaller size and drops the padding, so the chip fits a 16px text line.
|
|
10
11
|
*/
|
|
11
12
|
const SIZE_CLASS = {
|
|
12
|
-
default: "px-1 py-0.5 text-xs leading-4",
|
|
13
|
-
inline: "px-0.5
|
|
13
|
+
default: cn(COLUMN_FACE_CLASS, "px-1 py-0.5 text-xs leading-4"),
|
|
14
|
+
inline: cn(COLUMN_FACE_CLASS, "text-3xs px-0.5 leading-3.5"),
|
|
15
|
+
prose: "px-1 text-xs leading-4 tabular-nums"
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* Every weight keeps a border, because `--muted` is a 4% tint: a borderless
|
|
@@ -25,9 +25,14 @@ type DetailsLabelWidth = "auto" | "sm" | "md" | "lg";
|
|
|
25
25
|
type DetailsGridProps = React.ComponentProps<"dl"> & {
|
|
26
26
|
labelWidth?: DetailsLabelWidth;
|
|
27
27
|
orientation?: DetailsOrientation;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
} & ({
|
|
29
|
+
variant?: "sheet";
|
|
30
|
+
density?: "default" | "compact";
|
|
31
|
+
} | {
|
|
32
|
+
variant: "list";
|
|
33
|
+
density?: never;
|
|
34
|
+
});
|
|
35
|
+
declare const DetailsGrid: ({ className, density, labelWidth, orientation, variant, ...props }: DetailsGridProps) => React.JSX.Element;
|
|
31
36
|
type DetailsItemProps = React.ComponentProps<"div"> & {
|
|
32
37
|
label: React.ReactNode;
|
|
33
38
|
/** `wide` spans every pair column of a `sheet`. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { rendersNothing } from "../lib/renders-nothing.js";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { DetailsListFace, DetailsListItemFace } from "./details-list-face.js";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { createContext, useContext } from "react";
|
|
5
6
|
// src/components/details-grid.tsx
|
|
@@ -10,12 +11,10 @@ const DetailsShapeContext = createContext({
|
|
|
10
11
|
});
|
|
11
12
|
const LIST_CLASS_NAME = {
|
|
12
13
|
auto: "flex min-w-0 flex-col gap-2 text-sm @min-[24rem]:grid @min-[24rem]:items-center @min-[24rem]:gap-x-4 @min-[24rem]:gap-y-1",
|
|
13
|
-
horizontal: "grid items-center gap-x-4 gap-y-1 text-sm",
|
|
14
14
|
vertical: "flex min-w-0 flex-col gap-2 text-sm"
|
|
15
15
|
};
|
|
16
16
|
/** The list's label and value tracks, per label width. */
|
|
17
17
|
const LIST_COLUMNS_CLASS_NAME = {
|
|
18
|
-
auto: "grid-cols-[auto_minmax(0,1fr)]",
|
|
19
18
|
lg: "grid-cols-[10rem_minmax(0,1fr)]",
|
|
20
19
|
md: "grid-cols-[7rem_minmax(0,1fr)]",
|
|
21
20
|
sm: "grid-cols-[5rem_minmax(0,1fr)]"
|
|
@@ -43,7 +42,6 @@ const SHEET_AUTO_ITEM_COLUMNS_CLASS_NAME = {
|
|
|
43
42
|
const ITEM_CLASS_NAME = {
|
|
44
43
|
list: {
|
|
45
44
|
auto: "flex min-w-0 flex-col gap-0.5 @min-[24rem]:col-span-full @min-[24rem]:grid @min-[24rem]:grid-cols-subgrid @min-[24rem]:items-center",
|
|
46
|
-
horizontal: "col-span-full grid grid-cols-subgrid items-center",
|
|
47
45
|
vertical: "flex min-w-0 flex-col gap-2"
|
|
48
46
|
},
|
|
49
47
|
sheet: {
|
|
@@ -55,7 +53,6 @@ const ITEM_CLASS_NAME = {
|
|
|
55
53
|
const LABEL_CLASS_NAME = {
|
|
56
54
|
list: {
|
|
57
55
|
auto: "text-muted-foreground min-w-0",
|
|
58
|
-
horizontal: "text-muted-foreground min-w-0",
|
|
59
56
|
vertical: "font-medium"
|
|
60
57
|
},
|
|
61
58
|
sheet: {
|
|
@@ -68,15 +65,22 @@ const VALUE_CLASS_NAME = {
|
|
|
68
65
|
list: "min-w-0 wrap-anywhere",
|
|
69
66
|
sheet: "text-foreground-strong-muted min-w-0 wrap-anywhere"
|
|
70
67
|
};
|
|
71
|
-
const DetailsGrid = ({ className, labelWidth, orientation = "horizontal", variant = "sheet", ...props }) => {
|
|
68
|
+
const DetailsGrid = ({ className, density, labelWidth, orientation = "horizontal", variant = "sheet", ...props }) => {
|
|
72
69
|
const shape = {
|
|
73
70
|
labelWidth: labelWidth ?? (variant === "list" ? "auto" : "md"),
|
|
74
71
|
orientation,
|
|
75
72
|
variant
|
|
76
73
|
};
|
|
77
74
|
if (variant === "list") {
|
|
75
|
+
if (orientation === "horizontal") return /* @__PURE__ */ jsx(DetailsShapeContext.Provider, {
|
|
76
|
+
value: shape,
|
|
77
|
+
children: /* @__PURE__ */ jsx(DetailsListFace, {
|
|
78
|
+
className: cn(shape.labelWidth === "auto" ? void 0 : LIST_COLUMNS_CLASS_NAME[shape.labelWidth], className),
|
|
79
|
+
...props
|
|
80
|
+
})
|
|
81
|
+
});
|
|
78
82
|
const list = /* @__PURE__ */ jsx("dl", {
|
|
79
|
-
className: cn(LIST_CLASS_NAME[orientation], orientation === "
|
|
83
|
+
className: cn(LIST_CLASS_NAME[orientation], orientation === "auto" && LIST_AUTO_COLUMNS_CLASS_NAME[shape.labelWidth], className),
|
|
80
84
|
"data-orientation": orientation,
|
|
81
85
|
"data-slot": "details-grid",
|
|
82
86
|
"data-variant": variant,
|
|
@@ -97,7 +101,7 @@ const DetailsGrid = ({ className, labelWidth, orientation = "horizontal", varian
|
|
|
97
101
|
className: "@container min-w-0 [contain-intrinsic-inline-size:20rem]",
|
|
98
102
|
"data-slot": "details-grid-container",
|
|
99
103
|
children: /* @__PURE__ */ jsx("dl", {
|
|
100
|
-
className: cn("grid grid-cols-[repeat(auto-fit,minmax(min(100%,20rem),1fr))] gap-x-6
|
|
104
|
+
className: cn("grid grid-cols-[repeat(auto-fit,minmax(min(100%,20rem),1fr))] gap-x-6 font-sans @min-[64rem]:grid-cols-3", density === "compact" ? "gap-y-1.5" : "gap-y-2", className),
|
|
101
105
|
"data-slot": "details-grid",
|
|
102
106
|
...props
|
|
103
107
|
})
|
|
@@ -106,21 +110,30 @@ const DetailsGrid = ({ className, labelWidth, orientation = "horizontal", varian
|
|
|
106
110
|
};
|
|
107
111
|
const DetailsItem = ({ label, children, span, className, ...props }) => {
|
|
108
112
|
const { labelWidth, orientation, variant } = useContext(DetailsShapeContext);
|
|
113
|
+
const value = isEmptyValue(children) ? /* @__PURE__ */ jsx("span", {
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
className: "text-foreground-disabled",
|
|
116
|
+
"data-slot": "details-empty",
|
|
117
|
+
children: "—"
|
|
118
|
+
}) : children;
|
|
119
|
+
if (variant === "list" && orientation === "horizontal") return /* @__PURE__ */ jsx(DetailsListItemFace, {
|
|
120
|
+
label,
|
|
121
|
+
className,
|
|
122
|
+
...props,
|
|
123
|
+
children: value
|
|
124
|
+
});
|
|
125
|
+
const itemClassName = variant === "list" && orientation !== "horizontal" ? ITEM_CLASS_NAME.list[orientation] : ITEM_CLASS_NAME.sheet[orientation];
|
|
126
|
+
const labelClassName = variant === "list" && orientation !== "horizontal" ? LABEL_CLASS_NAME.list[orientation] : LABEL_CLASS_NAME.sheet[orientation];
|
|
109
127
|
return /* @__PURE__ */ jsxs("div", {
|
|
110
|
-
className: cn(
|
|
128
|
+
className: cn(itemClassName, variant === "sheet" && orientation === "horizontal" && SHEET_ITEM_COLUMNS_CLASS_NAME[labelWidth], variant === "sheet" && orientation === "auto" && SHEET_AUTO_ITEM_COLUMNS_CLASS_NAME[labelWidth], variant === "sheet" && span === "wide" && "col-span-full", className),
|
|
111
129
|
"data-slot": "details-item",
|
|
112
130
|
...props,
|
|
113
131
|
children: [/* @__PURE__ */ jsx("dt", {
|
|
114
|
-
className:
|
|
132
|
+
className: labelClassName,
|
|
115
133
|
children: label
|
|
116
134
|
}), /* @__PURE__ */ jsx("dd", {
|
|
117
135
|
className: VALUE_CLASS_NAME[variant],
|
|
118
|
-
children:
|
|
119
|
-
"aria-hidden": "true",
|
|
120
|
-
className: "text-foreground-disabled",
|
|
121
|
-
"data-slot": "details-empty",
|
|
122
|
-
children: "—"
|
|
123
|
-
}) : children
|
|
136
|
+
children: value
|
|
124
137
|
})]
|
|
125
138
|
});
|
|
126
139
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
/** The fixed horizontal term list, independent of layout context. */
|
|
3
|
+
export declare const DetailsListFace: ({ className, ...props }: ComponentProps<"dl">) => import("react").JSX.Element;
|
|
4
|
+
/** The subgrid row aligns each label with the other labels in its list. */
|
|
5
|
+
export declare const DetailsListItemFace: ({ label, children, className, ...props }: ComponentProps<"div"> & {
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
// src/components/details-list-face.tsx
|
|
4
|
+
/** The fixed horizontal term list, independent of layout context. */
|
|
5
|
+
const DetailsListFace = ({ className, ...props }) => /* @__PURE__ */ jsx("dl", {
|
|
6
|
+
className: cn("grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-4 gap-y-1 text-sm", className),
|
|
7
|
+
"data-orientation": "horizontal",
|
|
8
|
+
"data-slot": "details-grid",
|
|
9
|
+
"data-variant": "list",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
/** The subgrid row aligns each label with the other labels in its list. */
|
|
13
|
+
const DetailsListItemFace = ({ label, children, className, ...props }) => /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
className: cn("col-span-full grid grid-cols-subgrid items-center", className),
|
|
15
|
+
"data-slot": "details-item",
|
|
16
|
+
...props,
|
|
17
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
18
|
+
className: "text-muted-foreground min-w-0",
|
|
19
|
+
children: label
|
|
20
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
21
|
+
className: "min-w-0 wrap-anywhere",
|
|
22
|
+
children
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
export { DetailsListFace, DetailsListItemFace };
|
|
@@ -18,6 +18,155 @@ export type DocumentMarkArtwork = {
|
|
|
18
18
|
/** A paint reference to one of the mark's gradients. */
|
|
19
19
|
export declare const GRADIENT_REFERENCE: RegExp;
|
|
20
20
|
export declare const DOCUMENT_MARKS: {
|
|
21
|
+
readonly ofd: {
|
|
22
|
+
viewBox: string;
|
|
23
|
+
gradients: never[];
|
|
24
|
+
shapes: ({
|
|
25
|
+
tag: "path";
|
|
26
|
+
attrs: {
|
|
27
|
+
d: string;
|
|
28
|
+
fill: string;
|
|
29
|
+
stroke?: never;
|
|
30
|
+
strokeWidth?: never;
|
|
31
|
+
strokeLinecap?: never;
|
|
32
|
+
strokeLinejoin?: never;
|
|
33
|
+
};
|
|
34
|
+
} | {
|
|
35
|
+
tag: "path";
|
|
36
|
+
attrs: {
|
|
37
|
+
d: string;
|
|
38
|
+
fill: string;
|
|
39
|
+
stroke: string;
|
|
40
|
+
strokeWidth: string;
|
|
41
|
+
strokeLinecap: string;
|
|
42
|
+
strokeLinejoin: string;
|
|
43
|
+
};
|
|
44
|
+
})[];
|
|
45
|
+
};
|
|
46
|
+
readonly uyap: {
|
|
47
|
+
viewBox: string;
|
|
48
|
+
gradients: never[];
|
|
49
|
+
shapes: ({
|
|
50
|
+
tag: "path";
|
|
51
|
+
attrs: {
|
|
52
|
+
d: string;
|
|
53
|
+
fill: string;
|
|
54
|
+
stroke?: never;
|
|
55
|
+
strokeWidth?: never;
|
|
56
|
+
strokeLinecap?: never;
|
|
57
|
+
strokeLinejoin?: never;
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
tag: "path";
|
|
61
|
+
attrs: {
|
|
62
|
+
d: string;
|
|
63
|
+
fill: string;
|
|
64
|
+
stroke: string;
|
|
65
|
+
strokeWidth: string;
|
|
66
|
+
strokeLinecap: string;
|
|
67
|
+
strokeLinejoin: string;
|
|
68
|
+
};
|
|
69
|
+
})[];
|
|
70
|
+
};
|
|
71
|
+
readonly asicE: {
|
|
72
|
+
viewBox: string;
|
|
73
|
+
gradients: never[];
|
|
74
|
+
shapes: ({
|
|
75
|
+
tag: "path";
|
|
76
|
+
attrs: {
|
|
77
|
+
d: string;
|
|
78
|
+
fill: string;
|
|
79
|
+
stroke?: never;
|
|
80
|
+
strokeWidth?: never;
|
|
81
|
+
strokeLinecap?: never;
|
|
82
|
+
strokeLinejoin?: never;
|
|
83
|
+
};
|
|
84
|
+
} | {
|
|
85
|
+
tag: "path";
|
|
86
|
+
attrs: {
|
|
87
|
+
d: string;
|
|
88
|
+
fill: string;
|
|
89
|
+
stroke: string;
|
|
90
|
+
strokeWidth: string;
|
|
91
|
+
strokeLinecap: string;
|
|
92
|
+
strokeLinejoin: string;
|
|
93
|
+
};
|
|
94
|
+
})[];
|
|
95
|
+
};
|
|
96
|
+
readonly asicS: {
|
|
97
|
+
viewBox: string;
|
|
98
|
+
gradients: never[];
|
|
99
|
+
shapes: ({
|
|
100
|
+
tag: "path";
|
|
101
|
+
attrs: {
|
|
102
|
+
d: string;
|
|
103
|
+
fill: string;
|
|
104
|
+
stroke?: never;
|
|
105
|
+
strokeWidth?: never;
|
|
106
|
+
strokeLinecap?: never;
|
|
107
|
+
strokeLinejoin?: never;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
tag: "path";
|
|
111
|
+
attrs: {
|
|
112
|
+
d: string;
|
|
113
|
+
fill: string;
|
|
114
|
+
stroke: string;
|
|
115
|
+
strokeWidth: string;
|
|
116
|
+
strokeLinecap: string;
|
|
117
|
+
strokeLinejoin: string;
|
|
118
|
+
};
|
|
119
|
+
})[];
|
|
120
|
+
};
|
|
121
|
+
readonly cades: {
|
|
122
|
+
viewBox: string;
|
|
123
|
+
gradients: never[];
|
|
124
|
+
shapes: ({
|
|
125
|
+
tag: "path";
|
|
126
|
+
attrs: {
|
|
127
|
+
d: string;
|
|
128
|
+
fill: string;
|
|
129
|
+
stroke?: never;
|
|
130
|
+
strokeWidth?: never;
|
|
131
|
+
strokeLinecap?: never;
|
|
132
|
+
strokeLinejoin?: never;
|
|
133
|
+
};
|
|
134
|
+
} | {
|
|
135
|
+
tag: "path";
|
|
136
|
+
attrs: {
|
|
137
|
+
d: string;
|
|
138
|
+
fill: string;
|
|
139
|
+
stroke: string;
|
|
140
|
+
strokeWidth: string;
|
|
141
|
+
strokeLinecap: string;
|
|
142
|
+
strokeLinejoin: string;
|
|
143
|
+
};
|
|
144
|
+
})[];
|
|
145
|
+
};
|
|
146
|
+
readonly dataBox: {
|
|
147
|
+
readonly viewBox: "0 0 24 24";
|
|
148
|
+
readonly gradients: readonly [];
|
|
149
|
+
readonly shapes: readonly [{
|
|
150
|
+
readonly tag: "rect";
|
|
151
|
+
readonly attrs: {
|
|
152
|
+
readonly x: "1";
|
|
153
|
+
readonly y: "3";
|
|
154
|
+
readonly width: "22";
|
|
155
|
+
readonly height: "18";
|
|
156
|
+
readonly rx: "2";
|
|
157
|
+
readonly fill: "#245c89";
|
|
158
|
+
};
|
|
159
|
+
}, {
|
|
160
|
+
readonly tag: "path";
|
|
161
|
+
readonly attrs: {
|
|
162
|
+
readonly d: "m2 5 9 6a2 2 0 0 0 2 0l9-6M5 14h3l-3 4h3m2 0v-4h3m-3 2h2m3-2h3v4h-3z";
|
|
163
|
+
readonly fill: "none";
|
|
164
|
+
readonly stroke: "#fff";
|
|
165
|
+
readonly strokeWidth: "1.3";
|
|
166
|
+
readonly strokeLinejoin: "round";
|
|
167
|
+
};
|
|
168
|
+
}];
|
|
169
|
+
};
|
|
21
170
|
readonly pdf: {
|
|
22
171
|
readonly viewBox: "0 0 75.320129 92.604164";
|
|
23
172
|
readonly gradients: readonly [];
|
|
@@ -336,7 +336,69 @@ const openDocumentMark = ({ badge, letter, arrows, layers }) => {
|
|
|
336
336
|
]
|
|
337
337
|
};
|
|
338
338
|
};
|
|
339
|
+
const legalDocumentMark = (details) => ({
|
|
340
|
+
viewBox: "0 0 24 24",
|
|
341
|
+
gradients: [],
|
|
342
|
+
shapes: [
|
|
343
|
+
{
|
|
344
|
+
tag: "path",
|
|
345
|
+
attrs: {
|
|
346
|
+
d: "M5 1h9l5 5v15a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2z",
|
|
347
|
+
fill: "#566275"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
tag: "path",
|
|
352
|
+
attrs: {
|
|
353
|
+
d: "M14 1v5h5",
|
|
354
|
+
fill: "#c2c9d2"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
tag: "path",
|
|
359
|
+
attrs: {
|
|
360
|
+
d: details,
|
|
361
|
+
fill: "none",
|
|
362
|
+
stroke: "#fff",
|
|
363
|
+
strokeWidth: "1.4",
|
|
364
|
+
strokeLinecap: "round",
|
|
365
|
+
strokeLinejoin: "round"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
});
|
|
370
|
+
const signedDocumentMark = legalDocumentMark("M7 11h8m-8 3h5m1 4 2 2 4-5");
|
|
371
|
+
const structuredDocumentMark = legalDocumentMark("M7 11h8m-8 4h8m-8 4h5");
|
|
339
372
|
const DOCUMENT_MARKS = {
|
|
373
|
+
ofd: structuredDocumentMark,
|
|
374
|
+
uyap: structuredDocumentMark,
|
|
375
|
+
asicE: signedDocumentMark,
|
|
376
|
+
asicS: signedDocumentMark,
|
|
377
|
+
cades: signedDocumentMark,
|
|
378
|
+
dataBox: {
|
|
379
|
+
viewBox: "0 0 24 24",
|
|
380
|
+
gradients: [],
|
|
381
|
+
shapes: [{
|
|
382
|
+
tag: "rect",
|
|
383
|
+
attrs: {
|
|
384
|
+
x: "1",
|
|
385
|
+
y: "3",
|
|
386
|
+
width: "22",
|
|
387
|
+
height: "18",
|
|
388
|
+
rx: "2",
|
|
389
|
+
fill: "#245c89"
|
|
390
|
+
}
|
|
391
|
+
}, {
|
|
392
|
+
tag: "path",
|
|
393
|
+
attrs: {
|
|
394
|
+
d: "m2 5 9 6a2 2 0 0 0 2 0l9-6M5 14h3l-3 4h3m2 0v-4h3m-3 2h2m3-2h3v4h-3z",
|
|
395
|
+
fill: "none",
|
|
396
|
+
stroke: "#fff",
|
|
397
|
+
strokeWidth: "1.3",
|
|
398
|
+
strokeLinejoin: "round"
|
|
399
|
+
}
|
|
400
|
+
}]
|
|
401
|
+
},
|
|
340
402
|
pdf: {
|
|
341
403
|
viewBox: "0 0 75.320129 92.604164",
|
|
342
404
|
gradients: [],
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A field's column: its caption, its control and its quiet lines. */
|
|
2
|
+
export declare const FIELD_CLASS_NAME = "flex flex-col items-start gap-2";
|
|
3
|
+
/** A field's quiet line under its control. */
|
|
4
|
+
export declare const FIELD_DESCRIPTION_CLASS_NAME = "text-muted-foreground text-xs";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/components/field-classes.ts
|
|
2
|
+
/** A field's column: its caption, its control and its quiet lines. */
|
|
3
|
+
const FIELD_CLASS_NAME = "flex flex-col items-start gap-2";
|
|
4
|
+
/** A field's quiet line under its control. */
|
|
5
|
+
const FIELD_DESCRIPTION_CLASS_NAME = "text-muted-foreground text-xs";
|
|
6
|
+
export { FIELD_CLASS_NAME, FIELD_DESCRIPTION_CLASS_NAME };
|
package/dist/components/field.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { FIELD_CLASS_NAME, FIELD_DESCRIPTION_CLASS_NAME } from "./field-classes.js";
|
|
4
|
+
import { LABEL_VARIANT_CLASS_NAME } from "./label-classes.js";
|
|
3
5
|
import { jsx } from "react/jsx-runtime";
|
|
4
6
|
import { Field as Field$1 } from "@base-ui/react/field";
|
|
5
7
|
// src/components/field.tsx
|
|
6
8
|
const Field = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Root, {
|
|
7
|
-
className: cn(
|
|
9
|
+
className: cn(FIELD_CLASS_NAME, className),
|
|
8
10
|
"data-slot": "field",
|
|
9
11
|
...props
|
|
10
12
|
});
|
|
11
13
|
const FieldLabel = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Label, {
|
|
12
|
-
className: cn(
|
|
14
|
+
className: cn(LABEL_VARIANT_CLASS_NAME.default, className),
|
|
13
15
|
"data-slot": "field-label",
|
|
14
16
|
...props
|
|
15
17
|
});
|
|
@@ -19,7 +21,7 @@ const FieldItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Item,
|
|
|
19
21
|
...props
|
|
20
22
|
});
|
|
21
23
|
const FieldDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Description, {
|
|
22
|
-
className: cn(
|
|
24
|
+
className: cn(FIELD_DESCRIPTION_CLASS_NAME, className),
|
|
23
25
|
"data-slot": "field-description",
|
|
24
26
|
...props
|
|
25
27
|
});
|