@kanso-labs/kanso-ui 0.2.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 +20 -0
- package/README.md +83 -0
- package/dist/assets/stylex.css +1623 -0
- package/dist/cjs/assets/stylex.css +1623 -0
- package/dist/cjs/components/avatar/index.cjs +89 -0
- package/dist/cjs/components/avatar/index.cjs.map +1 -0
- package/dist/cjs/components/avatar/index.d.cts +29 -0
- package/dist/cjs/components/badge/index.cjs +93 -0
- package/dist/cjs/components/badge/index.cjs.map +1 -0
- package/dist/cjs/components/badge/index.d.cts +27 -0
- package/dist/cjs/components/button/index.cjs +101 -0
- package/dist/cjs/components/button/index.cjs.map +1 -0
- package/dist/cjs/components/button/index.d.cts +22 -0
- package/dist/cjs/components/card/index.cjs +84 -0
- package/dist/cjs/components/card/index.cjs.map +1 -0
- package/dist/cjs/components/card/index.d.cts +29 -0
- package/dist/cjs/components/chip/index.cjs +53 -0
- package/dist/cjs/components/chip/index.cjs.map +1 -0
- package/dist/cjs/components/chip/index.d.cts +13 -0
- package/dist/cjs/components/currency/index.cjs +56 -0
- package/dist/cjs/components/currency/index.cjs.map +1 -0
- package/dist/cjs/components/currency/index.d.cts +36 -0
- package/dist/cjs/components/icon-button/index.cjs +80 -0
- package/dist/cjs/components/icon-button/index.cjs.map +1 -0
- package/dist/cjs/components/icon-button/index.d.cts +32 -0
- package/dist/cjs/components/index.d.cts +15 -0
- package/dist/cjs/components/link/index.cjs +61 -0
- package/dist/cjs/components/link/index.cjs.map +1 -0
- package/dist/cjs/components/link/index.d.cts +30 -0
- package/dist/cjs/components/list-item/index.cjs +42 -0
- package/dist/cjs/components/list-item/index.cjs.map +1 -0
- package/dist/cjs/components/list-item/index.d.cts +22 -0
- package/dist/cjs/components/separator/index.cjs +34 -0
- package/dist/cjs/components/separator/index.cjs.map +1 -0
- package/dist/cjs/components/separator/index.d.cts +14 -0
- package/dist/cjs/components/sheet/index.cjs +266 -0
- package/dist/cjs/components/sheet/index.cjs.map +1 -0
- package/dist/cjs/components/sheet/index.d.cts +73 -0
- package/dist/cjs/components/tabs/index.cjs +77 -0
- package/dist/cjs/components/tabs/index.cjs.map +1 -0
- package/dist/cjs/components/tabs/index.d.cts +24 -0
- package/dist/cjs/components/text/index.cjs +173 -0
- package/dist/cjs/components/text/index.cjs.map +1 -0
- package/dist/cjs/components/text/index.d.cts +19 -0
- package/dist/cjs/components/text-field/index.cjs +53 -0
- package/dist/cjs/components/text-field/index.cjs.map +1 -0
- package/dist/cjs/components/text-field/index.d.cts +30 -0
- package/dist/cjs/hooks/useRipple.cjs +391 -0
- package/dist/cjs/hooks/useRipple.cjs.map +1 -0
- package/dist/cjs/index.cjs +29 -0
- package/dist/cjs/index.d.cts +16 -0
- package/dist/cjs/node_modules/@stylexjs/stylex/lib/es/stylex.cjs +121 -0
- package/dist/cjs/node_modules/@stylexjs/stylex/lib/es/stylex.cjs.map +1 -0
- package/dist/cjs/styles/ripple.cjs +33 -0
- package/dist/cjs/styles/ripple.cjs.map +1 -0
- package/dist/cjs/tokens/values.cjs +36 -0
- package/dist/cjs/tokens/values.cjs.map +1 -0
- package/dist/components/avatar/index.d.ts +29 -0
- package/dist/components/avatar/index.js +89 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +27 -0
- package/dist/components/badge/index.js +93 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/button/index.d.ts +22 -0
- package/dist/components/button/index.js +101 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/card/index.d.ts +29 -0
- package/dist/components/card/index.js +84 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/chip/index.d.ts +13 -0
- package/dist/components/chip/index.js +53 -0
- package/dist/components/chip/index.js.map +1 -0
- package/dist/components/currency/index.d.ts +36 -0
- package/dist/components/currency/index.js +56 -0
- package/dist/components/currency/index.js.map +1 -0
- package/dist/components/icon-button/index.d.ts +32 -0
- package/dist/components/icon-button/index.js +80 -0
- package/dist/components/icon-button/index.js.map +1 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/link/index.d.ts +30 -0
- package/dist/components/link/index.js +61 -0
- package/dist/components/link/index.js.map +1 -0
- package/dist/components/list-item/index.d.ts +22 -0
- package/dist/components/list-item/index.js +42 -0
- package/dist/components/list-item/index.js.map +1 -0
- package/dist/components/separator/index.d.ts +14 -0
- package/dist/components/separator/index.js +34 -0
- package/dist/components/separator/index.js.map +1 -0
- package/dist/components/sheet/index.d.ts +73 -0
- package/dist/components/sheet/index.js +266 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +24 -0
- package/dist/components/tabs/index.js +77 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/text/index.d.ts +19 -0
- package/dist/components/text/index.js +173 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/text-field/index.d.ts +30 -0
- package/dist/components/text-field/index.js +53 -0
- package/dist/components/text-field/index.js.map +1 -0
- package/dist/hooks/useRipple.js +391 -0
- package/dist/hooks/useRipple.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +15 -0
- package/dist/node_modules/@stylexjs/stylex/lib/es/stylex.js +121 -0
- package/dist/node_modules/@stylexjs/stylex/lib/es/stylex.js.map +1 -0
- package/dist/styles/ripple.js +33 -0
- package/dist/styles/ripple.js.map +1 -0
- package/dist/tokens/values.js +34 -0
- package/dist/tokens/values.js.map +1 -0
- package/dist/tokens.css +282 -0
- package/package.json +109 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
//#region src/components/text/index.d.ts
|
|
3
|
+
type TextProps = useRender.ComponentProps<'span'> & {
|
|
4
|
+
/**
|
|
5
|
+
* The color role to render in. `inherit` takes the color of the nearest
|
|
6
|
+
* colored ancestor instead of setting one.
|
|
7
|
+
* @default 'default'
|
|
8
|
+
*/
|
|
9
|
+
tone?: 'default' | 'error' | 'inherit' | 'muted' | 'negative' | 'positive' | 'primary';
|
|
10
|
+
/**
|
|
11
|
+
* Which style of the type scale to render.
|
|
12
|
+
* @default 'bodyMedium'
|
|
13
|
+
*/
|
|
14
|
+
variant?: 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall';
|
|
15
|
+
};
|
|
16
|
+
declare function Text({ render, tone, variant, ...props }: TextProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { type TextProps, Text as default };
|
|
19
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
2
|
+
let react = require("react");
|
|
3
|
+
let _base_ui_react_field = require("@base-ui/react/field");
|
|
4
|
+
//#region src/components/text-field/index.tsx
|
|
5
|
+
function TextField({ description, disabled = false, error, label, numeric = false, ...props }) {
|
|
6
|
+
const invalid = error !== void 0;
|
|
7
|
+
const labelClassName = (0, react.useCallback)((state) => ({
|
|
8
|
+
0: { className: "x1w5n3ug xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7" },
|
|
9
|
+
4: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1xj74d8" },
|
|
10
|
+
2: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj" },
|
|
11
|
+
6: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj" },
|
|
12
|
+
1: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y" },
|
|
13
|
+
5: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y" },
|
|
14
|
+
3: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y" },
|
|
15
|
+
7: { className: "xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y" }
|
|
16
|
+
})[!!disabled << 2 | !!invalid << 1 | !!(!disabled && !invalid && state.focused) << 0].className, [disabled, invalid]);
|
|
17
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_field.Field.Root, {
|
|
18
|
+
disabled,
|
|
19
|
+
invalid,
|
|
20
|
+
className: "x78zum5 xdt5ytf",
|
|
21
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22
|
+
...{
|
|
23
|
+
0: { className: "x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x89kqus x18rfq6m x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7" },
|
|
24
|
+
2: { className: "x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 x1lxxh4i x1d6xoej" },
|
|
25
|
+
1: { className: "xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1" },
|
|
26
|
+
3: { className: "xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1" }
|
|
27
|
+
}[!!invalid << 1 | !!disabled << 0],
|
|
28
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Label, {
|
|
29
|
+
className: labelClassName,
|
|
30
|
+
children: label
|
|
31
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Control, {
|
|
32
|
+
...props,
|
|
33
|
+
...{
|
|
34
|
+
0: { className: "xjbqb8w xc342km x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv" },
|
|
35
|
+
2: { className: "xjbqb8w xc342km x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b" },
|
|
36
|
+
1: { className: "xjbqb8w xc342km x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv x1xj74d8" },
|
|
37
|
+
3: { className: "xjbqb8w xc342km x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b x1xj74d8" }
|
|
38
|
+
}[!!numeric << 1 | !!disabled << 0]
|
|
39
|
+
})]
|
|
40
|
+
}), invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Error, {
|
|
41
|
+
match: true,
|
|
42
|
+
className: "x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi x4ii1qj",
|
|
43
|
+
children: error
|
|
44
|
+
}) : description === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Description, {
|
|
45
|
+
className: "x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi",
|
|
46
|
+
children: description
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.default = TextField;
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../../src/components/text-field/index.tsx"],"sourcesContent":["import type { FieldControlProps as BaseUIFieldControlProps, FieldLabelState as BaseUIFieldLabelState } from '@base-ui/react/field';\nimport { Field as BaseUIField } from '@base-ui/react/field';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback } from 'react';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The focus indicator is an inset box-shadow on the bottom edge rather than a\n// border that thickens. A real border going 1px -> 2px on focus grows the\n// box, which pushes every sibling below it down by a pixel — so a form\n// twitches each time focus moves between its fields. A shadow is drawn inside\n// the box and changes nothing about its size.\n//\n// The label sits at a fixed size at the top rather than floating up out of\n// the input on focus: the design draws it small and in place at all times, so\n// there is no transition between two positions to get right.\n\ntype TextFieldProps = {\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n */\n error?: string;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n} & Omit<BaseUIFieldControlProps, 'render'>;\nfunction TextField({\n description,\n disabled = false,\n error,\n label,\n numeric = false,\n ...props\n}: TextFieldProps) {\n const invalid = error !== undefined;\n\n // The label's colour follows the field's focus, which is a state only Base\n // UI knows — StyleX cannot express `.box:focus-within .label`, because the\n // label is the input's sibling rather than its ancestor. useCallback keeps\n // it one reference between renders, which is what react-perf is after.\n const labelClassName = useCallback((state: BaseUIFieldLabelState) => ({\n 0: {\n className: \"x1w5n3ug xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7\"\n },\n 4: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1xj74d8\"\n },\n 2: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 6: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 5: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 3: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 7: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n }\n })[!!disabled << 2 | !!invalid << 1 | !!(!disabled && !invalid && state.focused) << 0].className, [disabled, invalid]);\n return <BaseUIField.Root disabled={disabled} invalid={invalid} className=\"x78zum5 xdt5ytf\">\n <div {...{\n 0: {\n className: \"x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x89kqus x18rfq6m x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7\"\n },\n 2: {\n className: \"x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 x1lxxh4i x1d6xoej\"\n },\n 1: {\n className: \"xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1\"\n },\n 3: {\n className: \"xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1\"\n }\n }[!!invalid << 1 | !!disabled << 0]}>\n <BaseUIField.Label className={labelClassName}>\n {label}\n </BaseUIField.Label>\n <BaseUIField.Control {...props} {...{\n 0: {\n className: \"xjbqb8w xc342km x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv\"\n },\n 2: {\n className: \"xjbqb8w xc342km x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b\"\n },\n 1: {\n className: \"xjbqb8w xc342km x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv x1xj74d8\"\n },\n 3: {\n className: \"xjbqb8w xc342km x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b x1xj74d8\"\n }\n }[!!numeric << 1 | !!disabled << 0]} />\n </div>\n {invalid ? <BaseUIField.Error match className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi x4ii1qj\">\n {error}\n </BaseUIField.Error> : description === undefined ? null : <BaseUIField.Description className=\"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi\">\n {description}\n </BaseUIField.Description>}\n </BaseUIField.Root>;\n}\nexport type { TextFieldProps };\nexport default TextField;"],"mappings":";;;;AAyCA,SAAS,UAAU,EACjB,aACA,WAAW,OACX,OACA,OACA,UAAU,OACV,GAAG,SACc;CACjB,MAAM,UAAU,UAAU,KAAA;CAM1B,MAAM,kBAAA,GAAiB,MAAA,YAAA,EAAa,WAAkC;EACpE,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,wGACb;EACA,GAAG,EACD,WAAW,wGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;CACF,EAAA,CAAG,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,MAAM,YAAY,EAAE,CAAC,WAAW,CAAC,UAAU,OAAO,CAAC;CACrH,OAAO,iBAAA,GAAA,kBAAA,KAAA,CAAC,qBAAA,MAAY,MAAb;EAA4B;EAAmB;EAAS,WAAU;EAAlE,UAAA,CACH,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,GAAI;IACT,GAAG,EACD,WAAW,gIACb;IACA,GAAG,EACD,WAAW,iIACb;IACA,GAAG,EACD,WAAW,uHACb;IACA,GAAG,EACD,WAAW,uHACb;GACF,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY;GAb/B,UAAA,CAcE,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,MAAY,OAAb;IAAmB,WAAW;IAC3B,UAAA;GACgB,CAAA,GACnB,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,MAAY,SAAb;IAAqB,GAAI;IAAO,GAAI;KACpC,GAAG,EACD,WAAW,0GACb;KACA,GAAG,EACD,WAAW,iHACb;KACA,GAAG,EACD,WAAW,0GACb;KACA,GAAG,EACD,WAAW,iHACb;IACF,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY;GAAG,CAAA,CAC/B;EACJ,CAAA,GAAA,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,MAAY,OAAb;GAAmB,OAAA;GAAM,WAAU;GACzC,UAAA;EACgB,CAAA,IAAI,gBAAgB,KAAA,IAAY,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,qBAAA,MAAY,aAAb;GAAyB,WAAU;GAC1F,UAAA;EACsB,CAAA,CACX;;AACtB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FieldControlProps } from "@base-ui/react/field";
|
|
2
|
+
//#region src/components/text-field/index.d.ts
|
|
3
|
+
type TextFieldProps = {
|
|
4
|
+
/**
|
|
5
|
+
* A hint shown under the field. Replaced by `error` when there is one, so
|
|
6
|
+
* the two never stack.
|
|
7
|
+
*/
|
|
8
|
+
description?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The problem with the current value, in words. Its presence is what puts
|
|
11
|
+
* the field in its error state — the message, the red underline, and
|
|
12
|
+
* `aria-invalid` all follow from it.
|
|
13
|
+
*/
|
|
14
|
+
error?: string;
|
|
15
|
+
/**
|
|
16
|
+
* What the field is for. Required rather than optional: a text field with
|
|
17
|
+
* no label is a box a screen reader cannot name.
|
|
18
|
+
*/
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* Renders the value in the mono face with tabular figures, for amounts and
|
|
22
|
+
* other numbers meant to be compared down a column.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
numeric?: boolean;
|
|
26
|
+
} & Omit<FieldControlProps, 'render'>;
|
|
27
|
+
declare function TextField({ description, disabled, error, label, numeric, ...props }: TextFieldProps): import("react").JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { type TextFieldProps, TextField as default };
|
|
30
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
const require_stylex = require("../node_modules/@stylexjs/stylex/lib/es/stylex.cjs");
|
|
2
|
+
const require_ripple = require("../styles/ripple.cjs");
|
|
3
|
+
const require_values = require("../tokens/values.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
//#region src/hooks/useRipple.tsx
|
|
8
|
+
/** How far the ripple grows past the host's corners. `spacing.sm`. */
|
|
9
|
+
const PADDING = require_values.spacingPx.sm;
|
|
10
|
+
const INITIAL_ORIGIN_SCALE = .2;
|
|
11
|
+
const SOFT_EDGE_MINIMUM_SIZE = 75;
|
|
12
|
+
const SOFT_EDGE_CONTAINER_RATIO = .35;
|
|
13
|
+
const surfaceProps = require_stylex.props(require_ripple.rippleStyles.surface);
|
|
14
|
+
/**
|
|
15
|
+
* On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or
|
|
16
|
+
* `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a
|
|
17
|
+
* held press.
|
|
18
|
+
*
|
|
19
|
+
* On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.
|
|
20
|
+
*/
|
|
21
|
+
const RippleState = {
|
|
22
|
+
/** A touch has been confirmed as a press (held past the touch delay). */
|
|
23
|
+
Holding: 2,
|
|
24
|
+
/** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */
|
|
25
|
+
Inactive: 0,
|
|
26
|
+
/** Touch down received; waiting to see if it's a tap or a scroll/swipe. */
|
|
27
|
+
TouchDelay: 1,
|
|
28
|
+
/** The press has finished growing; waiting for the click that ends it. */
|
|
29
|
+
WaitingForClick: 3
|
|
30
|
+
};
|
|
31
|
+
function isTouch(event) {
|
|
32
|
+
return event.pointerType === "touch";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renders a press ripple that grows from the pointer's position, or from
|
|
36
|
+
* the element's center for a keyboard or other non-pointer activation.
|
|
37
|
+
*
|
|
38
|
+
* Growth runs via the Web Animations API on a single reused element (no
|
|
39
|
+
* per-click DOM nodes to clean up), over a fixed duration independent of how
|
|
40
|
+
* long the element is held — a real press-and-hold keeps the ripple
|
|
41
|
+
* growing until release, while a quick tap is still held visible for a
|
|
42
|
+
* minimum duration so it plays a complete animation rather than a flicker.
|
|
43
|
+
*
|
|
44
|
+
* Merges its own handlers with `externalHandlers` (e.g. a component's own
|
|
45
|
+
* consumer-supplied props — ripple's own run first, then the external
|
|
46
|
+
* ones) and returns `handlers` to spread onto the interactive element and
|
|
47
|
+
* `surface`, the node to render as a child. The host element must
|
|
48
|
+
* establish a positioning context (`position: relative` or similar) so
|
|
49
|
+
* `surface`, which fills it via `inset: 0`, clips to its bounds and
|
|
50
|
+
* inherits its shape.
|
|
51
|
+
*
|
|
52
|
+
* Pass `enabled: false` to opt out — no ripple listeners are attached and
|
|
53
|
+
* no surface is rendered, leaving `externalHandlers` and a component's own
|
|
54
|
+
* hover/press state layer (if any) untouched.
|
|
55
|
+
*
|
|
56
|
+
* `handlers` and `surface` are hand-memoized (not left to build-tool
|
|
57
|
+
* optimization) so a consumer rendering many instances — a list of icon
|
|
58
|
+
* buttons, say — can memoize around them too, and so stability doesn't
|
|
59
|
+
* depend on any particular compiler being configured.
|
|
60
|
+
*/
|
|
61
|
+
function useRipple(t0, t1) {
|
|
62
|
+
const $ = (0, react_compiler_runtime.c)(43);
|
|
63
|
+
const enabled = t0 === void 0 ? true : t0;
|
|
64
|
+
let t2;
|
|
65
|
+
if ($[0] !== t1) {
|
|
66
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
67
|
+
$[0] = t1;
|
|
68
|
+
$[1] = t2;
|
|
69
|
+
} else t2 = $[1];
|
|
70
|
+
const externalHandlers = t2;
|
|
71
|
+
const [pressed, setPressed] = (0, react.useState)(false);
|
|
72
|
+
const rippleRef = (0, react.useRef)(null);
|
|
73
|
+
const state = (0, react.useRef)(RippleState.Inactive);
|
|
74
|
+
const growAnimation = (0, react.useRef)(void 0);
|
|
75
|
+
const rippleStartEvent = (0, react.useRef)(void 0);
|
|
76
|
+
const initialSize = (0, react.useRef)(0);
|
|
77
|
+
const rippleScale = (0, react.useRef)("1");
|
|
78
|
+
let t3;
|
|
79
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
80
|
+
t3 = (event) => {
|
|
81
|
+
if (!event.isPrimary) return false;
|
|
82
|
+
const startEvent = rippleStartEvent.current;
|
|
83
|
+
if (startEvent && startEvent.pointerId !== event.pointerId) return false;
|
|
84
|
+
return isTouch(event) || event.buttons === 1;
|
|
85
|
+
};
|
|
86
|
+
$[2] = t3;
|
|
87
|
+
} else t3 = $[2];
|
|
88
|
+
const shouldReactToEvent = t3;
|
|
89
|
+
let t4;
|
|
90
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
91
|
+
t4 = (rect) => {
|
|
92
|
+
const { height, width } = rect;
|
|
93
|
+
const maxDimension = Math.max(height, width);
|
|
94
|
+
const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);
|
|
95
|
+
const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);
|
|
96
|
+
const maxRadius = Math.hypot(width, height) + PADDING;
|
|
97
|
+
initialSize.current = size;
|
|
98
|
+
rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;
|
|
99
|
+
return `${size}px`;
|
|
100
|
+
};
|
|
101
|
+
$[3] = t4;
|
|
102
|
+
} else t4 = $[3];
|
|
103
|
+
const determineRippleSize = t4;
|
|
104
|
+
let t5;
|
|
105
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
106
|
+
t5 = (rect_0, positionEvent) => {
|
|
107
|
+
const { height: height_0, left, top, width: width_0 } = rect_0;
|
|
108
|
+
const size_0 = initialSize.current;
|
|
109
|
+
const endPoint = {
|
|
110
|
+
x: (width_0 - size_0) / 2,
|
|
111
|
+
y: (height_0 - size_0) / 2
|
|
112
|
+
};
|
|
113
|
+
const origin = positionEvent ? {
|
|
114
|
+
x: positionEvent.clientX - left,
|
|
115
|
+
y: positionEvent.clientY - top
|
|
116
|
+
} : {
|
|
117
|
+
x: width_0 / 2,
|
|
118
|
+
y: height_0 / 2
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
endPoint,
|
|
122
|
+
startPoint: {
|
|
123
|
+
x: origin.x - size_0 / 2,
|
|
124
|
+
y: origin.y - size_0 / 2
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
$[4] = t5;
|
|
129
|
+
} else t5 = $[4];
|
|
130
|
+
const getTranslationCoordinates = t5;
|
|
131
|
+
let t6;
|
|
132
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
133
|
+
t6 = (target, positionEvent_0) => {
|
|
134
|
+
const ripple = rippleRef.current;
|
|
135
|
+
if (!ripple) return;
|
|
136
|
+
setPressed(true);
|
|
137
|
+
growAnimation.current?.cancel();
|
|
138
|
+
const rect_1 = target.getBoundingClientRect();
|
|
139
|
+
const size_1 = determineRippleSize(rect_1);
|
|
140
|
+
const { endPoint: endPoint_0, startPoint: startPoint_0 } = getTranslationCoordinates(rect_1, positionEvent_0);
|
|
141
|
+
ripple.style.width = size_1;
|
|
142
|
+
ripple.style.height = size_1;
|
|
143
|
+
growAnimation.current = ripple.animate({ transform: [`translate(${startPoint_0.x}px, ${startPoint_0.y}px) scale(1)`, `translate(${endPoint_0.x}px, ${endPoint_0.y}px) scale(${rippleScale.current})`] }, {
|
|
144
|
+
duration: require_values.motionDurationMs.long1,
|
|
145
|
+
easing: require_values.motionEasing.standard,
|
|
146
|
+
fill: "forwards"
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
$[5] = t6;
|
|
150
|
+
} else t6 = $[5];
|
|
151
|
+
const startPressAnimation = t6;
|
|
152
|
+
let t7;
|
|
153
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
154
|
+
t7 = async () => {
|
|
155
|
+
rippleStartEvent.current = void 0;
|
|
156
|
+
state.current = RippleState.Inactive;
|
|
157
|
+
const animation = growAnimation.current;
|
|
158
|
+
const elapsed = typeof animation?.currentTime === "number" ? animation.currentTime : Infinity;
|
|
159
|
+
if (elapsed >= require_values.motionDurationMs.medium1) {
|
|
160
|
+
setPressed(false);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
await new Promise((resolve) => {
|
|
164
|
+
setTimeout(resolve, require_values.motionDurationMs.medium1 - elapsed);
|
|
165
|
+
});
|
|
166
|
+
if (growAnimation.current !== animation) return;
|
|
167
|
+
setPressed(false);
|
|
168
|
+
};
|
|
169
|
+
$[6] = t7;
|
|
170
|
+
} else t7 = $[6];
|
|
171
|
+
const endPressAnimation = t7;
|
|
172
|
+
let t8;
|
|
173
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
174
|
+
t8 = () => state.current;
|
|
175
|
+
$[7] = t8;
|
|
176
|
+
} else t8 = $[7];
|
|
177
|
+
const getState = t8;
|
|
178
|
+
let t9;
|
|
179
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
180
|
+
t9 = async (event_0) => {
|
|
181
|
+
if (!shouldReactToEvent(event_0)) return;
|
|
182
|
+
rippleStartEvent.current = event_0;
|
|
183
|
+
const target_0 = event_0.currentTarget;
|
|
184
|
+
if (!isTouch(event_0)) {
|
|
185
|
+
state.current = RippleState.WaitingForClick;
|
|
186
|
+
startPressAnimation(target_0, event_0);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
state.current = RippleState.TouchDelay;
|
|
190
|
+
await new Promise(_temp);
|
|
191
|
+
if (getState() !== RippleState.TouchDelay) return;
|
|
192
|
+
state.current = RippleState.Holding;
|
|
193
|
+
startPressAnimation(target_0, event_0);
|
|
194
|
+
};
|
|
195
|
+
$[8] = t9;
|
|
196
|
+
} else t9 = $[8];
|
|
197
|
+
const handlePointerDownAsync = t9;
|
|
198
|
+
let t10;
|
|
199
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
200
|
+
t10 = (event_1) => {
|
|
201
|
+
handlePointerDownAsync(event_1);
|
|
202
|
+
};
|
|
203
|
+
$[9] = t10;
|
|
204
|
+
} else t10 = $[9];
|
|
205
|
+
const handlePointerDown = t10;
|
|
206
|
+
let t11;
|
|
207
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
208
|
+
t11 = (event_2) => {
|
|
209
|
+
if (!shouldReactToEvent(event_2)) return;
|
|
210
|
+
if (state.current === RippleState.Holding) {
|
|
211
|
+
state.current = RippleState.WaitingForClick;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (state.current === RippleState.TouchDelay) {
|
|
215
|
+
state.current = RippleState.WaitingForClick;
|
|
216
|
+
startPressAnimation(event_2.currentTarget, rippleStartEvent.current);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
$[10] = t11;
|
|
220
|
+
} else t11 = $[10];
|
|
221
|
+
const handlePointerUp = t11;
|
|
222
|
+
let t12;
|
|
223
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
224
|
+
t12 = (event_3) => {
|
|
225
|
+
if (isTouch(event_3) || !shouldReactToEvent(event_3)) return;
|
|
226
|
+
if (state.current !== RippleState.Inactive) endPressAnimation();
|
|
227
|
+
};
|
|
228
|
+
$[11] = t12;
|
|
229
|
+
} else t12 = $[11];
|
|
230
|
+
const handlePointerLeave = t12;
|
|
231
|
+
let t13;
|
|
232
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
233
|
+
t13 = (event_4) => {
|
|
234
|
+
if (!shouldReactToEvent(event_4)) return;
|
|
235
|
+
endPressAnimation();
|
|
236
|
+
};
|
|
237
|
+
$[12] = t13;
|
|
238
|
+
} else t13 = $[12];
|
|
239
|
+
const handlePointerCancel = t13;
|
|
240
|
+
let t14;
|
|
241
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
242
|
+
t14 = (event_5) => {
|
|
243
|
+
if (state.current === RippleState.WaitingForClick) {
|
|
244
|
+
endPressAnimation();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (state.current === RippleState.Inactive) {
|
|
248
|
+
startPressAnimation(event_5.currentTarget);
|
|
249
|
+
endPressAnimation();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
$[13] = t14;
|
|
253
|
+
} else t14 = $[13];
|
|
254
|
+
const handleClick = t14;
|
|
255
|
+
let t15;
|
|
256
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
257
|
+
t15 = () => {
|
|
258
|
+
endPressAnimation();
|
|
259
|
+
};
|
|
260
|
+
$[14] = t15;
|
|
261
|
+
} else t15 = $[14];
|
|
262
|
+
const handleContextMenu = t15;
|
|
263
|
+
const { onClick: onClickProp, onContextMenu: onContextMenuProp, onPointerCancel: onPointerCancelProp, onPointerDown: onPointerDownProp, onPointerLeave: onPointerLeaveProp, onPointerUp: onPointerUpProp } = externalHandlers;
|
|
264
|
+
let t16;
|
|
265
|
+
if ($[15] !== onClickProp) {
|
|
266
|
+
t16 = (event_6) => {
|
|
267
|
+
handleClick(event_6);
|
|
268
|
+
onClickProp?.(event_6);
|
|
269
|
+
};
|
|
270
|
+
$[15] = onClickProp;
|
|
271
|
+
$[16] = t16;
|
|
272
|
+
} else t16 = $[16];
|
|
273
|
+
const onClick = t16;
|
|
274
|
+
let t17;
|
|
275
|
+
if ($[17] !== onContextMenuProp) {
|
|
276
|
+
t17 = (event_7) => {
|
|
277
|
+
handleContextMenu();
|
|
278
|
+
onContextMenuProp?.(event_7);
|
|
279
|
+
};
|
|
280
|
+
$[17] = onContextMenuProp;
|
|
281
|
+
$[18] = t17;
|
|
282
|
+
} else t17 = $[18];
|
|
283
|
+
const onContextMenu = t17;
|
|
284
|
+
let t18;
|
|
285
|
+
if ($[19] !== onPointerCancelProp) {
|
|
286
|
+
t18 = (event_8) => {
|
|
287
|
+
handlePointerCancel(event_8);
|
|
288
|
+
onPointerCancelProp?.(event_8);
|
|
289
|
+
};
|
|
290
|
+
$[19] = onPointerCancelProp;
|
|
291
|
+
$[20] = t18;
|
|
292
|
+
} else t18 = $[20];
|
|
293
|
+
const onPointerCancel = t18;
|
|
294
|
+
let t19;
|
|
295
|
+
if ($[21] !== onPointerDownProp) {
|
|
296
|
+
t19 = (event_9) => {
|
|
297
|
+
handlePointerDown(event_9);
|
|
298
|
+
onPointerDownProp?.(event_9);
|
|
299
|
+
};
|
|
300
|
+
$[21] = onPointerDownProp;
|
|
301
|
+
$[22] = t19;
|
|
302
|
+
} else t19 = $[22];
|
|
303
|
+
const onPointerDown = t19;
|
|
304
|
+
let t20;
|
|
305
|
+
if ($[23] !== onPointerLeaveProp) {
|
|
306
|
+
t20 = (event_10) => {
|
|
307
|
+
handlePointerLeave(event_10);
|
|
308
|
+
onPointerLeaveProp?.(event_10);
|
|
309
|
+
};
|
|
310
|
+
$[23] = onPointerLeaveProp;
|
|
311
|
+
$[24] = t20;
|
|
312
|
+
} else t20 = $[24];
|
|
313
|
+
const onPointerLeave = t20;
|
|
314
|
+
let t21;
|
|
315
|
+
if ($[25] !== onPointerUpProp) {
|
|
316
|
+
t21 = (event_11) => {
|
|
317
|
+
handlePointerUp(event_11);
|
|
318
|
+
onPointerUpProp?.(event_11);
|
|
319
|
+
};
|
|
320
|
+
$[25] = onPointerUpProp;
|
|
321
|
+
$[26] = t21;
|
|
322
|
+
} else t21 = $[26];
|
|
323
|
+
const onPointerUp = t21;
|
|
324
|
+
let t22;
|
|
325
|
+
if ($[27] !== onClick || $[28] !== onContextMenu || $[29] !== onPointerCancel || $[30] !== onPointerDown || $[31] !== onPointerLeave || $[32] !== onPointerUp) {
|
|
326
|
+
t22 = {
|
|
327
|
+
onClick,
|
|
328
|
+
onContextMenu,
|
|
329
|
+
onPointerCancel,
|
|
330
|
+
onPointerDown,
|
|
331
|
+
onPointerLeave,
|
|
332
|
+
onPointerUp
|
|
333
|
+
};
|
|
334
|
+
$[27] = onClick;
|
|
335
|
+
$[28] = onContextMenu;
|
|
336
|
+
$[29] = onPointerCancel;
|
|
337
|
+
$[30] = onPointerDown;
|
|
338
|
+
$[31] = onPointerLeave;
|
|
339
|
+
$[32] = onPointerUp;
|
|
340
|
+
$[33] = t22;
|
|
341
|
+
} else t22 = $[33];
|
|
342
|
+
const handlers = t22;
|
|
343
|
+
let t23;
|
|
344
|
+
if ($[34] !== pressed) {
|
|
345
|
+
t23 = require_stylex.props(require_ripple.rippleStyles.press, pressed && require_ripple.rippleStyles.pressed);
|
|
346
|
+
$[34] = pressed;
|
|
347
|
+
$[35] = t23;
|
|
348
|
+
} else t23 = $[35];
|
|
349
|
+
let t24;
|
|
350
|
+
if ($[36] !== t23) {
|
|
351
|
+
t24 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
352
|
+
"aria-hidden": "true",
|
|
353
|
+
...surfaceProps,
|
|
354
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
355
|
+
ref: rippleRef,
|
|
356
|
+
...t23
|
|
357
|
+
})
|
|
358
|
+
});
|
|
359
|
+
$[36] = t23;
|
|
360
|
+
$[37] = t24;
|
|
361
|
+
} else t24 = $[37];
|
|
362
|
+
const surface = t24;
|
|
363
|
+
let t25;
|
|
364
|
+
if ($[38] !== handlers || $[39] !== surface) {
|
|
365
|
+
t25 = {
|
|
366
|
+
handlers,
|
|
367
|
+
surface
|
|
368
|
+
};
|
|
369
|
+
$[38] = handlers;
|
|
370
|
+
$[39] = surface;
|
|
371
|
+
$[40] = t25;
|
|
372
|
+
} else t25 = $[40];
|
|
373
|
+
const enabledResult = t25;
|
|
374
|
+
let t26;
|
|
375
|
+
if ($[41] !== externalHandlers) {
|
|
376
|
+
t26 = {
|
|
377
|
+
handlers: externalHandlers,
|
|
378
|
+
surface: null
|
|
379
|
+
};
|
|
380
|
+
$[41] = externalHandlers;
|
|
381
|
+
$[42] = t26;
|
|
382
|
+
} else t26 = $[42];
|
|
383
|
+
return enabled ? enabledResult : t26;
|
|
384
|
+
}
|
|
385
|
+
function _temp(resolve_0) {
|
|
386
|
+
setTimeout(resolve_0, require_values.motionDurationMs.short2);
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
exports.useRipple = useRipple;
|
|
390
|
+
|
|
391
|
+
//# sourceMappingURL=useRipple.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRipple.cjs","names":["rect","width","size","height","positionEvent","startPoint","endPoint","event","target","rippleRef","resolve"],"sources":["../../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ninterface RippleEventHandlers<HostElement extends HTMLElement> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * `handlers` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\nfunction useRipple<HostElement extends HTMLElement = HTMLElement>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}): {\n handlers: RippleEventHandlers<HostElement>;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n if (startEvent && startEvent.pointerId !== event.pointerId) {\n return false;\n }\n return isTouch(event) || event.buttons === 1;\n }, []);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: HostElement, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // target's rect, and a second `getBoundingClientRect()` call back to\n // back with the first would be a redundant layout read.\n const rect = target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n duration: motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n return;\n }\n if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n }, [shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => ({\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }), [onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n surface\n }), [handlers, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n surface: null\n }), [externalHandlers]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAM,UAAU,eAAA,UAAU;AAI1B,MAAM,uBAAuB;AAC7B,MAAM,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GAAkB,eAAA;GAAM,GAAK;GACrD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAA,QAAA;IAAWE,KAAA;IAAS,GAAM;GAAiE,CAAA;EACtF,CAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAFX,MAAA,UAA8B;CAEN,IAAA;CAAA,IAAA,EAAA,QAAA,YAAA,EAAA,QAAA,SAAA;EAOa,MAAA;GAAA;GAAA;EAGrC;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAHD,MAAA,gBAAqC;CAGZ,IAAA;CAAA,IAAA,EAAA,QAAA,kBAAA;EACa,MAAA;GAAA,UAC1B;GAAgB,SACjB;EACX;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,MAAA,EAAA;CAAuB,OACjB,UAAA,gBAAA;AAAwC;AAxPjD,SAAA,MAAA,WAAA;CAwIM,WAAWC,WAAS,eAAA,iBAAgB,MAAO;AAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_index = require("./components/avatar/index.cjs");
|
|
3
|
+
const require_index$1 = require("./components/badge/index.cjs");
|
|
4
|
+
const require_index$2 = require("./components/button/index.cjs");
|
|
5
|
+
const require_index$3 = require("./components/card/index.cjs");
|
|
6
|
+
const require_index$4 = require("./components/chip/index.cjs");
|
|
7
|
+
const require_index$5 = require("./components/currency/index.cjs");
|
|
8
|
+
const require_index$6 = require("./components/icon-button/index.cjs");
|
|
9
|
+
const require_index$7 = require("./components/link/index.cjs");
|
|
10
|
+
const require_index$8 = require("./components/list-item/index.cjs");
|
|
11
|
+
const require_index$9 = require("./components/separator/index.cjs");
|
|
12
|
+
const require_index$10 = require("./components/sheet/index.cjs");
|
|
13
|
+
const require_index$11 = require("./components/tabs/index.cjs");
|
|
14
|
+
const require_index$12 = require("./components/text/index.cjs");
|
|
15
|
+
const require_index$13 = require("./components/text-field/index.cjs");
|
|
16
|
+
exports.Avatar = require_index.default;
|
|
17
|
+
exports.Badge = require_index$1.default;
|
|
18
|
+
exports.Button = require_index$2.default;
|
|
19
|
+
exports.Card = require_index$3.default;
|
|
20
|
+
exports.Chip = require_index$4.default;
|
|
21
|
+
exports.Currency = require_index$5.default;
|
|
22
|
+
exports.IconButton = require_index$6.default;
|
|
23
|
+
exports.Link = require_index$7.default;
|
|
24
|
+
exports.ListItem = require_index$8.default;
|
|
25
|
+
exports.Separator = require_index$9.default;
|
|
26
|
+
exports.Sheet = require_index$10.default;
|
|
27
|
+
exports.Tabs = require_index$11.default;
|
|
28
|
+
exports.Text = require_index$12.default;
|
|
29
|
+
exports.TextField = require_index$13.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Avatar, { AvatarProps } from "./components/avatar/index.cjs";
|
|
2
|
+
import Badge, { BadgeProps } from "./components/badge/index.cjs";
|
|
3
|
+
import Button, { ButtonProps } from "./components/button/index.cjs";
|
|
4
|
+
import Card, { CardProps } from "./components/card/index.cjs";
|
|
5
|
+
import Chip, { ChipProps } from "./components/chip/index.cjs";
|
|
6
|
+
import Currency, { CurrencyProps } from "./components/currency/index.cjs";
|
|
7
|
+
import IconButton, { IconButtonProps } from "./components/icon-button/index.cjs";
|
|
8
|
+
import Link, { LinkProps } from "./components/link/index.cjs";
|
|
9
|
+
import ListItem, { ListItemProps } from "./components/list-item/index.cjs";
|
|
10
|
+
import Separator, { SeparatorProps } from "./components/separator/index.cjs";
|
|
11
|
+
import Sheet, { SheetProps } from "./components/sheet/index.cjs";
|
|
12
|
+
import Tabs, { TabsProps } from "./components/tabs/index.cjs";
|
|
13
|
+
import Text, { TextProps } from "./components/text/index.cjs";
|
|
14
|
+
import TextField, { TextFieldProps } from "./components/text-field/index.cjs";
|
|
15
|
+
import "./components/index.cjs";
|
|
16
|
+
export { Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Chip, type ChipProps, Currency, type CurrencyProps, IconButton, type IconButtonProps, Link, type LinkProps, ListItem, type ListItemProps, Separator, type SeparatorProps, Sheet, type SheetProps, Tabs, type TabsProps, Text, TextField, type TextFieldProps, type TextProps };
|