@agentero/design-system 0.32.1 → 0.33.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/mcp/manifests/components.html +229 -61
- package/mcp/manifests/components.json +108 -2
- package/package.json +5 -1
- package/src/accordion/accordion.js +1 -1
- package/src/avatar/avatar.js +46 -41
- package/src/button/button.js +1 -1
- package/src/checkbox/checkbox.js +1 -1
- package/src/combobox/combobox.js +1 -1
- package/src/data-table/data-table.js +1 -1
- package/src/dropdown-menu/dropdown-menu.js +16 -22
- package/src/hover-card/hover-card.js +2 -2
- package/src/input-password/icons.d.ts +16 -0
- package/src/input-password/icons.js +23 -0
- package/src/input-password/index.d.ts +2 -0
- package/src/input-password/index.js +2 -0
- package/src/input-password/input-password.d.ts +103 -0
- package/src/input-password/input-password.js +57 -0
- package/src/progress/progress.js +1 -1
- package/src/switch/switch.js +1 -1
- package/src/table/table.js +1 -1
- package/src/tabs/tabs.js +2 -2
- package/src/tooltip/tooltip.js +4 -4
- package/theme/base.css +24 -18
|
@@ -1225,7 +1225,7 @@
|
|
|
1225
1225
|
"summary": "All avatar shapes with a profile image"
|
|
1226
1226
|
}
|
|
1227
1227
|
],
|
|
1228
|
-
"import": "import { Avatar } from \"@agentero/design-system\";"
|
|
1228
|
+
"import": "import { Avatar, Button } from \"@agentero/design-system\";"
|
|
1229
1229
|
},
|
|
1230
1230
|
"components-button": {
|
|
1231
1231
|
"id": "components-button",
|
|
@@ -6624,6 +6624,112 @@
|
|
|
6624
6624
|
],
|
|
6625
6625
|
"import": "import {\n Button,\n Divider,\n DropdownMenu,\n Field,\n FieldText,\n IconCancel,\n IconKeyboardArrowDown,\n IconSearch,\n Input,\n InputGroup,\n Label,\n Tag,\n} from \"@agentero/design-system\";"
|
|
6626
6626
|
},
|
|
6627
|
+
"components-inputpassword": {
|
|
6628
|
+
"id": "components-inputpassword",
|
|
6629
|
+
"name": "InputPassword",
|
|
6630
|
+
"path": "./src/input-password/input-password.stories.tsx",
|
|
6631
|
+
"jsDocTags": {
|
|
6632
|
+
"summary": [
|
|
6633
|
+
"Password input with a show/hide toggle inside the frame"
|
|
6634
|
+
],
|
|
6635
|
+
"dataAttribute": [
|
|
6636
|
+
"{string} data-slot - Always set to \"input-password\" on the frame"
|
|
6637
|
+
],
|
|
6638
|
+
"example": [
|
|
6639
|
+
"<FieldText required>\n <Label>Password</Label>\n <InputPassword name=\"password\" autoComplete=\"current-password\" />\n</FieldText>"
|
|
6640
|
+
]
|
|
6641
|
+
},
|
|
6642
|
+
"description": "InputPassword is a password field with a show/hide toggle at the end of its\nframe. It is an `Input` inside an `InputGroup`: `className` styles the\nframe and every other prop reaches the `<input>`, which takes its label,\nmessages and states from a surrounding `FieldText`. The toggle is not\nrendered while the input is disabled.",
|
|
6643
|
+
"summary": "Password input with a show/hide toggle inside the frame",
|
|
6644
|
+
"reactComponentMeta": {
|
|
6645
|
+
"displayName": "InputPassword",
|
|
6646
|
+
"exportName": "InputPassword",
|
|
6647
|
+
"filePath": "/home/runner/work/design-system/design-system/src/input-password/input-password.tsx",
|
|
6648
|
+
"description": "InputPassword is a password field with a show/hide toggle at the end of its\nframe. The value starts hidden; the toggle reveals it as plain text and\nhides it again. Its accessible name reads \"Show password\" or \"Hide\npassword\", depending on what the next press does. Pressing the toggle keeps\nfocus and the caret in the input. The toggle is not rendered while the input\nis disabled, whether `disabled` comes from the prop, from a surrounding\n`FieldText` or from a `<fieldset disabled>`.\n\nIt is an [Input](?path=/docs/components-input--docs) inside an\n[InputGroup](?path=/docs/components-inputgroup--docs) frame. `className`\nstyles the frame. Every other prop goes to the `<input>`: the `ref`, `id`,\n`name`, `value`, `onChange`, `aria-*` and every other standard attribute,\nsuch as `autoComplete`, `required` or `maxLength`. Only `type` is not\naccepted, because the toggle owns it. Inside a `FieldText` the input takes\nits label, messages and states from the field as a plain `Input` does. The\ninvalid state comes from `aria-invalid`, and the frame paints the\ndestructive border. Set `autoComplete` to `current-password` on sign-in and\n`new-password` when the user picks one, so password managers fill the right\nvalue.\n\nDo not use it for text that is not secret; use `Input` instead. A one-time\ncode is an `Input` with `autoComplete=\"one-time-code\"`, not a password.",
|
|
6649
|
+
"jsDocTags": {
|
|
6650
|
+
"summary": [
|
|
6651
|
+
"Password input with a show/hide toggle inside the frame"
|
|
6652
|
+
],
|
|
6653
|
+
"dataAttribute": [
|
|
6654
|
+
"{string} data-slot - Always set to \"input-password\" on the frame"
|
|
6655
|
+
],
|
|
6656
|
+
"example": [
|
|
6657
|
+
"<FieldText required>\n <Label>Password</Label>\n <InputPassword name=\"password\" autoComplete=\"current-password\" />\n</FieldText>"
|
|
6658
|
+
]
|
|
6659
|
+
},
|
|
6660
|
+
"props": {
|
|
6661
|
+
"size": {
|
|
6662
|
+
"name": "size",
|
|
6663
|
+
"required": false,
|
|
6664
|
+
"type": {
|
|
6665
|
+
"name": "enum",
|
|
6666
|
+
"raw": "\"sm\" | \"md\" | \"lg\"",
|
|
6667
|
+
"value": [
|
|
6668
|
+
{
|
|
6669
|
+
"value": "\"sm\""
|
|
6670
|
+
},
|
|
6671
|
+
{
|
|
6672
|
+
"value": "\"md\""
|
|
6673
|
+
},
|
|
6674
|
+
{
|
|
6675
|
+
"value": "\"lg\""
|
|
6676
|
+
}
|
|
6677
|
+
]
|
|
6678
|
+
},
|
|
6679
|
+
"description": "Control height. Defaults to `'md'`.\n- `sm` (32px) — dense layouts where vertical space is tight.\n- `md` (40px) — standard form density.\n- `lg` (48px) — low-density forms and larger touch targets. Also raises\n the text to `base` and the corner radius to `lg`.",
|
|
6680
|
+
"defaultValue": null,
|
|
6681
|
+
"parent": {
|
|
6682
|
+
"name": "InputProps",
|
|
6683
|
+
"fileName": "src/input/input.tsx"
|
|
6684
|
+
},
|
|
6685
|
+
"declarations": [
|
|
6686
|
+
{
|
|
6687
|
+
"name": "TypeLiteral",
|
|
6688
|
+
"fileName": "src/input/input.tsx"
|
|
6689
|
+
}
|
|
6690
|
+
]
|
|
6691
|
+
}
|
|
6692
|
+
}
|
|
6693
|
+
},
|
|
6694
|
+
"stories": [
|
|
6695
|
+
{
|
|
6696
|
+
"id": "components-inputpassword--default",
|
|
6697
|
+
"name": "Default",
|
|
6698
|
+
"snippet": "const Default = () => <InputPassword aria-label=\"Password\" autoComplete=\"current-password\" />;",
|
|
6699
|
+
"description": "The value starts hidden. The toggle shows it as plain text and hides it\nagain; pressing it leaves focus and the caret in the input.",
|
|
6700
|
+
"summary": "Hidden value with a toggle that reveals and hides it"
|
|
6701
|
+
},
|
|
6702
|
+
{
|
|
6703
|
+
"id": "components-inputpassword--disabled",
|
|
6704
|
+
"name": "Disabled",
|
|
6705
|
+
"snippet": "const Disabled = () => <div style={{ display: 'grid', gap: '1rem' }}>\n <InputPassword\n aria-label=\"Password\"\n autoComplete=\"current-password\"\n disabled\n defaultValue=\"hunter22\" />\n <fieldset disabled style={{ border: 0, margin: 0, padding: 0 }}>\n <InputPassword aria-label=\"New password\" autoComplete=\"new-password\" />\n </fieldset>\n</div>;",
|
|
6706
|
+
"description": "A disabled input has no toggle, whether `disabled` is set on the input\nitself or comes from a `<fieldset disabled>` around it.",
|
|
6707
|
+
"summary": "Disabled input with the toggle removed"
|
|
6708
|
+
},
|
|
6709
|
+
{
|
|
6710
|
+
"id": "components-inputpassword--invalid",
|
|
6711
|
+
"name": "Invalid",
|
|
6712
|
+
"snippet": "const Invalid = () => <div style={{ display: 'grid', gap: '1.5rem' }}>\n <InputPassword\n autoComplete=\"current-password\"\n aria-label=\"Valid password\"\n defaultValue=\"hunter22\" />\n <FieldText invalid>\n <Label>Password</Label>\n <InputPassword autoComplete=\"new-password\" defaultValue=\"hunter\" />\n <Field.Error errors={[{ message: 'Use at least 8 characters.' }]} />\n </FieldText>\n</div>;",
|
|
6713
|
+
"description": "`invalid` on the surrounding `FieldText` sets `aria-invalid` on the input,\nwhich paints the frame's destructive border, and `Field.Error` is announced\nwith the input.",
|
|
6714
|
+
"summary": "Invalid field driving the frame's destructive border"
|
|
6715
|
+
},
|
|
6716
|
+
{
|
|
6717
|
+
"id": "components-inputpassword--all-sizes",
|
|
6718
|
+
"name": "All Sizes",
|
|
6719
|
+
"snippet": "const AllSizes = () => <div style={{ display: 'grid', gap: '1rem' }}>\n <InputPassword autoComplete=\"current-password\" size=\"sm\" aria-label=\"Small\" />\n <InputPassword autoComplete=\"current-password\" size=\"md\" aria-label=\"Medium\" />\n <InputPassword autoComplete=\"current-password\" size=\"lg\" aria-label=\"Large\" />\n</div>;",
|
|
6720
|
+
"description": "The three sizes match Input's: the frame is 32, 40 or 48px tall. The toggle\ngrows with it (a 24px button with a 16px icon at `sm`, 32px with 20px at\n`md`, 32px with 24px at `lg`) and sits as far from the right edge as from\nthe top and bottom.",
|
|
6721
|
+
"summary": "The three sizes, with the toggle scaled and evenly inset"
|
|
6722
|
+
},
|
|
6723
|
+
{
|
|
6724
|
+
"id": "components-inputpassword--inside-field-text",
|
|
6725
|
+
"name": "Inside Field Text",
|
|
6726
|
+
"snippet": "const InsideFieldText = () => (\n <div style={{ display: 'grid', gap: '1.5rem' }}>\n <FieldText required>\n <Label>Password</Label>\n <InputPassword autoComplete=\"new-password\" />\n <Field.Description>At least 8 characters.</Field.Description>\n </FieldText>\n <FieldText disabled>\n <Label>Current password</Label>\n <InputPassword autoComplete=\"current-password\" defaultValue=\"hunter22\" />\n </FieldText>\n </div>\n);",
|
|
6727
|
+
"description": "Inside a `FieldText` the input takes its label, description and states from\nthe field through the frame. A disabled field removes the toggle too.",
|
|
6728
|
+
"summary": "Label and disabled state reaching the input through the frame"
|
|
6729
|
+
}
|
|
6730
|
+
],
|
|
6731
|
+
"import": "import { Field, FieldText, InputPassword, Label } from \"@agentero/design-system\";"
|
|
6732
|
+
},
|
|
6627
6733
|
"components-input": {
|
|
6628
6734
|
"id": "components-input",
|
|
6629
6735
|
"name": "Input",
|
|
@@ -9590,6 +9696,6 @@
|
|
|
9590
9696
|
},
|
|
9591
9697
|
"meta": {
|
|
9592
9698
|
"docgen": "react-component-meta",
|
|
9593
|
-
"durationMs":
|
|
9699
|
+
"durationMs": 4742
|
|
9594
9700
|
}
|
|
9595
9701
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -97,6 +97,10 @@
|
|
|
97
97
|
"types": "./src/input-group/index.d.ts",
|
|
98
98
|
"import": "./src/input-group/index.js"
|
|
99
99
|
},
|
|
100
|
+
"./input-password": {
|
|
101
|
+
"types": "./src/input-password/index.d.ts",
|
|
102
|
+
"import": "./src/input-password/index.js"
|
|
103
|
+
},
|
|
100
104
|
"./label": {
|
|
101
105
|
"types": "./src/label/index.d.ts",
|
|
102
106
|
"import": "./src/label/index.js"
|
|
@@ -35,7 +35,7 @@ var d = ({ className: r, children: s, asChild: c, ...l }) => /* @__PURE__ */ a(u
|
|
|
35
35
|
d.displayName = "Accordion.Trigger";
|
|
36
36
|
var f = ({ className: t, children: r, ...i }) => /* @__PURE__ */ a(n.Content, {
|
|
37
37
|
"data-slot": "accordion-content",
|
|
38
|
-
className: e("overflow-hidden px-4 text-sm", "motion-safe:data-[state=open]:animate-
|
|
38
|
+
className: e("overflow-hidden px-4 text-sm", "motion-safe:data-[state=open]:animate-accordion-down", "motion-safe:data-[state=closed]:animate-accordion-up", t),
|
|
39
39
|
...i,
|
|
40
40
|
children: /* @__PURE__ */ a("div", {
|
|
41
41
|
className: "pb-4",
|
package/src/avatar/avatar.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { tv as t } from "tailwind-variants";
|
|
4
|
-
import { createContext as n, use as r } from "react";
|
|
5
|
-
import { jsx as
|
|
6
|
-
import * as
|
|
4
|
+
import { createContext as n, use as r, useState as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import * as s from "@radix-ui/react-avatar";
|
|
7
7
|
//#region src/avatar/avatar.tsx
|
|
8
|
-
var
|
|
8
|
+
var c = t({
|
|
9
9
|
slots: {
|
|
10
10
|
root: [
|
|
11
11
|
"flex items-center justify-center align-middle",
|
|
@@ -17,7 +17,7 @@ var s = t({
|
|
|
17
17
|
"border-[var(--avatar-border-color,var(--color-border-default-base-primary))]",
|
|
18
18
|
"h-fit w-fit"
|
|
19
19
|
],
|
|
20
|
-
image: ["flex object-cover box-border h-full vertical-align-middle w-full"],
|
|
20
|
+
image: ["flex object-cover box-border h-full vertical-align-middle w-full", "data-loaded-late:transition-opacity data-loaded-late:duration-200 data-loaded-late:starting:opacity-0"],
|
|
21
21
|
fallback: ["uppercase", "[&_svg]:size-[1.5em] [&_svg]:fill-neutral-500"]
|
|
22
22
|
},
|
|
23
23
|
variants: {
|
|
@@ -126,58 +126,63 @@ var s = t({
|
|
|
126
126
|
variant: "circle",
|
|
127
127
|
type: "photo"
|
|
128
128
|
}
|
|
129
|
-
}),
|
|
130
|
-
let e = r(
|
|
129
|
+
}), l = n(null), u = () => {
|
|
130
|
+
let e = r(l);
|
|
131
131
|
if (!e) throw Error("useAvatar must be used within an AvatarProvider");
|
|
132
132
|
return e;
|
|
133
|
-
},
|
|
134
|
-
let
|
|
133
|
+
}, d = ({ size: t, variant: n, type: r, ...i }) => {
|
|
134
|
+
let o = c({
|
|
135
135
|
size: t,
|
|
136
136
|
variant: n,
|
|
137
137
|
type: r
|
|
138
138
|
});
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ a(l, {
|
|
140
140
|
value: {
|
|
141
141
|
size: t,
|
|
142
142
|
variant: n,
|
|
143
143
|
type: r,
|
|
144
|
-
slotsStyles:
|
|
144
|
+
slotsStyles: o
|
|
145
145
|
},
|
|
146
|
-
children: /* @__PURE__ */
|
|
147
|
-
...
|
|
148
|
-
className: e(
|
|
146
|
+
children: /* @__PURE__ */ a(s.Root, {
|
|
147
|
+
...i,
|
|
148
|
+
className: e(o.root(), i.className)
|
|
149
149
|
})
|
|
150
150
|
});
|
|
151
|
-
},
|
|
152
|
-
let { slotsStyles:
|
|
153
|
-
return /* @__PURE__ */
|
|
154
|
-
...
|
|
155
|
-
|
|
151
|
+
}, f = ({ onLoadingStatusChange: t, ...n }) => {
|
|
152
|
+
let { slotsStyles: r } = u(), [o, c] = i(!1);
|
|
153
|
+
return /* @__PURE__ */ a(s.Image, {
|
|
154
|
+
...n,
|
|
155
|
+
"data-loaded-late": o || void 0,
|
|
156
|
+
onLoadingStatusChange: (e) => {
|
|
157
|
+
e === "loading" && c(!0), t?.(e);
|
|
158
|
+
},
|
|
159
|
+
className: e(r.image(), n.className)
|
|
156
160
|
});
|
|
157
|
-
},
|
|
158
|
-
let { slotsStyles: n } =
|
|
159
|
-
return /* @__PURE__ */
|
|
161
|
+
}, p = (t) => {
|
|
162
|
+
let { slotsStyles: n } = u();
|
|
163
|
+
return /* @__PURE__ */ a(s.Fallback, {
|
|
160
164
|
...t,
|
|
161
165
|
className: e(n.fallback(), t.className)
|
|
162
166
|
});
|
|
163
|
-
},
|
|
164
|
-
let
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
...
|
|
167
|
-
ref:
|
|
168
|
-
size:
|
|
169
|
-
variant:
|
|
170
|
-
type:
|
|
167
|
+
}, m = ({ alt: e, src: t, fallback: n, colorize: r, size: s, variant: c, type: l, ref: u, ...m }) => {
|
|
168
|
+
let h = r ? _(r) : void 0, [g, v] = i(!1);
|
|
169
|
+
return /* @__PURE__ */ o(d, {
|
|
170
|
+
...m,
|
|
171
|
+
ref: u,
|
|
172
|
+
size: s,
|
|
173
|
+
variant: c,
|
|
174
|
+
type: l,
|
|
171
175
|
style: {
|
|
172
|
-
...
|
|
173
|
-
...
|
|
176
|
+
...h,
|
|
177
|
+
...m.style
|
|
174
178
|
},
|
|
175
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ a(f, {
|
|
176
180
|
alt: e,
|
|
177
|
-
src: t
|
|
178
|
-
|
|
181
|
+
src: t,
|
|
182
|
+
onLoadingStatusChange: (e) => v(e === "error")
|
|
183
|
+
}), (!t || g) && /* @__PURE__ */ a(p, { children: n })]
|
|
179
184
|
});
|
|
180
|
-
},
|
|
185
|
+
}, h = [
|
|
181
186
|
{
|
|
182
187
|
dark: "#434343",
|
|
183
188
|
light: "#e3e3e3"
|
|
@@ -214,15 +219,15 @@ var s = t({
|
|
|
214
219
|
dark: "#0f8a2a",
|
|
215
220
|
light: "#d1fada"
|
|
216
221
|
}
|
|
217
|
-
],
|
|
222
|
+
], g = (e) => {
|
|
218
223
|
let t = e.split("").reduce((e, t, n) => {
|
|
219
224
|
let r = 1;
|
|
220
225
|
for (let e = 0; e < n; e++) r *= 26;
|
|
221
226
|
return e + (t.charCodeAt(0) - 97 + 1) * r;
|
|
222
227
|
}, 0);
|
|
223
|
-
return
|
|
224
|
-
},
|
|
225
|
-
let { dark: t, light: n } =
|
|
228
|
+
return h[(t < 0 ? -t : t) % h.length];
|
|
229
|
+
}, _ = (e) => {
|
|
230
|
+
let { dark: t, light: n } = g(e);
|
|
226
231
|
return {
|
|
227
232
|
color: t,
|
|
228
233
|
backgroundColor: n,
|
|
@@ -230,4 +235,4 @@ var s = t({
|
|
|
230
235
|
};
|
|
231
236
|
};
|
|
232
237
|
//#endregion
|
|
233
|
-
export {
|
|
238
|
+
export { m as Avatar, c as avatarRecipe, u as useAvatar };
|
package/src/button/button.js
CHANGED
|
@@ -245,7 +245,7 @@ var c = t({
|
|
|
245
245
|
}), l = () => /* @__PURE__ */ i("span", {
|
|
246
246
|
"aria-label": "loading",
|
|
247
247
|
role: "status",
|
|
248
|
-
className: e("absolute inset-0 grid place-items-center", "rounded-[inherit] bg-inherit", "before:content-[\"\"] before:block before:size-[1em]", "before:border-2 before:border-solid before:rounded-full", "before:border-current before:border-t-transparent", "before:animate-spin before:[animation-duration:0.5s]")
|
|
248
|
+
className: e("absolute inset-0 grid place-items-center", "rounded-[inherit] bg-inherit", "transition-opacity duration-150 starting:opacity-0", "before:content-[\"\"] before:block before:size-[1em]", "before:border-2 before:border-solid before:rounded-full", "before:border-current before:border-t-transparent", "before:animate-spin before:[animation-duration:0.5s]")
|
|
249
249
|
}), u = ({ children: t, asChild: u, variant: d, size: f, status: p, loading: m, rounded: h, align: g, fitContent: _, disabled: v, iconOnly: y, ref: b, className: x, ...S }) => {
|
|
250
250
|
let C = u ? !!y : n.toArray(t).every((e) => r(e)), w = v || m;
|
|
251
251
|
process.env.NODE_ENV !== "production" && (m && d === "link" && console.warn("Button with variant link and loading is not supported"), C && d === "link" && console.warn("Button with no text and variant link is not supported. Use it with variant tertiary instead"), u && y && r(t) && n.toArray(t.props.children).some((e) => !r(e)) && console.warn("Button with asChild and iconOnly should only contain icon children; text found inside the wrapper element"));
|
package/src/checkbox/checkbox.js
CHANGED
|
@@ -8,7 +8,7 @@ var s = r({ slots: {
|
|
|
8
8
|
root: [
|
|
9
9
|
"group/checkbox box-border inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded-sm",
|
|
10
10
|
"border border-solid border-border-input-default bg-bg-input-normal",
|
|
11
|
-
"cursor-pointer transition-colors duration-
|
|
11
|
+
"cursor-pointer transition-colors duration-150",
|
|
12
12
|
"data-[state=checked]:border-bg-checkbox-selected data-[state=checked]:bg-bg-checkbox-selected",
|
|
13
13
|
"data-[state=indeterminate]:border-bg-checkbox-selected data-[state=indeterminate]:bg-bg-checkbox-selected",
|
|
14
14
|
"outline-solid outline-2 outline-offset-2 outline-transparent",
|
package/src/combobox/combobox.js
CHANGED
|
@@ -39,7 +39,7 @@ var v = u({ slots: {
|
|
|
39
39
|
indicator: [
|
|
40
40
|
"mr-2 flex size-4 shrink-0 items-center justify-center rounded-sm",
|
|
41
41
|
"border border-border-input-default bg-bg-input-normal",
|
|
42
|
-
"text-text-default-base-inverse-primary transition-colors duration-
|
|
42
|
+
"text-text-default-base-inverse-primary transition-colors duration-150",
|
|
43
43
|
"data-selected:border-bg-checkbox-selected data-selected:bg-bg-checkbox-selected",
|
|
44
44
|
"[&>svg]:hidden data-selected:[&>svg]:block",
|
|
45
45
|
"group-data-disabled/item:border-border-checkbox-disabled",
|
|
@@ -42,7 +42,7 @@ var y = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
|
42
42
|
});
|
|
43
43
|
y.displayName = "DataTable.ToolBar";
|
|
44
44
|
var b = a({
|
|
45
|
-
base: "size-4 transition-transform duration-200",
|
|
45
|
+
base: "size-4 transition-transform duration-200 motion-reduce:transition-none",
|
|
46
46
|
variants: { direction: {
|
|
47
47
|
asc: "",
|
|
48
48
|
desc: "rotate-180",
|
|
@@ -20,16 +20,13 @@ var c = a.Portal, l = n({
|
|
|
20
20
|
"z-(--z-index-top-layer) flex flex-col rounded-lg bg-bg-default-base-primary p-1 shadow-xl",
|
|
21
21
|
"border border-border-default-base-primary",
|
|
22
22
|
"will-change-[transform,opacity]",
|
|
23
|
-
"
|
|
24
|
-
"data-[state=
|
|
25
|
-
"data-[side=
|
|
26
|
-
"data-[side=
|
|
27
|
-
"data-[side=
|
|
28
|
-
"data-[
|
|
29
|
-
"
|
|
30
|
-
"data-[side=left]:animate-[dropdownSlideInFromRight_200ms_ease-out]",
|
|
31
|
-
"data-[side=right]:animate-[dropdownSlideInFromLeft_200ms_ease-out]",
|
|
32
|
-
"data-[side=top]:animate-[dropdownSlideInFromBottom_200ms_ease-out]"
|
|
23
|
+
"origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
24
|
+
"data-[state=open]:data-[side=bottom]:animate-dropdown-slide-in-from-top",
|
|
25
|
+
"data-[state=open]:data-[side=left]:animate-dropdown-slide-in-from-right",
|
|
26
|
+
"data-[state=open]:data-[side=right]:animate-dropdown-slide-in-from-left",
|
|
27
|
+
"data-[state=open]:data-[side=top]:animate-dropdown-slide-in-from-bottom",
|
|
28
|
+
"data-[state=closed]:animate-dropdown-slide-out",
|
|
29
|
+
"motion-reduce:animate-none!"
|
|
33
30
|
],
|
|
34
31
|
variants: { hasTriggerWidth: { true: "w-[var(--radix-dropdown-menu-trigger-width)]" } }
|
|
35
32
|
}), u = ({ className: e, hasTriggerWidth: t = !1, sideOffset: n = 8, ...i }) => /* @__PURE__ */ r(a.Content, {
|
|
@@ -44,7 +41,7 @@ var c = a.Portal, l = n({
|
|
|
44
41
|
u.displayName = "DropdownMenu.Content";
|
|
45
42
|
var d = ({ className: t, ...n }) => /* @__PURE__ */ r(a.Item, {
|
|
46
43
|
"data-slot": "dropdown-menu-item",
|
|
47
|
-
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline
|
|
44
|
+
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline outline-none", "min-w-40", "data-highlighted:bg-bg-default-base-primary-hover", "data-disabled:pointer-events-none data-disabled:cursor-not-allowed", "data-disabled:text-text-default-disable-primary", "data-disabled:active:bg-bg-default-base-primary", "[&>svg]:h-6", "[&_path]:fill-icon-default-base-tertiary", t),
|
|
48
45
|
...n
|
|
49
46
|
});
|
|
50
47
|
d.displayName = "DropdownMenu.Item";
|
|
@@ -67,7 +64,7 @@ var m = (e) => /* @__PURE__ */ r(a.Sub, {
|
|
|
67
64
|
m.displayName = "DropdownMenu.Sub";
|
|
68
65
|
var h = ({ className: n, children: o, ...s }) => /* @__PURE__ */ i(a.SubTrigger, {
|
|
69
66
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
70
|
-
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline
|
|
67
|
+
className: e("flex items-center gap-2 bg-bg-default-base-primary px-3 py-1.75 text-sm text-text-default-base-primary", "cursor-pointer rounded-md no-underline outline-none", "min-w-40", "data-highlighted:bg-bg-default-base-primary-hover", "data-[state=open]:bg-bg-default-base-primary-hover", "data-disabled:pointer-events-none data-disabled:cursor-not-allowed", "data-disabled:text-text-default-disable-primary", "[&>svg]:h-6", "[&_path]:fill-icon-default-base-tertiary", n),
|
|
71
68
|
...s,
|
|
72
69
|
children: [o, /* @__PURE__ */ r(t, { className: "ml-auto h-4 w-4 [&>path]:fill-icon-default-base-tertiary" })]
|
|
73
70
|
});
|
|
@@ -76,16 +73,13 @@ var g = n({ base: [
|
|
|
76
73
|
"z-(--z-index-top-layer) flex flex-col rounded-lg bg-bg-default-base-primary p-1 shadow-xl",
|
|
77
74
|
"border border-border-default-base-primary",
|
|
78
75
|
"will-change-[transform,opacity]",
|
|
79
|
-
"
|
|
80
|
-
"data-[state=
|
|
81
|
-
"data-[side=
|
|
82
|
-
"data-[side=
|
|
83
|
-
"data-[side=
|
|
84
|
-
"data-[
|
|
85
|
-
"
|
|
86
|
-
"data-[side=left]:animate-[dropdownSlideInFromRight_200ms_ease-out]",
|
|
87
|
-
"data-[side=right]:animate-[dropdownSlideInFromLeft_200ms_ease-out]",
|
|
88
|
-
"data-[side=top]:animate-[dropdownSlideInFromBottom_200ms_ease-out]"
|
|
76
|
+
"origin-(--radix-dropdown-menu-content-transform-origin)",
|
|
77
|
+
"data-[state=open]:data-[side=bottom]:animate-dropdown-slide-in-from-top",
|
|
78
|
+
"data-[state=open]:data-[side=left]:animate-dropdown-slide-in-from-right",
|
|
79
|
+
"data-[state=open]:data-[side=right]:animate-dropdown-slide-in-from-left",
|
|
80
|
+
"data-[state=open]:data-[side=top]:animate-dropdown-slide-in-from-bottom",
|
|
81
|
+
"data-[state=closed]:animate-dropdown-slide-out",
|
|
82
|
+
"motion-reduce:animate-none!"
|
|
89
83
|
] }), _ = ({ className: e, sideOffset: t = 2, alignOffset: n = -5, ...i }) => /* @__PURE__ */ r(a.SubContent, {
|
|
90
84
|
"data-slot": "dropdown-menu-sub-content",
|
|
91
85
|
sideOffset: t,
|
|
@@ -20,10 +20,10 @@ var s = i.Portal, c = t({ base: [
|
|
|
20
20
|
"will-change-[transform,opacity]",
|
|
21
21
|
"data-[side=bottom]:origin-top data-[side=left]:origin-right",
|
|
22
22
|
"data-[side=right]:origin-left data-[side=top]:origin-bottom",
|
|
23
|
-
"transition-[opacity,transform] duration-200 ease-out",
|
|
23
|
+
"transition-[opacity,transform] duration-200 ease-out-quint",
|
|
24
24
|
"starting:opacity-0 starting:[transform:scale(0.9)]",
|
|
25
25
|
"data-[state=closed]:opacity-0 data-[state=closed]:[transform:scale(0.9)]",
|
|
26
|
-
"data-[state=closed]:duration-150
|
|
26
|
+
"data-[state=closed]:duration-150",
|
|
27
27
|
"data-[state=closed]:animate-presence-hold",
|
|
28
28
|
"motion-reduce:transition-none motion-reduce:animate-none!"
|
|
29
29
|
] }), l = ({ className: e, sideOffset: t = 8, collisionPadding: r = 8, ...a }) => /* @__PURE__ */ n(i.Content, {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Open eye on the InputPassword toggle while the value is hidden. Fill color
|
|
4
|
+
* comes from the input group addon, so the icon follows the field's state.
|
|
5
|
+
*
|
|
6
|
+
* @summary 24px open-eye icon on the show-password toggle
|
|
7
|
+
*/
|
|
8
|
+
export declare const IconVisibility: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Struck-through eye on the InputPassword toggle while the value is shown.
|
|
11
|
+
* Fill color comes from the input group addon, so the icon follows the
|
|
12
|
+
* field's state.
|
|
13
|
+
*
|
|
14
|
+
* @summary 24px crossed-eye icon on the hide-password toggle
|
|
15
|
+
*/
|
|
16
|
+
export declare const IconVisibilityOff: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/input-password/icons.tsx
|
|
3
|
+
var t = (t) => /* @__PURE__ */ e("svg", {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "none",
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
...t,
|
|
11
|
+
children: /* @__PURE__ */ e("path", { d: "M12.0023 15.5769C13.1354 15.5769 14.0978 15.1803 14.8895 14.3871C15.6811 13.5939 16.077 12.6308 16.077 11.4977C16.077 10.3646 15.6804 9.40224 14.8872 8.61058C14.094 7.81891 13.1309 7.42308 11.9978 7.42308C10.8647 7.42308 9.90233 7.81966 9.11066 8.61282C8.31899 9.40601 7.92316 10.3692 7.92316 11.5023C7.92316 12.6353 8.31974 13.5977 9.11291 14.3894C9.90609 15.181 10.8692 15.5769 12.0023 15.5769ZM12.0001 14.2C11.2501 14.2 10.6126 13.9375 10.0876 13.4125C9.56256 12.8875 9.30006 12.25 9.30006 11.5C9.30006 10.75 9.56256 10.1125 10.0876 9.58748C10.6126 9.06248 11.2501 8.79998 12.0001 8.79998C12.7501 8.79998 13.3876 9.06248 13.9126 9.58748C14.4376 10.1125 14.7001 10.75 14.7001 11.5C14.7001 12.25 14.4376 12.8875 13.9126 13.4125C13.3876 13.9375 12.7501 14.2 12.0001 14.2ZM12.0001 18.5C9.81161 18.5 7.80553 17.9243 5.98181 16.773C4.15811 15.6217 2.76741 14.0653 1.80971 12.1038C1.76613 12.0269 1.736 11.9353 1.71934 11.8292C1.70267 11.723 1.69434 11.6132 1.69434 11.5C1.69434 11.3867 1.70267 11.277 1.71934 11.1708C1.736 11.0646 1.76613 10.9731 1.80971 10.8961C2.76741 8.93461 4.15811 7.37821 5.98181 6.22693C7.80553 5.07564 9.81161 4.5 12.0001 4.5C14.1885 4.5 16.1946 5.07564 18.0183 6.22693C19.842 7.37821 21.2327 8.93461 22.1904 10.8961C22.234 10.9731 22.2641 11.0646 22.2808 11.1708C22.2975 11.277 22.3058 11.3867 22.3058 11.5C22.3058 11.6132 22.2975 11.723 22.2808 11.8292C22.2641 11.9353 22.234 12.0269 22.1904 12.1038C21.2327 14.0653 19.842 15.6217 18.0183 16.773C16.1946 17.9243 14.1885 18.5 12.0001 18.5ZM12.0001 17C13.8834 17 15.6126 16.5041 17.1876 15.5125C18.7626 14.5208 19.9667 13.1833 20.8001 11.5C19.9667 9.81664 18.7626 8.47914 17.1876 7.48748C15.6126 6.49581 13.8834 5.99998 12.0001 5.99998C10.1167 5.99998 8.38756 6.49581 6.81256 7.48748C5.23756 8.47914 4.03339 9.81664 3.20006 11.5C4.03339 13.1833 5.23756 14.5208 6.81256 15.5125C8.38756 16.5041 10.1167 17 12.0001 17Z" })
|
|
12
|
+
}), n = (t) => /* @__PURE__ */ e("svg", {
|
|
13
|
+
width: "24",
|
|
14
|
+
height: "24",
|
|
15
|
+
viewBox: "0 0 24 24",
|
|
16
|
+
fill: "none",
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
...t,
|
|
20
|
+
children: /* @__PURE__ */ e("path", { d: "M15.7731 12.9731L14.6501 11.85C14.8001 11.0218 14.5638 10.2772 13.9414 9.61636C13.319 8.95546 12.5552 8.70001 11.6501 8.85001L10.527 7.72696C10.7526 7.62568 10.9841 7.54972 11.2212 7.49909C11.4584 7.44844 11.718 7.42311 12.0001 7.42311C13.1347 7.42311 14.0978 7.81895 14.8895 8.61061C15.6811 9.40228 16.077 10.3654 16.077 11.5C16.077 11.7821 16.0516 12.0449 16.001 12.2885C15.9504 12.532 15.8744 12.7602 15.7731 12.9731ZM18.9539 16.0846L17.8501 15.05C18.4834 14.5667 19.0459 14.0375 19.5376 13.4625C20.0292 12.8875 20.4501 12.2333 20.8001 11.5C19.9667 9.81668 18.7709 8.47918 17.2126 7.48751C15.6542 6.49585 13.9167 6.00001 12.0001 6.00001C11.5167 6.00001 11.0417 6.03335 10.5751 6.10001C10.1084 6.16668 9.65006 6.26668 9.20006 6.40001L8.03471 5.23466C8.66676 4.98338 9.31227 4.79812 9.97124 4.67889C10.6302 4.55965 11.3065 4.50004 12.0001 4.50004C14.2231 4.50004 16.2462 5.08914 18.0693 6.26734C19.8923 7.44554 21.266 8.98848 22.1904 10.8962C22.234 10.9731 22.2641 11.0644 22.2808 11.1702C22.2975 11.276 22.3058 11.3859 22.3058 11.5C22.3058 11.6141 22.2949 11.724 22.2731 11.8298C22.2513 11.9356 22.2237 12.0269 22.1904 12.1039C21.8199 12.8833 21.3632 13.6074 20.8202 14.276C20.2773 14.9445 19.6552 15.5474 18.9539 16.0846ZM19.2347 21.3423L15.7155 17.8538C15.2026 18.0436 14.6344 18.1987 14.0107 18.3192C13.3869 18.4397 12.7167 18.5 12.0001 18.5C9.76418 18.5 7.7395 17.9109 5.92604 16.7327C4.11259 15.5545 2.74048 14.0115 1.80971 12.1039C1.76613 12.0269 1.736 11.9356 1.71934 11.8298C1.70267 11.724 1.69434 11.6141 1.69434 11.5C1.69434 11.3859 1.70267 11.2785 1.71934 11.1779C1.736 11.0773 1.76613 10.9885 1.80971 10.9116C2.18536 10.1423 2.64049 9.43143 3.17511 8.77886C3.70973 8.1263 4.28473 7.54617 4.90011 7.03849L2.64241 4.76539C2.50394 4.62692 2.43311 4.45545 2.42991 4.25099C2.42671 4.0465 2.50267 3.86669 2.65779 3.71156C2.80265 3.56669 2.97829 3.49426 3.18471 3.49426C3.39111 3.49426 3.56674 3.56669 3.71161 3.71156L20.2885 20.2885C20.427 20.4269 20.5004 20.5984 20.5087 20.8029C20.517 21.0073 20.4436 21.1872 20.2885 21.3423C20.1436 21.4872 19.968 21.5596 19.7616 21.5596C19.5552 21.5596 19.3796 21.4872 19.2347 21.3423ZM5.95394 8.09229C5.42574 8.5128 4.91195 9.01826 4.41259 9.60866C3.91322 10.199 3.50904 10.8295 3.20006 11.5C4.03339 13.1833 5.22923 14.5208 6.78756 15.5125C8.34589 16.5042 10.0834 17 12.0001 17C12.4552 17 12.9084 16.9615 13.3597 16.8846C13.811 16.8077 14.1937 16.7282 14.5078 16.6462L13.2424 15.35C13.0719 15.4192 12.8744 15.4743 12.6501 15.5154C12.4257 15.5564 12.209 15.5769 12.0001 15.5769C10.8655 15.5769 9.90233 15.1811 9.11066 14.3894C8.31899 13.5977 7.92316 12.6346 7.92316 11.5C7.92316 11.2974 7.94368 11.0856 7.98471 10.8644C8.02574 10.6433 8.08087 10.441 8.15009 10.2577L5.95394 8.09229Z" })
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { t as IconVisibility, n as IconVisibilityOff };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { InputProps } from '../input';
|
|
2
|
+
/**
|
|
3
|
+
* Style recipe for InputPassword. Slots: `toggle` (the addon holding the
|
|
4
|
+
* button) and `button`. The `size` variant follows the input's: the button is
|
|
5
|
+
* 24px at `sm` and 32px above, the icon 16, 20 or 24px, and a negative end
|
|
6
|
+
* margin pulls the addon into the frame's padding so the button sits as far
|
|
7
|
+
* from the right edge as from the top and bottom (4px, 8px at `lg`).
|
|
8
|
+
*
|
|
9
|
+
* @summary tailwind-variants recipe backing the InputPassword toggle
|
|
10
|
+
*/
|
|
11
|
+
export declare const inputPasswordRecipe: import('tailwind-variants').TVReturnType<{
|
|
12
|
+
size: {
|
|
13
|
+
sm: {
|
|
14
|
+
toggle: string;
|
|
15
|
+
button: string;
|
|
16
|
+
};
|
|
17
|
+
md: {
|
|
18
|
+
toggle: string;
|
|
19
|
+
button: string;
|
|
20
|
+
};
|
|
21
|
+
lg: {
|
|
22
|
+
toggle: string;
|
|
23
|
+
button: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
toggle: string;
|
|
28
|
+
button: string;
|
|
29
|
+
}, undefined, {
|
|
30
|
+
size: {
|
|
31
|
+
sm: {
|
|
32
|
+
toggle: string;
|
|
33
|
+
button: string;
|
|
34
|
+
};
|
|
35
|
+
md: {
|
|
36
|
+
toggle: string;
|
|
37
|
+
button: string;
|
|
38
|
+
};
|
|
39
|
+
lg: {
|
|
40
|
+
toggle: string;
|
|
41
|
+
button: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
toggle: string;
|
|
46
|
+
button: string;
|
|
47
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
48
|
+
size: {
|
|
49
|
+
sm: {
|
|
50
|
+
toggle: string;
|
|
51
|
+
button: string;
|
|
52
|
+
};
|
|
53
|
+
md: {
|
|
54
|
+
toggle: string;
|
|
55
|
+
button: string;
|
|
56
|
+
};
|
|
57
|
+
lg: {
|
|
58
|
+
toggle: string;
|
|
59
|
+
button: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
toggle: string;
|
|
64
|
+
button: string;
|
|
65
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
66
|
+
export type InputPasswordProps = Omit<InputProps, 'type'>;
|
|
67
|
+
/**
|
|
68
|
+
* InputPassword is a password field with a show/hide toggle at the end of its
|
|
69
|
+
* frame. The value starts hidden; the toggle reveals it as plain text and
|
|
70
|
+
* hides it again. Its accessible name reads "Show password" or "Hide
|
|
71
|
+
* password", depending on what the next press does. Pressing the toggle keeps
|
|
72
|
+
* focus and the caret in the input. The toggle is not rendered while the input
|
|
73
|
+
* is disabled, whether `disabled` comes from the prop, from a surrounding
|
|
74
|
+
* `FieldText` or from a `<fieldset disabled>`.
|
|
75
|
+
*
|
|
76
|
+
* It is an [Input](?path=/docs/components-input--docs) inside an
|
|
77
|
+
* [InputGroup](?path=/docs/components-inputgroup--docs) frame. `className`
|
|
78
|
+
* styles the frame. Every other prop goes to the `<input>`: the `ref`, `id`,
|
|
79
|
+
* `name`, `value`, `onChange`, `aria-*` and every other standard attribute,
|
|
80
|
+
* such as `autoComplete`, `required` or `maxLength`. Only `type` is not
|
|
81
|
+
* accepted, because the toggle owns it. Inside a `FieldText` the input takes
|
|
82
|
+
* its label, messages and states from the field as a plain `Input` does. The
|
|
83
|
+
* invalid state comes from `aria-invalid`, and the frame paints the
|
|
84
|
+
* destructive border. Set `autoComplete` to `current-password` on sign-in and
|
|
85
|
+
* `new-password` when the user picks one, so password managers fill the right
|
|
86
|
+
* value.
|
|
87
|
+
*
|
|
88
|
+
* Do not use it for text that is not secret; use `Input` instead. A one-time
|
|
89
|
+
* code is an `Input` with `autoComplete="one-time-code"`, not a password.
|
|
90
|
+
*
|
|
91
|
+
* @summary Password input with a show/hide toggle inside the frame
|
|
92
|
+
* @dataAttribute {string} data-slot - Always set to "input-password" on the frame
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* <FieldText required>
|
|
96
|
+
* <Label>Password</Label>
|
|
97
|
+
* <InputPassword name="password" autoComplete="current-password" />
|
|
98
|
+
* </FieldText>
|
|
99
|
+
*/
|
|
100
|
+
export declare const InputPassword: {
|
|
101
|
+
({ className, size, ...props }: InputPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
displayName: string;
|
|
103
|
+
};
|