@seed-design/react 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/ActionButton/ActionButton.cjs +7 -1
- package/lib/components/ActionButton/ActionButton.d.ts +7 -1
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +7 -1
- package/lib/components/BottomSheet/BottomSheet.cjs +14 -18
- package/lib/components/BottomSheet/BottomSheet.d.ts +12 -19
- package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/components/BottomSheet/BottomSheet.js +14 -18
- package/lib/components/BottomSheet/BottomSheet.namespace.cjs +2 -0
- package/lib/components/BottomSheet/BottomSheet.namespace.d.ts +1 -0
- package/lib/components/BottomSheet/BottomSheet.namespace.d.ts.map +1 -1
- package/lib/components/BottomSheet/BottomSheet.namespace.js +1 -0
- package/lib/components/BottomSheetHandle/BottomSheetHandle.cjs +20 -0
- package/lib/components/BottomSheetHandle/BottomSheetHandle.d.ts +6 -0
- package/lib/components/BottomSheetHandle/BottomSheetHandle.d.ts.map +1 -0
- package/lib/components/BottomSheetHandle/BottomSheetHandle.js +16 -0
- package/lib/components/BottomSheetHandle/index.cjs +9 -0
- package/lib/components/BottomSheetHandle/index.d.ts +2 -0
- package/lib/components/BottomSheetHandle/index.d.ts.map +1 -0
- package/lib/components/BottomSheetHandle/index.js +1 -0
- package/lib/components/Chip/Chip.cjs +4 -3
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Chip/Chip.js +4 -3
- package/lib/components/Field/Field.cjs +108 -0
- package/lib/components/Field/Field.d.ts +41 -0
- package/lib/components/Field/Field.d.ts.map +1 -0
- package/lib/components/Field/Field.js +96 -0
- package/lib/components/Field/Field.namespace.cjs +17 -0
- package/lib/components/Field/Field.namespace.d.ts +2 -0
- package/lib/components/Field/Field.namespace.d.ts.map +1 -0
- package/lib/components/Field/Field.namespace.js +1 -0
- package/lib/components/Field/index.cjs +19 -0
- package/lib/components/Field/index.d.ts +3 -0
- package/lib/components/Field/index.d.ts.map +1 -0
- package/lib/components/Field/index.js +3 -0
- package/lib/components/FieldButton/FieldButton.cjs +201 -0
- package/lib/components/FieldButton/FieldButton.d.ts +61 -0
- package/lib/components/FieldButton/FieldButton.d.ts.map +1 -0
- package/lib/components/FieldButton/FieldButton.js +161 -0
- package/lib/components/FieldButton/FieldButton.namespace.cjs +26 -0
- package/lib/components/FieldButton/FieldButton.namespace.d.ts +2 -0
- package/lib/components/FieldButton/FieldButton.namespace.d.ts.map +1 -0
- package/lib/components/FieldButton/FieldButton.namespace.js +1 -0
- package/lib/components/FieldButton/index.cjs +28 -0
- package/lib/components/FieldButton/index.d.ts +3 -0
- package/lib/components/FieldButton/index.d.ts.map +1 -0
- package/lib/components/FieldButton/index.js +3 -0
- package/lib/components/HelpBubble/HelpBubble.d.ts +1 -1
- package/lib/components/List/List.cjs +5 -4
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js +5 -4
- package/lib/components/PageBanner/PageBanner.cjs +8 -3
- package/lib/components/PageBanner/PageBanner.d.ts +5 -2
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.js +7 -3
- package/lib/components/PageBanner/PageBanner.namespace.cjs +2 -1
- package/lib/components/PageBanner/PageBanner.namespace.d.ts +1 -1
- package/lib/components/PageBanner/PageBanner.namespace.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.namespace.js +1 -1
- package/lib/components/PageBanner/index.cjs +2 -1
- package/lib/components/PageBanner/index.d.ts +1 -1
- package/lib/components/PageBanner/index.d.ts.map +1 -1
- package/lib/components/PageBanner/index.js +1 -1
- package/lib/components/Slider/Slider.cjs +110 -0
- package/lib/components/Slider/Slider.d.ts +51 -0
- package/lib/components/Slider/Slider.d.ts.map +1 -0
- package/lib/components/Slider/Slider.js +94 -0
- package/lib/components/Slider/Slider.namespace.cjs +21 -0
- package/lib/components/Slider/Slider.namespace.d.ts +2 -0
- package/lib/components/Slider/Slider.namespace.d.ts.map +1 -0
- package/lib/components/Slider/Slider.namespace.js +1 -0
- package/lib/components/Slider/index.cjs +23 -0
- package/lib/components/Slider/index.d.ts +3 -0
- package/lib/components/Slider/index.d.ts.map +1 -0
- package/lib/components/Slider/index.js +3 -0
- package/lib/components/TextField/TextField.cjs +54 -74
- package/lib/components/TextField/TextField.d.ts +2 -35
- package/lib/components/TextField/TextField.d.ts.map +1 -1
- package/lib/components/TextField/TextField.js +56 -65
- package/lib/components/TextField/TextField.namespace.cjs +0 -11
- package/lib/components/TextField/TextField.namespace.d.ts +1 -1
- package/lib/components/TextField/TextField.namespace.d.ts.map +1 -1
- package/lib/components/TextField/TextField.namespace.js +1 -1
- package/lib/components/TextField/TextField.test.d.ts +1 -0
- package/lib/components/TextField/TextField.test.d.ts.map +1 -0
- package/lib/components/TextField/index.cjs +2 -11
- package/lib/components/TextField/index.d.ts +2 -1
- package/lib/components/TextField/index.d.ts.map +1 -1
- package/lib/components/TextField/index.js +2 -1
- package/lib/components/TextField/memoize.cjs +18 -0
- package/lib/components/TextField/memoize.d.ts +2 -0
- package/lib/components/TextField/memoize.d.ts.map +1 -0
- package/lib/components/TextField/memoize.js +14 -0
- package/lib/components/TextField/useTextFieldWithGraphemes.cjs +52 -0
- package/lib/components/TextField/useTextFieldWithGraphemes.d.ts +23 -0
- package/lib/components/TextField/useTextFieldWithGraphemes.d.ts.map +1 -0
- package/lib/components/TextField/useTextFieldWithGraphemes.js +48 -0
- package/lib/components/TextField/useTextFieldWithGraphemes.test.d.ts +1 -0
- package/lib/components/TextField/useTextFieldWithGraphemes.test.d.ts.map +1 -0
- package/lib/components/index.cjs +53 -12
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +12 -2
- package/lib/index.cjs +53 -12
- package/lib/index.js +12 -2
- package/lib/node_modules/unicode-segmenter/_grapheme_data.cjs +23 -0
- package/lib/node_modules/unicode-segmenter/_grapheme_data.js +19 -0
- package/lib/node_modules/unicode-segmenter/_incb_data.cjs +29 -0
- package/lib/node_modules/unicode-segmenter/_incb_data.js +25 -0
- package/lib/node_modules/unicode-segmenter/core.cjs +83 -0
- package/lib/node_modules/unicode-segmenter/core.js +78 -0
- package/lib/node_modules/unicode-segmenter/grapheme.cjs +312 -0
- package/lib/node_modules/unicode-segmenter/grapheme.js +307 -0
- package/lib/primitive.cjs +7 -0
- package/lib/primitive.d.ts +1 -0
- package/lib/primitive.d.ts.map +1 -1
- package/lib/primitive.js +1 -0
- package/lib/utils/createWithStateProps.cjs +8 -4
- package/lib/utils/createWithStateProps.d.ts +6 -3
- package/lib/utils/createWithStateProps.d.ts.map +1 -1
- package/lib/utils/createWithStateProps.js +8 -4
- package/package.json +9 -6
- package/src/components/ActionButton/ActionButton.tsx +21 -2
- package/src/components/BottomSheet/BottomSheet.namespace.ts +5 -0
- package/src/components/BottomSheet/BottomSheet.tsx +24 -38
- package/src/components/BottomSheetHandle/BottomSheetHandle.tsx +22 -0
- package/src/components/BottomSheetHandle/index.ts +1 -0
- package/src/components/Chip/Chip.tsx +4 -3
- package/src/components/Field/Field.namespace.ts +19 -0
- package/src/components/Field/Field.tsx +136 -0
- package/src/components/Field/index.ts +21 -0
- package/src/components/FieldButton/FieldButton.namespace.ts +38 -0
- package/src/components/FieldButton/FieldButton.tsx +249 -0
- package/src/components/FieldButton/index.ts +40 -0
- package/src/components/HelpBubble/HelpBubble.tsx +1 -1
- package/src/components/List/List.tsx +5 -4
- package/src/components/PageBanner/PageBanner.namespace.ts +4 -2
- package/src/components/PageBanner/PageBanner.tsx +10 -3
- package/src/components/PageBanner/index.ts +4 -2
- package/src/components/Slider/Slider.namespace.ts +28 -0
- package/src/components/Slider/Slider.tsx +154 -0
- package/src/components/Slider/index.ts +30 -0
- package/src/components/TextField/TextField.namespace.ts +2 -24
- package/src/components/TextField/TextField.test.tsx +260 -0
- package/src/components/TextField/TextField.tsx +67 -143
- package/src/components/TextField/index.ts +7 -24
- package/src/components/TextField/memoize.ts +14 -0
- package/src/components/TextField/useTextFieldWithGraphemes.test.tsx +301 -0
- package/src/components/TextField/useTextFieldWithGraphemes.ts +65 -0
- package/src/components/index.ts +3 -0
- package/src/primitive.ts +1 -0
- package/src/utils/createWithStateProps.tsx +14 -9
- package/lib/components/List/ListHeader.namespace.d.ts +0 -2
- package/lib/components/List/ListHeader.namespace.d.ts.map +0 -1
- package/src/components/List/ListHeader.namespace.ts +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
4
|
+
import { Field, useFieldContext } from '@seed-design/react-field';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
7
|
+
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
8
|
+
import { field } from '@seed-design/css/recipes/field';
|
|
9
|
+
import { fieldLabel } from '@seed-design/css/recipes/field-label';
|
|
10
|
+
import { InternalIcon } from '../private/Icon.js';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
|
|
13
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext(field);
|
|
14
|
+
const {
|
|
15
|
+
withContext: withLabelContext,
|
|
16
|
+
withProvider: withLabelProvider,
|
|
17
|
+
useClassNames: useLabelClassNames
|
|
18
|
+
} = createSlotRecipeContext(fieldLabel);
|
|
19
|
+
const withStateProps = createWithStateProps([useFieldContext]);
|
|
20
|
+
const FieldRoot = withProvider(Field.Root, "root");
|
|
21
|
+
const FieldHeader = withContext(
|
|
22
|
+
withStateProps(Primitive.div),
|
|
23
|
+
"header"
|
|
24
|
+
);
|
|
25
|
+
const FieldLabel = withLabelProvider(Field.Label, "root");
|
|
26
|
+
const FieldIndicatorText = withLabelContext(
|
|
27
|
+
withStateProps(Primitive.span),
|
|
28
|
+
"indicatorText"
|
|
29
|
+
);
|
|
30
|
+
const FieldRequiredIndicator = forwardRef(
|
|
31
|
+
({ className, ...props }, ref) => {
|
|
32
|
+
const { indicatorIcon } = useLabelClassNames();
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
InternalIcon,
|
|
35
|
+
{
|
|
36
|
+
svg: (
|
|
37
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: InternalIcon is aria-hidden
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
"svg",
|
|
40
|
+
{
|
|
41
|
+
viewBox: "0 0 6 6",
|
|
42
|
+
fill: "none",
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
className: clsx(indicatorIcon, className),
|
|
45
|
+
children: /* @__PURE__ */ jsx(
|
|
46
|
+
"path",
|
|
47
|
+
{
|
|
48
|
+
d: "M3.75002 1.55859L4.41318 1.09468C4.75243 0.857361 5.21982 0.939865 5.45732 1.27899C5.69499 1.61836 5.61243 2.08615 5.27295 2.32366L4.30763 2.99902L5.27372 3.67612C5.61285 3.91381 5.69517 4.38137 5.45761 4.72059C5.21999 5.0599 4.7523 5.14233 4.41299 4.90471L3.75002 4.44043V5.25C3.75002 5.66421 3.41423 6 3.00002 6C2.5858 6 2.25002 5.66421 2.25002 5.25V4.44043L1.58704 4.90471C1.24773 5.14233 0.780041 5.0599 0.542418 4.72059C0.304856 4.38137 0.387176 3.91381 0.726309 3.67612L1.6924 2.99902L0.727079 2.32366C0.387603 2.08615 0.305043 1.61836 0.542707 1.27899C0.780206 0.939865 1.2476 0.857361 1.58685 1.09468L2.25002 1.55859V0.75C2.25002 0.335786 2.5858 0 3.00002 0C3.41423 0 3.75002 0.335786 3.75002 0.75V1.55859Z",
|
|
49
|
+
fill: "currentColor"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
),
|
|
55
|
+
ref,
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const FieldFooter = withContext(
|
|
62
|
+
withStateProps(Primitive.div),
|
|
63
|
+
"footer"
|
|
64
|
+
);
|
|
65
|
+
const FieldDescription = withContext(
|
|
66
|
+
Field.Description,
|
|
67
|
+
"description"
|
|
68
|
+
);
|
|
69
|
+
const FieldErrorMessage = withContext(
|
|
70
|
+
Field.ErrorMessage,
|
|
71
|
+
"errorMessage"
|
|
72
|
+
);
|
|
73
|
+
const FieldCharacterCount = forwardRef(
|
|
74
|
+
({ current, max, ...otherProps }, ref) => {
|
|
75
|
+
const classNames = useClassNames();
|
|
76
|
+
const { stateProps } = useFieldContext();
|
|
77
|
+
return /* @__PURE__ */ jsxs(Primitive.div, { ref, ...otherProps, children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
...current === 0 ? { "data-empty": true } : {},
|
|
82
|
+
...current > max ? { "data-exceeded": true } : {},
|
|
83
|
+
className: classNames.characterCount,
|
|
84
|
+
...stateProps,
|
|
85
|
+
children: current
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsxs("span", { className: classNames.maxCharacterCount, ...stateProps, children: [
|
|
89
|
+
"/",
|
|
90
|
+
max
|
|
91
|
+
] })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
export { FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const Field = require('./Field.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.CharacterCount = Field.FieldCharacterCount;
|
|
10
|
+
exports.Description = Field.FieldDescription;
|
|
11
|
+
exports.ErrorMessage = Field.FieldErrorMessage;
|
|
12
|
+
exports.Footer = Field.FieldFooter;
|
|
13
|
+
exports.Header = Field.FieldHeader;
|
|
14
|
+
exports.IndicatorText = Field.FieldIndicatorText;
|
|
15
|
+
exports.Label = Field.FieldLabel;
|
|
16
|
+
exports.RequiredIndicator = Field.FieldRequiredIndicator;
|
|
17
|
+
exports.Root = Field.FieldRoot;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { FieldRoot as Root, FieldHeader as Header, FieldLabel as Label, FieldIndicatorText as IndicatorText, FieldRequiredIndicator as RequiredIndicator, FieldFooter as Footer, FieldDescription as Description, FieldErrorMessage as ErrorMessage, FieldCharacterCount as CharacterCount, type FieldRootProps as RootProps, type FieldHeaderProps as HeaderProps, type FieldLabelProps as LabelProps, type FieldIndicatorTextProps as IndicatorTextProps, type FieldFooterProps as FooterProps, type FieldDescriptionProps as DescriptionProps, type FieldErrorMessageProps as ErrorMessageProps, type FieldCharacterCountProps as CharacterCountProps, } from './Field';
|
|
2
|
+
//# sourceMappingURL=Field.namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,IAAI,EACjB,WAAW,IAAI,MAAM,EACrB,UAAU,IAAI,KAAK,EACnB,kBAAkB,IAAI,aAAa,EACnC,sBAAsB,IAAI,iBAAiB,EAC3C,WAAW,IAAI,MAAM,EACrB,gBAAgB,IAAI,WAAW,EAC/B,iBAAiB,IAAI,YAAY,EACjC,mBAAmB,IAAI,cAAc,EACrC,KAAK,cAAc,IAAI,SAAS,EAChC,KAAK,gBAAgB,IAAI,WAAW,EACpC,KAAK,eAAe,IAAI,UAAU,EAClC,KAAK,uBAAuB,IAAI,kBAAkB,EAClD,KAAK,gBAAgB,IAAI,WAAW,EACpC,KAAK,qBAAqB,IAAI,gBAAgB,EAC9C,KAAK,sBAAsB,IAAI,iBAAiB,EAChD,KAAK,wBAAwB,IAAI,mBAAmB,GACrD,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FieldCharacterCount as CharacterCount, FieldDescription as Description, FieldErrorMessage as ErrorMessage, FieldFooter as Footer, FieldHeader as Header, FieldIndicatorText as IndicatorText, FieldLabel as Label, FieldRequiredIndicator as RequiredIndicator, FieldRoot as Root } from './Field.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const Field = require('./Field.cjs');
|
|
6
|
+
const Field_namespace = require('./Field.namespace.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.FieldCharacterCount = Field.FieldCharacterCount;
|
|
11
|
+
exports.FieldDescription = Field.FieldDescription;
|
|
12
|
+
exports.FieldErrorMessage = Field.FieldErrorMessage;
|
|
13
|
+
exports.FieldFooter = Field.FieldFooter;
|
|
14
|
+
exports.FieldHeader = Field.FieldHeader;
|
|
15
|
+
exports.FieldIndicatorText = Field.FieldIndicatorText;
|
|
16
|
+
exports.FieldLabel = Field.FieldLabel;
|
|
17
|
+
exports.FieldRequiredIndicator = Field.FieldRequiredIndicator;
|
|
18
|
+
exports.FieldRoot = Field.FieldRoot;
|
|
19
|
+
exports.Field = Field_namespace;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FieldRoot, FieldHeader, FieldLabel, FieldIndicatorText, FieldRequiredIndicator, FieldFooter, FieldDescription, FieldErrorMessage, FieldCharacterCount, type FieldRootProps, type FieldHeaderProps, type FieldLabelProps, type FieldIndicatorTextProps, type FieldFooterProps, type FieldDescriptionProps, type FieldErrorMessageProps, type FieldCharacterCountProps, } from './Field';
|
|
2
|
+
export * as Field from './Field.namespace';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,GAC9B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot } from './Field.js';
|
|
2
|
+
import * as Field_namespace from './Field.namespace.js';
|
|
3
|
+
export { Field_namespace as Field };
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const reactPrimitive = require('@seed-design/react-primitive');
|
|
8
|
+
const reactFieldButton = require('@seed-design/react-field-button');
|
|
9
|
+
const React = require('react');
|
|
10
|
+
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
11
|
+
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
12
|
+
const field = require('@seed-design/css/recipes/field');
|
|
13
|
+
const fieldLabel = require('@seed-design/css/recipes/field-label');
|
|
14
|
+
const Icon = require('../private/Icon.cjs');
|
|
15
|
+
const inputButton = require('@seed-design/css/recipes/input-button');
|
|
16
|
+
const clsx = require('clsx');
|
|
17
|
+
|
|
18
|
+
function _interopNamespaceDefault(e) {
|
|
19
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
20
|
+
if (e) {
|
|
21
|
+
for (const k in e) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: () => e[k]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
n.default = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
36
|
+
|
|
37
|
+
const { withContext: withFieldContext, withProvider: withFieldProvider } = createSlotRecipeContext.createSlotRecipeContext(field.field);
|
|
38
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext.createSlotRecipeContext(inputButton.inputButton);
|
|
39
|
+
const {
|
|
40
|
+
withProvider: withLabelProvider,
|
|
41
|
+
withContext: withLabelContext,
|
|
42
|
+
useClassNames: useLabelClassNames
|
|
43
|
+
} = createSlotRecipeContext.createSlotRecipeContext(fieldLabel.fieldLabel);
|
|
44
|
+
const withStateProps = createWithStateProps.createWithStateProps([reactFieldButton.useFieldButtonContext]);
|
|
45
|
+
const FieldButtonRoot = withFieldProvider(
|
|
46
|
+
reactFieldButton.FieldButton.Root,
|
|
47
|
+
"root"
|
|
48
|
+
);
|
|
49
|
+
const FieldButtonHeader = withFieldContext(
|
|
50
|
+
withStateProps(reactPrimitive.Primitive.div),
|
|
51
|
+
"header"
|
|
52
|
+
);
|
|
53
|
+
const FieldButtonLabel = withLabelProvider(
|
|
54
|
+
withStateProps(reactPrimitive.Primitive.div),
|
|
55
|
+
"root"
|
|
56
|
+
);
|
|
57
|
+
const FieldButtonIndicatorText = withLabelContext(withStateProps(reactPrimitive.Primitive.span), "indicatorText");
|
|
58
|
+
const FieldButtonRequiredIndicator = React__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
59
|
+
const { indicatorIcon } = useLabelClassNames();
|
|
60
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
Icon.InternalIcon,
|
|
62
|
+
{
|
|
63
|
+
svg: (
|
|
64
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: InternalIcon is aria-hidden
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
+
"svg",
|
|
67
|
+
{
|
|
68
|
+
viewBox: "0 0 6 6",
|
|
69
|
+
fill: "none",
|
|
70
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
+
className: clsx(indicatorIcon, className),
|
|
72
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
"path",
|
|
74
|
+
{
|
|
75
|
+
d: "M3.75002 1.55859L4.41318 1.09468C4.75243 0.857361 5.21982 0.939865 5.45732 1.27899C5.69499 1.61836 5.61243 2.08615 5.27295 2.32366L4.30763 2.99902L5.27372 3.67612C5.61285 3.91381 5.69517 4.38137 5.45761 4.72059C5.21999 5.0599 4.7523 5.14233 4.41299 4.90471L3.75002 4.44043V5.25C3.75002 5.66421 3.41423 6 3.00002 6C2.5858 6 2.25002 5.66421 2.25002 5.25V4.44043L1.58704 4.90471C1.24773 5.14233 0.780041 5.0599 0.542418 4.72059C0.304856 4.38137 0.387176 3.91381 0.726309 3.67612L1.6924 2.99902L0.727079 2.32366C0.387603 2.08615 0.305043 1.61836 0.542707 1.27899C0.780206 0.939865 1.2476 0.857361 1.58685 1.09468L2.25002 1.55859V0.75C2.25002 0.335786 2.5858 0 3.00002 0C3.41423 0 3.75002 0.335786 3.75002 0.75V1.55859Z",
|
|
76
|
+
fill: "currentColor"
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
),
|
|
82
|
+
ref,
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
FieldButtonRequiredIndicator.displayName = "FieldButtonRequiredIndicator";
|
|
88
|
+
const FieldButtonPrefixIcon = withContext(
|
|
89
|
+
withStateProps(Icon.InternalIcon),
|
|
90
|
+
"prefixIcon"
|
|
91
|
+
);
|
|
92
|
+
const FieldButtonPrefixText = React__namespace.forwardRef(
|
|
93
|
+
({ className, ...props }, ref) => {
|
|
94
|
+
const { stateProps } = reactFieldButton.useFieldButtonContext();
|
|
95
|
+
const { prefixText } = useClassNames();
|
|
96
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
+
reactPrimitive.Primitive.span,
|
|
98
|
+
{
|
|
99
|
+
className: clsx(prefixText, className),
|
|
100
|
+
ref,
|
|
101
|
+
"aria-hidden": true,
|
|
102
|
+
...stateProps,
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
FieldButtonPrefixText.displayName = "FieldButtonPrefixText";
|
|
109
|
+
const FieldButtonSuffixIcon = withContext(
|
|
110
|
+
withStateProps(Icon.InternalIcon),
|
|
111
|
+
"suffixIcon"
|
|
112
|
+
);
|
|
113
|
+
const FieldButtonSuffixText = React__namespace.forwardRef(
|
|
114
|
+
({ className, ...props }, ref) => {
|
|
115
|
+
const { stateProps } = reactFieldButton.useFieldButtonContext();
|
|
116
|
+
const { suffixText } = useClassNames();
|
|
117
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
118
|
+
reactPrimitive.Primitive.span,
|
|
119
|
+
{
|
|
120
|
+
className: clsx(suffixText, className),
|
|
121
|
+
ref,
|
|
122
|
+
"aria-hidden": true,
|
|
123
|
+
...stateProps,
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
FieldButtonSuffixText.displayName = "FieldButtonSuffixText";
|
|
130
|
+
const FieldButtonFooter = withFieldContext(
|
|
131
|
+
withStateProps(reactPrimitive.Primitive.div),
|
|
132
|
+
"footer"
|
|
133
|
+
);
|
|
134
|
+
const FieldButtonDescription = withFieldContext(reactFieldButton.FieldButton.Description, "description");
|
|
135
|
+
const FieldButtonErrorMessage = withFieldContext(reactFieldButton.FieldButton.ErrorMessage, "errorMessage");
|
|
136
|
+
const FieldButtonHiddenInput = reactFieldButton.FieldButton.HiddenInput;
|
|
137
|
+
const FieldButtonButton = withContext(
|
|
138
|
+
reactFieldButton.FieldButton.Button,
|
|
139
|
+
"button"
|
|
140
|
+
);
|
|
141
|
+
const FieldButtonControl = withProvider(
|
|
142
|
+
withStateProps(reactPrimitive.Primitive.div),
|
|
143
|
+
"root"
|
|
144
|
+
);
|
|
145
|
+
const FieldButtonClearButton = withContext(
|
|
146
|
+
reactFieldButton.FieldButton.ClearButton,
|
|
147
|
+
"clearButton"
|
|
148
|
+
);
|
|
149
|
+
const FieldButtonValue = React__namespace.forwardRef(
|
|
150
|
+
({ className, ...props }, ref) => {
|
|
151
|
+
const { stateProps } = reactFieldButton.useFieldButtonContext();
|
|
152
|
+
const { value } = useClassNames();
|
|
153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
+
reactPrimitive.Primitive.div,
|
|
155
|
+
{
|
|
156
|
+
className: clsx(value, className),
|
|
157
|
+
ref,
|
|
158
|
+
"aria-hidden": true,
|
|
159
|
+
...stateProps,
|
|
160
|
+
...props
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
FieldButtonValue.displayName = "FieldButtonValue";
|
|
166
|
+
const FieldButtonPlaceholder = React__namespace.forwardRef(
|
|
167
|
+
({ className, ...props }, ref) => {
|
|
168
|
+
const { stateProps } = reactFieldButton.useFieldButtonContext();
|
|
169
|
+
const { placeholder } = useClassNames();
|
|
170
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
171
|
+
reactPrimitive.Primitive.div,
|
|
172
|
+
{
|
|
173
|
+
className: clsx(placeholder, className),
|
|
174
|
+
ref,
|
|
175
|
+
"aria-hidden": true,
|
|
176
|
+
...stateProps,
|
|
177
|
+
...props
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
FieldButtonPlaceholder.displayName = "FieldButtonPlaceholder";
|
|
183
|
+
|
|
184
|
+
exports.FieldButtonButton = FieldButtonButton;
|
|
185
|
+
exports.FieldButtonClearButton = FieldButtonClearButton;
|
|
186
|
+
exports.FieldButtonControl = FieldButtonControl;
|
|
187
|
+
exports.FieldButtonDescription = FieldButtonDescription;
|
|
188
|
+
exports.FieldButtonErrorMessage = FieldButtonErrorMessage;
|
|
189
|
+
exports.FieldButtonFooter = FieldButtonFooter;
|
|
190
|
+
exports.FieldButtonHeader = FieldButtonHeader;
|
|
191
|
+
exports.FieldButtonHiddenInput = FieldButtonHiddenInput;
|
|
192
|
+
exports.FieldButtonIndicatorText = FieldButtonIndicatorText;
|
|
193
|
+
exports.FieldButtonLabel = FieldButtonLabel;
|
|
194
|
+
exports.FieldButtonPlaceholder = FieldButtonPlaceholder;
|
|
195
|
+
exports.FieldButtonPrefixIcon = FieldButtonPrefixIcon;
|
|
196
|
+
exports.FieldButtonPrefixText = FieldButtonPrefixText;
|
|
197
|
+
exports.FieldButtonRequiredIndicator = FieldButtonRequiredIndicator;
|
|
198
|
+
exports.FieldButtonRoot = FieldButtonRoot;
|
|
199
|
+
exports.FieldButtonSuffixIcon = FieldButtonSuffixIcon;
|
|
200
|
+
exports.FieldButtonSuffixText = FieldButtonSuffixText;
|
|
201
|
+
exports.FieldButtonValue = FieldButtonValue;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
2
|
+
import { FieldButton } from '@seed-design/react-field-button';
|
|
3
|
+
import { FieldVariantProps } from '@seed-design/css/recipes/field';
|
|
4
|
+
import { FieldLabelVariantProps } from '@seed-design/css/recipes/field-label';
|
|
5
|
+
import { InternalIconProps } from '../private/Icon';
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
export interface FieldButtonRootProps extends FieldVariantProps, FieldButton.RootProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const FieldButtonRoot: React.ForwardRefExoticComponent<FieldButtonRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export interface FieldButtonHeaderProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
}
|
|
12
|
+
export declare const FieldButtonHeader: React.ForwardRefExoticComponent<FieldButtonHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export interface FieldButtonLabelProps extends PrimitiveProps, FieldLabelVariantProps, React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
}
|
|
15
|
+
export declare const FieldButtonLabel: React.ForwardRefExoticComponent<FieldButtonLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export interface FieldButtonIndicatorTextProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
17
|
+
}
|
|
18
|
+
export declare const FieldButtonIndicatorText: React.ForwardRefExoticComponent<FieldButtonIndicatorTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
export interface FieldButtonRequiredIndicatorProps extends React.SVGProps<SVGElement> {
|
|
20
|
+
}
|
|
21
|
+
export declare const FieldButtonRequiredIndicator: React.ForwardRefExoticComponent<Omit<FieldButtonRequiredIndicatorProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
22
|
+
export interface FieldButtonPrefixIconProps extends InternalIconProps {
|
|
23
|
+
}
|
|
24
|
+
export declare const FieldButtonPrefixIcon: React.ForwardRefExoticComponent<FieldButtonPrefixIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
25
|
+
export interface FieldButtonPrefixTextProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
26
|
+
}
|
|
27
|
+
export declare const FieldButtonPrefixText: React.ForwardRefExoticComponent<FieldButtonPrefixTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
28
|
+
export interface FieldButtonSuffixIconProps extends InternalIconProps {
|
|
29
|
+
}
|
|
30
|
+
export declare const FieldButtonSuffixIcon: React.ForwardRefExoticComponent<FieldButtonSuffixIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
31
|
+
export interface FieldButtonSuffixTextProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
32
|
+
}
|
|
33
|
+
export declare const FieldButtonSuffixText: React.ForwardRefExoticComponent<FieldButtonSuffixTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
34
|
+
export interface FieldButtonFooterProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
}
|
|
36
|
+
export declare const FieldButtonFooter: React.ForwardRefExoticComponent<FieldButtonFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export interface FieldButtonDescriptionProps extends FieldButton.DescriptionProps {
|
|
38
|
+
}
|
|
39
|
+
export declare const FieldButtonDescription: React.ForwardRefExoticComponent<FieldButtonDescriptionProps & React.RefAttributes<HTMLSpanElement>>;
|
|
40
|
+
export interface FieldButtonErrorMessageProps extends FieldButton.ErrorMessageProps {
|
|
41
|
+
}
|
|
42
|
+
export declare const FieldButtonErrorMessage: React.ForwardRefExoticComponent<FieldButtonErrorMessageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
43
|
+
export interface FieldButtonHiddenInputProps extends FieldButton.HiddenInputProps {
|
|
44
|
+
}
|
|
45
|
+
export declare const FieldButtonHiddenInput: React.ForwardRefExoticComponent<FieldButton.HiddenInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
46
|
+
export interface FieldButtonButtonProps extends FieldButton.ButtonProps {
|
|
47
|
+
}
|
|
48
|
+
export declare const FieldButtonButton: React.ForwardRefExoticComponent<FieldButtonButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
export interface FieldButtonControlProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
50
|
+
}
|
|
51
|
+
export declare const FieldButtonControl: React.ForwardRefExoticComponent<FieldButtonControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
export interface FieldButtonClearButtonProps extends FieldButton.ClearButtonProps {
|
|
53
|
+
}
|
|
54
|
+
export declare const FieldButtonClearButton: React.ForwardRefExoticComponent<FieldButtonClearButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
export interface FieldButtonValueProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
56
|
+
}
|
|
57
|
+
export declare const FieldButtonValue: React.ForwardRefExoticComponent<FieldButtonValueProps & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export interface FieldButtonPlaceholderProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
59
|
+
}
|
|
60
|
+
export declare const FieldButtonPlaceholder: React.ForwardRefExoticComponent<FieldButtonPlaceholderProps & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
//# sourceMappingURL=FieldButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldButton.d.ts","sourceRoot":"","sources":["../../../src/components/FieldButton/FieldButton.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
4
|
+
import { FieldButton, useFieldButtonContext } from '@seed-design/react-field-button';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
7
|
+
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
8
|
+
import { field } from '@seed-design/css/recipes/field';
|
|
9
|
+
import { fieldLabel } from '@seed-design/css/recipes/field-label';
|
|
10
|
+
import { InternalIcon } from '../private/Icon.js';
|
|
11
|
+
import { inputButton } from '@seed-design/css/recipes/input-button';
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
|
|
14
|
+
const { withContext: withFieldContext, withProvider: withFieldProvider } = createSlotRecipeContext(field);
|
|
15
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext(inputButton);
|
|
16
|
+
const {
|
|
17
|
+
withProvider: withLabelProvider,
|
|
18
|
+
withContext: withLabelContext,
|
|
19
|
+
useClassNames: useLabelClassNames
|
|
20
|
+
} = createSlotRecipeContext(fieldLabel);
|
|
21
|
+
const withStateProps = createWithStateProps([useFieldButtonContext]);
|
|
22
|
+
const FieldButtonRoot = withFieldProvider(
|
|
23
|
+
FieldButton.Root,
|
|
24
|
+
"root"
|
|
25
|
+
);
|
|
26
|
+
const FieldButtonHeader = withFieldContext(
|
|
27
|
+
withStateProps(Primitive.div),
|
|
28
|
+
"header"
|
|
29
|
+
);
|
|
30
|
+
const FieldButtonLabel = withLabelProvider(
|
|
31
|
+
withStateProps(Primitive.div),
|
|
32
|
+
"root"
|
|
33
|
+
);
|
|
34
|
+
const FieldButtonIndicatorText = withLabelContext(withStateProps(Primitive.span), "indicatorText");
|
|
35
|
+
const FieldButtonRequiredIndicator = React.forwardRef(({ className, ...props }, ref) => {
|
|
36
|
+
const { indicatorIcon } = useLabelClassNames();
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
InternalIcon,
|
|
39
|
+
{
|
|
40
|
+
svg: (
|
|
41
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: InternalIcon is aria-hidden
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
viewBox: "0 0 6 6",
|
|
46
|
+
fill: "none",
|
|
47
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
48
|
+
className: clsx(indicatorIcon, className),
|
|
49
|
+
children: /* @__PURE__ */ jsx(
|
|
50
|
+
"path",
|
|
51
|
+
{
|
|
52
|
+
d: "M3.75002 1.55859L4.41318 1.09468C4.75243 0.857361 5.21982 0.939865 5.45732 1.27899C5.69499 1.61836 5.61243 2.08615 5.27295 2.32366L4.30763 2.99902L5.27372 3.67612C5.61285 3.91381 5.69517 4.38137 5.45761 4.72059C5.21999 5.0599 4.7523 5.14233 4.41299 4.90471L3.75002 4.44043V5.25C3.75002 5.66421 3.41423 6 3.00002 6C2.5858 6 2.25002 5.66421 2.25002 5.25V4.44043L1.58704 4.90471C1.24773 5.14233 0.780041 5.0599 0.542418 4.72059C0.304856 4.38137 0.387176 3.91381 0.726309 3.67612L1.6924 2.99902L0.727079 2.32366C0.387603 2.08615 0.305043 1.61836 0.542707 1.27899C0.780206 0.939865 1.2476 0.857361 1.58685 1.09468L2.25002 1.55859V0.75C2.25002 0.335786 2.5858 0 3.00002 0C3.41423 0 3.75002 0.335786 3.75002 0.75V1.55859Z",
|
|
53
|
+
fill: "currentColor"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
),
|
|
59
|
+
ref,
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
FieldButtonRequiredIndicator.displayName = "FieldButtonRequiredIndicator";
|
|
65
|
+
const FieldButtonPrefixIcon = withContext(
|
|
66
|
+
withStateProps(InternalIcon),
|
|
67
|
+
"prefixIcon"
|
|
68
|
+
);
|
|
69
|
+
const FieldButtonPrefixText = React.forwardRef(
|
|
70
|
+
({ className, ...props }, ref) => {
|
|
71
|
+
const { stateProps } = useFieldButtonContext();
|
|
72
|
+
const { prefixText } = useClassNames();
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
Primitive.span,
|
|
75
|
+
{
|
|
76
|
+
className: clsx(prefixText, className),
|
|
77
|
+
ref,
|
|
78
|
+
"aria-hidden": true,
|
|
79
|
+
...stateProps,
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
FieldButtonPrefixText.displayName = "FieldButtonPrefixText";
|
|
86
|
+
const FieldButtonSuffixIcon = withContext(
|
|
87
|
+
withStateProps(InternalIcon),
|
|
88
|
+
"suffixIcon"
|
|
89
|
+
);
|
|
90
|
+
const FieldButtonSuffixText = React.forwardRef(
|
|
91
|
+
({ className, ...props }, ref) => {
|
|
92
|
+
const { stateProps } = useFieldButtonContext();
|
|
93
|
+
const { suffixText } = useClassNames();
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
Primitive.span,
|
|
96
|
+
{
|
|
97
|
+
className: clsx(suffixText, className),
|
|
98
|
+
ref,
|
|
99
|
+
"aria-hidden": true,
|
|
100
|
+
...stateProps,
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
FieldButtonSuffixText.displayName = "FieldButtonSuffixText";
|
|
107
|
+
const FieldButtonFooter = withFieldContext(
|
|
108
|
+
withStateProps(Primitive.div),
|
|
109
|
+
"footer"
|
|
110
|
+
);
|
|
111
|
+
const FieldButtonDescription = withFieldContext(FieldButton.Description, "description");
|
|
112
|
+
const FieldButtonErrorMessage = withFieldContext(FieldButton.ErrorMessage, "errorMessage");
|
|
113
|
+
const FieldButtonHiddenInput = FieldButton.HiddenInput;
|
|
114
|
+
const FieldButtonButton = withContext(
|
|
115
|
+
FieldButton.Button,
|
|
116
|
+
"button"
|
|
117
|
+
);
|
|
118
|
+
const FieldButtonControl = withProvider(
|
|
119
|
+
withStateProps(Primitive.div),
|
|
120
|
+
"root"
|
|
121
|
+
);
|
|
122
|
+
const FieldButtonClearButton = withContext(
|
|
123
|
+
FieldButton.ClearButton,
|
|
124
|
+
"clearButton"
|
|
125
|
+
);
|
|
126
|
+
const FieldButtonValue = React.forwardRef(
|
|
127
|
+
({ className, ...props }, ref) => {
|
|
128
|
+
const { stateProps } = useFieldButtonContext();
|
|
129
|
+
const { value } = useClassNames();
|
|
130
|
+
return /* @__PURE__ */ jsx(
|
|
131
|
+
Primitive.div,
|
|
132
|
+
{
|
|
133
|
+
className: clsx(value, className),
|
|
134
|
+
ref,
|
|
135
|
+
"aria-hidden": true,
|
|
136
|
+
...stateProps,
|
|
137
|
+
...props
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
FieldButtonValue.displayName = "FieldButtonValue";
|
|
143
|
+
const FieldButtonPlaceholder = React.forwardRef(
|
|
144
|
+
({ className, ...props }, ref) => {
|
|
145
|
+
const { stateProps } = useFieldButtonContext();
|
|
146
|
+
const { placeholder } = useClassNames();
|
|
147
|
+
return /* @__PURE__ */ jsx(
|
|
148
|
+
Primitive.div,
|
|
149
|
+
{
|
|
150
|
+
className: clsx(placeholder, className),
|
|
151
|
+
ref,
|
|
152
|
+
"aria-hidden": true,
|
|
153
|
+
...stateProps,
|
|
154
|
+
...props
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
FieldButtonPlaceholder.displayName = "FieldButtonPlaceholder";
|
|
160
|
+
|
|
161
|
+
export { FieldButtonButton, FieldButtonClearButton, FieldButtonControl, FieldButtonDescription, FieldButtonErrorMessage, FieldButtonFooter, FieldButtonHeader, FieldButtonHiddenInput, FieldButtonIndicatorText, FieldButtonLabel, FieldButtonPlaceholder, FieldButtonPrefixIcon, FieldButtonPrefixText, FieldButtonRequiredIndicator, FieldButtonRoot, FieldButtonSuffixIcon, FieldButtonSuffixText, FieldButtonValue };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const FieldButton = require('./FieldButton.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.Button = FieldButton.FieldButtonButton;
|
|
10
|
+
exports.ClearButton = FieldButton.FieldButtonClearButton;
|
|
11
|
+
exports.Control = FieldButton.FieldButtonControl;
|
|
12
|
+
exports.Description = FieldButton.FieldButtonDescription;
|
|
13
|
+
exports.ErrorMessage = FieldButton.FieldButtonErrorMessage;
|
|
14
|
+
exports.Footer = FieldButton.FieldButtonFooter;
|
|
15
|
+
exports.Header = FieldButton.FieldButtonHeader;
|
|
16
|
+
exports.HiddenInput = FieldButton.FieldButtonHiddenInput;
|
|
17
|
+
exports.IndicatorText = FieldButton.FieldButtonIndicatorText;
|
|
18
|
+
exports.Label = FieldButton.FieldButtonLabel;
|
|
19
|
+
exports.Placeholder = FieldButton.FieldButtonPlaceholder;
|
|
20
|
+
exports.PrefixIcon = FieldButton.FieldButtonPrefixIcon;
|
|
21
|
+
exports.PrefixText = FieldButton.FieldButtonPrefixText;
|
|
22
|
+
exports.RequiredIndicator = FieldButton.FieldButtonRequiredIndicator;
|
|
23
|
+
exports.Root = FieldButton.FieldButtonRoot;
|
|
24
|
+
exports.SuffixIcon = FieldButton.FieldButtonSuffixIcon;
|
|
25
|
+
exports.SuffixText = FieldButton.FieldButtonSuffixText;
|
|
26
|
+
exports.Value = FieldButton.FieldButtonValue;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { FieldButtonButton as Button, FieldButtonClearButton as ClearButton, FieldButtonDescription as Description, FieldButtonErrorMessage as ErrorMessage, FieldButtonRoot as Root, FieldButtonFooter as Footer, FieldButtonHeader as Header, FieldButtonHiddenInput as HiddenInput, FieldButtonIndicatorText as IndicatorText, FieldButtonLabel as Label, FieldButtonPlaceholder as Placeholder, FieldButtonPrefixIcon as PrefixIcon, FieldButtonPrefixText as PrefixText, FieldButtonRequiredIndicator as RequiredIndicator, FieldButtonControl as Control, FieldButtonSuffixIcon as SuffixIcon, FieldButtonSuffixText as SuffixText, FieldButtonValue as Value, type FieldButtonButtonProps as ButtonProps, type FieldButtonClearButtonProps as ClearButtonProps, type FieldButtonDescriptionProps as DescriptionProps, type FieldButtonErrorMessageProps as ErrorMessageProps, type FieldButtonRootProps as RootProps, type FieldButtonFooterProps as FooterProps, type FieldButtonHeaderProps as HeaderProps, type FieldButtonHiddenInputProps as HiddenInputProps, type FieldButtonIndicatorTextProps as IndicatorTextProps, type FieldButtonLabelProps as LabelProps, type FieldButtonPlaceholderProps as PlaceholderProps, type FieldButtonPrefixIconProps as PrefixIconProps, type FieldButtonPrefixTextProps as PrefixTextProps, type FieldButtonRequiredIndicatorProps as RequiredIndicatorProps, type FieldButtonControlProps as ControlProps, type FieldButtonSuffixIconProps as SuffixIconProps, type FieldButtonSuffixTextProps as SuffixTextProps, type FieldButtonValueProps as ValueProps, } from './FieldButton';
|
|
2
|
+
//# sourceMappingURL=FieldButton.namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldButton.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/FieldButton/FieldButton.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,IAAI,MAAM,EAC3B,sBAAsB,IAAI,WAAW,EACrC,sBAAsB,IAAI,WAAW,EACrC,uBAAuB,IAAI,YAAY,EACvC,eAAe,IAAI,IAAI,EACvB,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,IAAI,MAAM,EAC3B,sBAAsB,IAAI,WAAW,EACrC,wBAAwB,IAAI,aAAa,EACzC,gBAAgB,IAAI,KAAK,EACzB,sBAAsB,IAAI,WAAW,EACrC,qBAAqB,IAAI,UAAU,EACnC,qBAAqB,IAAI,UAAU,EACnC,4BAA4B,IAAI,iBAAiB,EACjD,kBAAkB,IAAI,OAAO,EAC7B,qBAAqB,IAAI,UAAU,EACnC,qBAAqB,IAAI,UAAU,EACnC,gBAAgB,IAAI,KAAK,EACzB,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,4BAA4B,IAAI,iBAAiB,EACtD,KAAK,oBAAoB,IAAI,SAAS,EACtC,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,6BAA6B,IAAI,kBAAkB,EACxD,KAAK,qBAAqB,IAAI,UAAU,EACxC,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,iCAAiC,IAAI,sBAAsB,EAChE,KAAK,uBAAuB,IAAI,YAAY,EAC5C,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,qBAAqB,IAAI,UAAU,GACzC,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FieldButtonButton as Button, FieldButtonClearButton as ClearButton, FieldButtonControl as Control, FieldButtonDescription as Description, FieldButtonErrorMessage as ErrorMessage, FieldButtonFooter as Footer, FieldButtonHeader as Header, FieldButtonHiddenInput as HiddenInput, FieldButtonIndicatorText as IndicatorText, FieldButtonLabel as Label, FieldButtonPlaceholder as Placeholder, FieldButtonPrefixIcon as PrefixIcon, FieldButtonPrefixText as PrefixText, FieldButtonRequiredIndicator as RequiredIndicator, FieldButtonRoot as Root, FieldButtonSuffixIcon as SuffixIcon, FieldButtonSuffixText as SuffixText, FieldButtonValue as Value } from './FieldButton.js';
|