@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
|
@@ -11,6 +11,7 @@ const React = require('react');
|
|
|
11
11
|
const styled = require('../../utils/styled.cjs');
|
|
12
12
|
const Icon = require('../Icon/Icon.cjs');
|
|
13
13
|
const usePendingButton = require('../LoadingIndicator/usePendingButton.cjs');
|
|
14
|
+
const vars = require('@seed-design/css/vars');
|
|
14
15
|
|
|
15
16
|
function _interopNamespaceDefault(e) {
|
|
16
17
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -38,6 +39,7 @@ const ActionButton = React__namespace.forwardRef(
|
|
|
38
39
|
loading = false,
|
|
39
40
|
layout = "withText",
|
|
40
41
|
color,
|
|
42
|
+
fontWeight,
|
|
41
43
|
className,
|
|
42
44
|
children,
|
|
43
45
|
...otherProps
|
|
@@ -55,7 +57,11 @@ const ActionButton = React__namespace.forwardRef(
|
|
|
55
57
|
{
|
|
56
58
|
ref,
|
|
57
59
|
className: clsx(recipeClassName, className),
|
|
58
|
-
style: {
|
|
60
|
+
style: {
|
|
61
|
+
...style,
|
|
62
|
+
...color && { "--seed-box-color": styled.handleColor(color) },
|
|
63
|
+
...fontWeight && { "--seed-font-weight": vars.vars.$fontWeight[fontWeight] }
|
|
64
|
+
},
|
|
59
65
|
...api.stateProps,
|
|
60
66
|
...restProps,
|
|
61
67
|
children
|
|
@@ -2,7 +2,7 @@ import { ActionButtonVariantProps } from '@seed-design/css/recipes/action-button
|
|
|
2
2
|
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
3
3
|
import { StyleProps } from '../../utils/styled';
|
|
4
4
|
import { UsePendingButtonProps } from '../LoadingIndicator/usePendingButton';
|
|
5
|
-
import { ScopedColorFg, ScopedColorPalette } from '@seed-design/css/vars';
|
|
5
|
+
import { ScopedColorFg, ScopedColorPalette, FontWeight } from '@seed-design/css/vars';
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
export interface ActionButtonProps extends ActionButtonVariantProps, UsePendingButtonProps, PrimitiveProps, Pick<StyleProps, "flexGrow" | "bleedX" | "bleedY">, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
8
|
/**
|
|
@@ -11,6 +11,12 @@ export interface ActionButtonProps extends ActionButtonVariantProps, UsePendingB
|
|
|
11
11
|
* @default "fg.neutral"
|
|
12
12
|
*/
|
|
13
13
|
color?: ScopedColorFg | ScopedColorPalette;
|
|
14
|
+
/**
|
|
15
|
+
* Weight of the label.
|
|
16
|
+
* Works only when `variant` is `ghost`.
|
|
17
|
+
* @default "bold"
|
|
18
|
+
*/
|
|
19
|
+
fontWeight?: FontWeight;
|
|
14
20
|
}
|
|
15
21
|
export declare const ActionButton: React.ForwardRefExoticComponent<ActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
22
|
//# sourceMappingURL=ActionButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,qBAAqB,EACrB,cAAc,EACd,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAClD,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC/C;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,CAAC;IAE3C;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,eAAO,MAAM,YAAY,6FAgDxB,CAAC"}
|
|
@@ -7,6 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import { useStyleProps, handleColor } from '../../utils/styled.js';
|
|
8
8
|
import { IconRequired } from '../Icon/Icon.js';
|
|
9
9
|
import { usePendingButton, PendingButtonProvider } from '../LoadingIndicator/usePendingButton.js';
|
|
10
|
+
import { vars } from '@seed-design/css/vars';
|
|
10
11
|
|
|
11
12
|
const ActionButton = React.forwardRef(
|
|
12
13
|
({
|
|
@@ -15,6 +16,7 @@ const ActionButton = React.forwardRef(
|
|
|
15
16
|
loading = false,
|
|
16
17
|
layout = "withText",
|
|
17
18
|
color,
|
|
19
|
+
fontWeight,
|
|
18
20
|
className,
|
|
19
21
|
children,
|
|
20
22
|
...otherProps
|
|
@@ -32,7 +34,11 @@ const ActionButton = React.forwardRef(
|
|
|
32
34
|
{
|
|
33
35
|
ref,
|
|
34
36
|
className: clsx(recipeClassName, className),
|
|
35
|
-
style: {
|
|
37
|
+
style: {
|
|
38
|
+
...style,
|
|
39
|
+
...color && { "--seed-box-color": handleColor(color) },
|
|
40
|
+
...fontWeight && { "--seed-font-weight": vars.$fontWeight[fontWeight] }
|
|
41
|
+
},
|
|
36
42
|
...api.stateProps,
|
|
37
43
|
...restProps,
|
|
38
44
|
children
|
|
@@ -3,53 +3,49 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
5
|
|
|
6
|
-
const reactDialog = require('@seed-design/react-dialog');
|
|
7
|
-
const reactPrimitive = require('@seed-design/react-primitive');
|
|
8
6
|
const bottomSheet = require('@seed-design/css/recipes/bottom-sheet');
|
|
7
|
+
const reactDrawer = require('@seed-design/react-drawer');
|
|
8
|
+
const reactPrimitive = require('@seed-design/react-primitive');
|
|
9
9
|
const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs');
|
|
10
|
-
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
11
|
-
const styled = require('../../utils/styled.cjs');
|
|
12
10
|
|
|
13
11
|
const { withRootProvider, withContext } = createSlotRecipeContext.createSlotRecipeContext(bottomSheet.bottomSheet);
|
|
14
|
-
const
|
|
15
|
-
const BottomSheetRoot = withRootProvider(reactDialog.Dialog.Root, {
|
|
12
|
+
const BottomSheetRoot = withRootProvider(reactDrawer.Drawer.Root, {
|
|
16
13
|
defaultProps: {
|
|
17
|
-
|
|
18
|
-
unmountOnExit: true
|
|
14
|
+
direction: "bottom"
|
|
19
15
|
}
|
|
20
16
|
});
|
|
21
|
-
const BottomSheetTrigger =
|
|
17
|
+
const BottomSheetTrigger = reactDrawer.Drawer.Trigger;
|
|
22
18
|
const BottomSheetPositioner = withContext(
|
|
23
|
-
|
|
19
|
+
reactDrawer.Drawer.Positioner,
|
|
24
20
|
"positioner"
|
|
25
21
|
);
|
|
26
22
|
const BottomSheetBackdrop = withContext(
|
|
27
|
-
|
|
23
|
+
reactDrawer.Drawer.Backdrop,
|
|
28
24
|
"backdrop"
|
|
29
25
|
);
|
|
30
26
|
const BottomSheetContent = withContext(
|
|
31
|
-
|
|
27
|
+
reactDrawer.Drawer.Content,
|
|
32
28
|
"content"
|
|
33
29
|
);
|
|
34
30
|
const BottomSheetHeader = withContext(
|
|
35
|
-
|
|
31
|
+
reactPrimitive.Primitive.div,
|
|
36
32
|
"header"
|
|
37
33
|
);
|
|
38
34
|
const BottomSheetTitle = withContext(
|
|
39
|
-
|
|
35
|
+
reactDrawer.Drawer.Title,
|
|
40
36
|
"title"
|
|
41
37
|
);
|
|
42
|
-
const BottomSheetDescription = withContext(
|
|
38
|
+
const BottomSheetDescription = withContext(reactDrawer.Drawer.Description, "description");
|
|
43
39
|
const BottomSheetBody = withContext(
|
|
44
|
-
|
|
40
|
+
reactPrimitive.Primitive.div,
|
|
45
41
|
"body"
|
|
46
42
|
);
|
|
47
43
|
const BottomSheetFooter = withContext(
|
|
48
|
-
|
|
44
|
+
reactPrimitive.Primitive.div,
|
|
49
45
|
"footer"
|
|
50
46
|
);
|
|
51
47
|
const BottomSheetCloseButton = withContext(
|
|
52
|
-
|
|
48
|
+
reactDrawer.Drawer.CloseButton,
|
|
53
49
|
"closeButton"
|
|
54
50
|
);
|
|
55
51
|
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
import { Dialog as DialogPrimitive } from '@seed-design/react-dialog';
|
|
2
|
-
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
3
1
|
import { BottomSheetVariantProps } from '@seed-design/css/recipes/bottom-sheet';
|
|
2
|
+
import { Drawer } from '@seed-design/react-drawer';
|
|
3
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
4
4
|
import { StyleProps } from '../../utils/styled';
|
|
5
5
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
lazyMount?: DialogPrimitive.RootProps["lazyMount"];
|
|
11
|
-
/**
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
unmountOnExit?: DialogPrimitive.RootProps["unmountOnExit"];
|
|
6
|
+
import { DialogTriggerProps } from '@radix-ui/react-dialog';
|
|
7
|
+
export interface BottomSheetRootProps extends BottomSheetVariantProps, Drawer.RootProps {
|
|
15
8
|
}
|
|
16
9
|
export declare const BottomSheetRoot: ForwardRefExoticComponent<BottomSheetRootProps>;
|
|
17
|
-
export interface BottomSheetTriggerProps extends
|
|
10
|
+
export interface BottomSheetTriggerProps extends Drawer.TriggerProps {
|
|
18
11
|
}
|
|
19
|
-
export declare const BottomSheetTrigger: ForwardRefExoticComponent<
|
|
20
|
-
export interface BottomSheetPositionerProps extends
|
|
12
|
+
export declare const BottomSheetTrigger: ForwardRefExoticComponent< DialogTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export interface BottomSheetPositionerProps extends Drawer.PositionerProps {
|
|
21
14
|
}
|
|
22
15
|
export declare const BottomSheetPositioner: ForwardRefExoticComponent<BottomSheetPositionerProps & RefAttributes<HTMLDivElement>>;
|
|
23
|
-
export interface BottomSheetBackdropProps extends
|
|
16
|
+
export interface BottomSheetBackdropProps extends Drawer.BackdropProps {
|
|
24
17
|
}
|
|
25
18
|
export declare const BottomSheetBackdrop: ForwardRefExoticComponent<BottomSheetBackdropProps & RefAttributes<HTMLDivElement>>;
|
|
26
|
-
export interface BottomSheetContentProps extends
|
|
19
|
+
export interface BottomSheetContentProps extends Drawer.ContentProps {
|
|
27
20
|
}
|
|
28
21
|
export declare const BottomSheetContent: ForwardRefExoticComponent<BottomSheetContentProps & RefAttributes<HTMLDivElement>>;
|
|
29
22
|
export interface BottomSheetHeaderProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
30
23
|
}
|
|
31
24
|
export declare const BottomSheetHeader: ForwardRefExoticComponent<BottomSheetHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
32
|
-
export interface BottomSheetTitleProps extends
|
|
25
|
+
export interface BottomSheetTitleProps extends Drawer.TitleProps {
|
|
33
26
|
}
|
|
34
27
|
export declare const BottomSheetTitle: ForwardRefExoticComponent<BottomSheetTitleProps & RefAttributes<HTMLHeadingElement>>;
|
|
35
|
-
export interface BottomSheetDescriptionProps extends
|
|
28
|
+
export interface BottomSheetDescriptionProps extends Drawer.DescriptionProps {
|
|
36
29
|
}
|
|
37
30
|
export declare const BottomSheetDescription: ForwardRefExoticComponent<BottomSheetDescriptionProps & RefAttributes<HTMLParagraphElement>>;
|
|
38
31
|
export interface BottomSheetBodyProps extends PrimitiveProps, Pick<StyleProps, "paddingX" | "height" | "maxHeight" | "minHeight" | "justifyContent" | "alignItems">, React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -41,7 +34,7 @@ export declare const BottomSheetBody: ForwardRefExoticComponent<BottomSheetBodyP
|
|
|
41
34
|
export interface BottomSheetFooterProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
42
35
|
}
|
|
43
36
|
export declare const BottomSheetFooter: ForwardRefExoticComponent<BottomSheetFooterProps & RefAttributes<HTMLDivElement>>;
|
|
44
|
-
export interface BottomSheetCloseButtonProps extends
|
|
37
|
+
export interface BottomSheetCloseButtonProps extends Drawer.CloseButtonProps {
|
|
45
38
|
}
|
|
46
39
|
export declare const BottomSheetCloseButton: ForwardRefExoticComponent<BottomSheetCloseButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
47
40
|
//# sourceMappingURL=BottomSheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAe,KAAK,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB,EAAE,MAAM,CAAC,SAAS;CAAG;AAE1F,eAAO,MAAM,eAAe,iEAI1B,CAAC;AAIH,MAAM,WAAW,uBAAwB,SAAQ,MAAM,CAAC,YAAY;CAAG;AAEvE,eAAO,MAAM,kBAAkB,mJAAiB,CAAC;AAIjD,MAAM,WAAW,0BAA2B,SAAQ,MAAM,CAAC,eAAe;CAAG;AAE7E,eAAO,MAAM,qBAAqB,uHAGjC,CAAC;AAIF,MAAM,WAAW,wBAAyB,SAAQ,MAAM,CAAC,aAAa;CAAG;AAEzE,eAAO,MAAM,mBAAmB,qHAG/B,CAAC;AAIF,MAAM,WAAW,uBAAwB,SAAQ,MAAM,CAAC,YAAY;CAAG;AAEvE,eAAO,MAAM,kBAAkB,oHAG9B,CAAC;AAIF,MAAM,WAAW,sBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,iBAAiB,mHAG7B,CAAC;AAIF,MAAM,WAAW,qBAAsB,SAAQ,MAAM,CAAC,UAAU;CAAG;AAEnE,eAAO,MAAM,gBAAgB,sHAG5B,CAAC;AAIF,MAAM,WAAW,2BAA4B,SAAQ,MAAM,CAAC,gBAAgB;CAAG;AAE/E,eAAO,MAAM,sBAAsB,8HAGC,CAAC;AAIrC,MAAM,WAAW,oBACf,SAAQ,cAAc,EACpB,IAAI,CACF,UAAU,EACV,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,YAAY,CACpF,EACD,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,eAAe,iHAG3B,CAAC;AAIF,MAAM,WAAW,sBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,iBAAiB,mHAG7B,CAAC;AAIF,MAAM,WAAW,2BAA4B,SAAQ,MAAM,CAAC,gBAAgB;CAAG;AAE/E,eAAO,MAAM,sBAAsB,2HAGlC,CAAC"}
|
|
@@ -1,51 +1,47 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Dialog, useDialogContext } from '@seed-design/react-dialog';
|
|
3
|
-
import { Primitive } from '@seed-design/react-primitive';
|
|
4
2
|
import { bottomSheet } from '@seed-design/css/recipes/bottom-sheet';
|
|
3
|
+
import { Drawer } from '@seed-design/react-drawer';
|
|
4
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
5
5
|
import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js';
|
|
6
|
-
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
7
|
-
import { withStyleProps } from '../../utils/styled.js';
|
|
8
6
|
|
|
9
7
|
const { withRootProvider, withContext } = createSlotRecipeContext(bottomSheet);
|
|
10
|
-
const
|
|
11
|
-
const BottomSheetRoot = withRootProvider(Dialog.Root, {
|
|
8
|
+
const BottomSheetRoot = withRootProvider(Drawer.Root, {
|
|
12
9
|
defaultProps: {
|
|
13
|
-
|
|
14
|
-
unmountOnExit: true
|
|
10
|
+
direction: "bottom"
|
|
15
11
|
}
|
|
16
12
|
});
|
|
17
|
-
const BottomSheetTrigger =
|
|
13
|
+
const BottomSheetTrigger = Drawer.Trigger;
|
|
18
14
|
const BottomSheetPositioner = withContext(
|
|
19
|
-
|
|
15
|
+
Drawer.Positioner,
|
|
20
16
|
"positioner"
|
|
21
17
|
);
|
|
22
18
|
const BottomSheetBackdrop = withContext(
|
|
23
|
-
|
|
19
|
+
Drawer.Backdrop,
|
|
24
20
|
"backdrop"
|
|
25
21
|
);
|
|
26
22
|
const BottomSheetContent = withContext(
|
|
27
|
-
|
|
23
|
+
Drawer.Content,
|
|
28
24
|
"content"
|
|
29
25
|
);
|
|
30
26
|
const BottomSheetHeader = withContext(
|
|
31
|
-
|
|
27
|
+
Primitive.div,
|
|
32
28
|
"header"
|
|
33
29
|
);
|
|
34
30
|
const BottomSheetTitle = withContext(
|
|
35
|
-
|
|
31
|
+
Drawer.Title,
|
|
36
32
|
"title"
|
|
37
33
|
);
|
|
38
|
-
const BottomSheetDescription = withContext(
|
|
34
|
+
const BottomSheetDescription = withContext(Drawer.Description, "description");
|
|
39
35
|
const BottomSheetBody = withContext(
|
|
40
|
-
|
|
36
|
+
Primitive.div,
|
|
41
37
|
"body"
|
|
42
38
|
);
|
|
43
39
|
const BottomSheetFooter = withContext(
|
|
44
|
-
|
|
40
|
+
Primitive.div,
|
|
45
41
|
"footer"
|
|
46
42
|
);
|
|
47
43
|
const BottomSheetCloseButton = withContext(
|
|
48
|
-
|
|
44
|
+
Drawer.CloseButton,
|
|
49
45
|
"closeButton"
|
|
50
46
|
);
|
|
51
47
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const BottomSheet = require('./BottomSheet.cjs');
|
|
6
|
+
const BottomSheetHandle = require('../BottomSheetHandle/BottomSheetHandle.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -17,3 +18,4 @@ exports.Positioner = BottomSheet.BottomSheetPositioner;
|
|
|
17
18
|
exports.Root = BottomSheet.BottomSheetRoot;
|
|
18
19
|
exports.Title = BottomSheet.BottomSheetTitle;
|
|
19
20
|
exports.Trigger = BottomSheet.BottomSheetTrigger;
|
|
21
|
+
exports.Handle = BottomSheetHandle.BottomSheetHandle;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { BottomSheetBackdrop as Backdrop, BottomSheetBody as Body, BottomSheetContent as Content, BottomSheetDescription as Description, BottomSheetFooter as Footer, BottomSheetHeader as Header, BottomSheetPositioner as Positioner, BottomSheetRoot as Root, BottomSheetTitle as Title, BottomSheetTrigger as Trigger, BottomSheetCloseButton as CloseButton, type BottomSheetBackdropProps as BackdropProps, type BottomSheetBodyProps as BodyProps, type BottomSheetContentProps as ContentProps, type BottomSheetDescriptionProps as DescriptionProps, type BottomSheetFooterProps as FooterProps, type BottomSheetHeaderProps as HeaderProps, type BottomSheetPositionerProps as PositionerProps, type BottomSheetRootProps as RootProps, type BottomSheetTitleProps as TitleProps, type BottomSheetTriggerProps as TriggerProps, type BottomSheetCloseButtonProps as CloseButtonProps, } from './BottomSheet';
|
|
2
|
+
export { BottomSheetHandle as Handle, type BottomSheetHandleProps as HandleProps, } from '../BottomSheetHandle';
|
|
2
3
|
//# sourceMappingURL=BottomSheet.namespace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,IAAI,QAAQ,EAC/B,eAAe,IAAI,IAAI,EACvB,kBAAkB,IAAI,OAAO,EAC7B,sBAAsB,IAAI,WAAW,EACrC,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,IAAI,MAAM,EAC3B,qBAAqB,IAAI,UAAU,EACnC,eAAe,IAAI,IAAI,EACvB,gBAAgB,IAAI,KAAK,EACzB,kBAAkB,IAAI,OAAO,EAC7B,sBAAsB,IAAI,WAAW,EACrC,KAAK,wBAAwB,IAAI,aAAa,EAC9C,KAAK,oBAAoB,IAAI,SAAS,EACtC,KAAK,uBAAuB,IAAI,YAAY,EAC5C,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,oBAAoB,IAAI,SAAS,EACtC,KAAK,qBAAqB,IAAI,UAAU,EACxC,KAAK,uBAAuB,IAAI,YAAY,EAC5C,KAAK,2BAA2B,IAAI,gBAAgB,GACrD,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"BottomSheet.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,IAAI,QAAQ,EAC/B,eAAe,IAAI,IAAI,EACvB,kBAAkB,IAAI,OAAO,EAC7B,sBAAsB,IAAI,WAAW,EACrC,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,IAAI,MAAM,EAC3B,qBAAqB,IAAI,UAAU,EACnC,eAAe,IAAI,IAAI,EACvB,gBAAgB,IAAI,KAAK,EACzB,kBAAkB,IAAI,OAAO,EAC7B,sBAAsB,IAAI,WAAW,EACrC,KAAK,wBAAwB,IAAI,aAAa,EAC9C,KAAK,oBAAoB,IAAI,SAAS,EACtC,KAAK,uBAAuB,IAAI,YAAY,EAC5C,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,oBAAoB,IAAI,SAAS,EACtC,KAAK,qBAAqB,IAAI,UAAU,EACxC,KAAK,uBAAuB,IAAI,YAAY,EAC5C,KAAK,2BAA2B,IAAI,gBAAgB,GACrD,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,iBAAiB,IAAI,MAAM,EAC3B,KAAK,sBAAsB,IAAI,WAAW,GAC3C,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { BottomSheetBackdrop as Backdrop, BottomSheetBody as Body, BottomSheetCloseButton as CloseButton, BottomSheetContent as Content, BottomSheetDescription as Description, BottomSheetFooter as Footer, BottomSheetHeader as Header, BottomSheetPositioner as Positioner, BottomSheetRoot as Root, BottomSheetTitle as Title, BottomSheetTrigger as Trigger } from './BottomSheet.js';
|
|
2
|
+
export { BottomSheetHandle as Handle } from '../BottomSheetHandle/BottomSheetHandle.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
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 bottomSheetHandle = require('@seed-design/css/recipes/bottom-sheet-handle');
|
|
9
|
+
const React = require('react');
|
|
10
|
+
const clsx = require('clsx');
|
|
11
|
+
|
|
12
|
+
const BottomSheetHandle = React.forwardRef(
|
|
13
|
+
({ className, ...props }, ref) => {
|
|
14
|
+
const classNames = bottomSheetHandle.bottomSheetHandle();
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.div, { ref, className: clsx(classNames.root, className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(reactPrimitive.Primitive.div, { "aria-hidden": "true", className: classNames.touchArea }) });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
BottomSheetHandle.displayName = "BottomSheetHandle";
|
|
19
|
+
|
|
20
|
+
exports.BottomSheetHandle = BottomSheetHandle;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface BottomSheetHandleProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
export declare const BottomSheetHandle: React.ForwardRefExoticComponent<BottomSheetHandleProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
//# sourceMappingURL=BottomSheetHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetHandle.d.ts","sourceRoot":"","sources":["../../../src/components/BottomSheetHandle/BottomSheetHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,sBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,iBAAiB,+FAU7B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
4
|
+
import { bottomSheetHandle } from '@seed-design/css/recipes/bottom-sheet-handle';
|
|
5
|
+
import React__default from 'react';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
const BottomSheetHandle = React__default.forwardRef(
|
|
9
|
+
({ className, ...props }, ref) => {
|
|
10
|
+
const classNames = bottomSheetHandle();
|
|
11
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ref, className: clsx(classNames.root, className), ...props, children: /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": "true", className: classNames.touchArea }) });
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
BottomSheetHandle.displayName = "BottomSheetHandle";
|
|
15
|
+
|
|
16
|
+
export { BottomSheetHandle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BottomSheetHandle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BottomSheetHandle } from './BottomSheetHandle.js';
|
|
@@ -12,9 +12,10 @@ const reactCheckbox = require('@seed-design/react-checkbox');
|
|
|
12
12
|
const reactRadioGroup = require('@seed-design/react-radio-group');
|
|
13
13
|
|
|
14
14
|
const { withProvider, withContext } = createSlotRecipeContext.createSlotRecipeContext(chip.chip);
|
|
15
|
-
const withStateProps = createWithStateProps.createWithStateProps([
|
|
16
|
-
strict: false
|
|
17
|
-
}
|
|
15
|
+
const withStateProps = createWithStateProps.createWithStateProps([
|
|
16
|
+
{ useContext: reactCheckbox.useCheckboxContext, strict: false },
|
|
17
|
+
{ useContext: reactRadioGroup.useRadioGroupItemContext, strict: false }
|
|
18
|
+
]);
|
|
18
19
|
const ChipRoot = Icon.withIconRequired(
|
|
19
20
|
withProvider(reactPrimitive.Primitive.button, "root"),
|
|
20
21
|
(props) => props.layout === "iconOnly"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAepC,MAAM,WAAW,aACf,SAAQ,cAAc,EACpB,gBAAgB,EAChB,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;CAAG;AAEpD,eAAO,MAAM,QAAQ,+IAGpB,CAAC;AAKF,MAAM,WAAW,cAAe,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAEhG,eAAO,MAAM,SAAS,wFAGrB,CAAC;AAKF,MAAM,WAAW,mBAAoB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AACpG,eAAO,MAAM,cAAc,4FAG1B,CAAC;AAKF,MAAM,WAAW,qBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3C,eAAO,MAAM,gBAAgB,8FAG5B,CAAC;AAKF,MAAM,WAAW,mBAAoB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AACpG,eAAO,MAAM,cAAc,4FAG1B,CAAC"}
|
|
@@ -8,9 +8,10 @@ import { useCheckboxContext } from '@seed-design/react-checkbox';
|
|
|
8
8
|
import { useRadioGroupItemContext } from '@seed-design/react-radio-group';
|
|
9
9
|
|
|
10
10
|
const { withProvider, withContext } = createSlotRecipeContext(chip);
|
|
11
|
-
const withStateProps = createWithStateProps([
|
|
12
|
-
strict: false
|
|
13
|
-
}
|
|
11
|
+
const withStateProps = createWithStateProps([
|
|
12
|
+
{ useContext: useCheckboxContext, strict: false },
|
|
13
|
+
{ useContext: useRadioGroupItemContext, strict: false }
|
|
14
|
+
]);
|
|
14
15
|
const ChipRoot = withIconRequired(
|
|
15
16
|
withProvider(Primitive.button, "root"),
|
|
16
17
|
(props) => props.layout === "iconOnly"
|
|
@@ -0,0 +1,108 @@
|
|
|
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 reactField = require('@seed-design/react-field');
|
|
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 clsx = require('clsx');
|
|
16
|
+
|
|
17
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext.createSlotRecipeContext(field.field);
|
|
18
|
+
const {
|
|
19
|
+
withContext: withLabelContext,
|
|
20
|
+
withProvider: withLabelProvider,
|
|
21
|
+
useClassNames: useLabelClassNames
|
|
22
|
+
} = createSlotRecipeContext.createSlotRecipeContext(fieldLabel.fieldLabel);
|
|
23
|
+
const withStateProps = createWithStateProps.createWithStateProps([reactField.useFieldContext]);
|
|
24
|
+
const FieldRoot = withProvider(reactField.Field.Root, "root");
|
|
25
|
+
const FieldHeader = withContext(
|
|
26
|
+
withStateProps(reactPrimitive.Primitive.div),
|
|
27
|
+
"header"
|
|
28
|
+
);
|
|
29
|
+
const FieldLabel = withLabelProvider(reactField.Field.Label, "root");
|
|
30
|
+
const FieldIndicatorText = withLabelContext(
|
|
31
|
+
withStateProps(reactPrimitive.Primitive.span),
|
|
32
|
+
"indicatorText"
|
|
33
|
+
);
|
|
34
|
+
const FieldRequiredIndicator = React.forwardRef(
|
|
35
|
+
({ className, ...props }, ref) => {
|
|
36
|
+
const { indicatorIcon } = useLabelClassNames();
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
Icon.InternalIcon,
|
|
39
|
+
{
|
|
40
|
+
svg: (
|
|
41
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: InternalIcon is aria-hidden
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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
|
+
);
|
|
65
|
+
const FieldFooter = withContext(
|
|
66
|
+
withStateProps(reactPrimitive.Primitive.div),
|
|
67
|
+
"footer"
|
|
68
|
+
);
|
|
69
|
+
const FieldDescription = withContext(
|
|
70
|
+
reactField.Field.Description,
|
|
71
|
+
"description"
|
|
72
|
+
);
|
|
73
|
+
const FieldErrorMessage = withContext(
|
|
74
|
+
reactField.Field.ErrorMessage,
|
|
75
|
+
"errorMessage"
|
|
76
|
+
);
|
|
77
|
+
const FieldCharacterCount = React.forwardRef(
|
|
78
|
+
({ current, max, ...otherProps }, ref) => {
|
|
79
|
+
const classNames = useClassNames();
|
|
80
|
+
const { stateProps } = reactField.useFieldContext();
|
|
81
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactPrimitive.Primitive.div, { ref, ...otherProps, children: [
|
|
82
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
...current === 0 ? { "data-empty": true } : {},
|
|
86
|
+
...current > max ? { "data-exceeded": true } : {},
|
|
87
|
+
className: classNames.characterCount,
|
|
88
|
+
...stateProps,
|
|
89
|
+
children: current
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: classNames.maxCharacterCount, ...stateProps, children: [
|
|
93
|
+
"/",
|
|
94
|
+
max
|
|
95
|
+
] })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
exports.FieldCharacterCount = FieldCharacterCount;
|
|
101
|
+
exports.FieldDescription = FieldDescription;
|
|
102
|
+
exports.FieldErrorMessage = FieldErrorMessage;
|
|
103
|
+
exports.FieldFooter = FieldFooter;
|
|
104
|
+
exports.FieldHeader = FieldHeader;
|
|
105
|
+
exports.FieldIndicatorText = FieldIndicatorText;
|
|
106
|
+
exports.FieldLabel = FieldLabel;
|
|
107
|
+
exports.FieldRequiredIndicator = FieldRequiredIndicator;
|
|
108
|
+
exports.FieldRoot = FieldRoot;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
2
|
+
import { Field } from '@seed-design/react-field';
|
|
3
|
+
import { FieldVariantProps } from '@seed-design/css/recipes/field';
|
|
4
|
+
import { FieldLabelVariantProps } from '@seed-design/css/recipes/field-label';
|
|
5
|
+
import type * as React from "react";
|
|
6
|
+
export interface FieldRootProps extends FieldVariantProps, Field.RootProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldRoot: React.ForwardRefExoticComponent<FieldRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export interface FieldHeaderProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
}
|
|
11
|
+
export declare const FieldHeader: React.ForwardRefExoticComponent<FieldHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export interface FieldLabelProps extends FieldLabelVariantProps, Field.LabelProps {
|
|
13
|
+
}
|
|
14
|
+
export declare const FieldLabel: React.ForwardRefExoticComponent<FieldLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
15
|
+
export interface FieldIndicatorTextProps extends PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
16
|
+
}
|
|
17
|
+
export declare const FieldIndicatorText: React.ForwardRefExoticComponent<FieldIndicatorTextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
18
|
+
export interface FieldRequiredIndicatorProps extends React.SVGProps<SVGElement> {
|
|
19
|
+
}
|
|
20
|
+
export declare const FieldRequiredIndicator: React.ForwardRefExoticComponent<Omit<FieldRequiredIndicatorProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
21
|
+
export interface FieldFooterProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
}
|
|
23
|
+
export declare const FieldFooter: React.ForwardRefExoticComponent<FieldFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export interface FieldDescriptionProps extends Field.DescriptionProps {
|
|
25
|
+
}
|
|
26
|
+
export declare const FieldDescription: React.ForwardRefExoticComponent<FieldDescriptionProps & React.RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
export interface FieldErrorMessageProps extends Field.ErrorMessageProps {
|
|
28
|
+
}
|
|
29
|
+
export declare const FieldErrorMessage: React.ForwardRefExoticComponent<FieldErrorMessageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
30
|
+
export interface FieldCharacterCountProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {
|
|
31
|
+
/**
|
|
32
|
+
* The current number of characters/graphemes
|
|
33
|
+
*/
|
|
34
|
+
current: number;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum allowed characters/graphemes
|
|
37
|
+
*/
|
|
38
|
+
max: number;
|
|
39
|
+
}
|
|
40
|
+
export declare const FieldCharacterCount: React.ForwardRefExoticComponent<FieldCharacterCountProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAmB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAc/F,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,KAAK,CAAC,SAAS;CAAG;AAE7E,eAAO,MAAM,SAAS,uFAAmE,CAAC;AAI1F,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAEjG,eAAO,MAAM,WAAW,yFAGvB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,KAAK,CAAC,UAAU;CAAG;AAEpF,eAAO,MAAM,UAAU,0FAA4E,CAAC;AAEpG,MAAM,WAAW,uBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,kBAAkB,iGAG9B,CAAC;AAEF,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;CAAG;AAElF,eAAO,MAAM,sBAAsB,gHAyBlC,CAAC;AAIF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;CAAG;AAEjG,eAAO,MAAM,WAAW,yFAGvB,CAAC;AAEF,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,gBAAgB;CAAG;AAExE,eAAO,MAAM,gBAAgB,+FAG5B,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,KAAK,CAAC,iBAAiB;CAAG;AAE1E,eAAO,MAAM,iBAAiB,gGAG7B,CAAC;AAIF,MAAM,WAAW,wBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,mBAAmB,iGAqB/B,CAAC"}
|