@seed-design/react 0.0.8 → 0.0.10
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 +2 -4
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +2 -4
- package/lib/components/ActionChip/ActionChip.cjs +2 -2
- package/lib/components/ActionChip/ActionChip.js +2 -2
- package/lib/components/ActionSheet/ActionSheet.cjs +2 -2
- package/lib/components/ActionSheet/ActionSheet.js +2 -2
- package/lib/components/Badge/Badge.cjs +2 -2
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.js +2 -2
- package/lib/components/ControlChip/ControlChip.cjs +2 -2
- package/lib/components/ControlChip/ControlChip.js +2 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +2 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +2 -2
- package/lib/components/ExtendedFab/ExtendedFab.cjs +2 -2
- package/lib/components/ExtendedFab/ExtendedFab.js +2 -2
- package/lib/components/Fab/Fab.cjs +2 -2
- package/lib/components/Fab/Fab.d.ts.map +1 -1
- package/lib/components/Fab/Fab.js +2 -2
- package/lib/components/Icon/Icon.cjs +28 -19
- package/lib/components/Icon/Icon.d.ts +3 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +28 -19
- package/lib/components/LinkContent/LinkContent.cjs +2 -2
- package/lib/components/LinkContent/LinkContent.js +2 -2
- package/lib/components/MannerTemp/MannerTemp.cjs +19 -0
- package/lib/components/MannerTemp/MannerTemp.d.ts +7 -0
- package/lib/components/MannerTemp/MannerTemp.d.ts.map +1 -0
- package/lib/components/MannerTemp/MannerTemp.js +15 -0
- package/lib/components/MannerTemp/MannerTempEmote.cjs +632 -0
- package/lib/components/MannerTemp/MannerTempEmote.d.ts +7 -0
- package/lib/components/MannerTemp/MannerTempEmote.d.ts.map +1 -0
- package/lib/components/MannerTemp/MannerTempEmote.js +627 -0
- package/lib/components/MannerTemp/index.cjs +11 -0
- package/lib/components/MannerTemp/index.d.ts +3 -0
- package/lib/components/MannerTemp/index.d.ts.map +1 -0
- package/lib/components/MannerTemp/index.js +2 -0
- package/lib/components/MannerTempBadge/MannerTempBadge.cjs +2 -2
- package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
- package/lib/components/MannerTempBadge/MannerTempBadge.js +2 -2
- package/lib/components/NotificationBadge/NotificationBadge.cjs +2 -2
- package/lib/components/NotificationBadge/NotificationBadge.js +2 -2
- package/lib/components/ReactionButton/ReactionButton.cjs +2 -4
- package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -1
- package/lib/components/ReactionButton/ReactionButton.js +2 -4
- package/lib/components/SelectBox/CheckSelectBox.cjs +3 -3
- package/lib/components/SelectBox/CheckSelectBox.js +3 -3
- package/lib/components/SelectBox/RadioSelectBox.cjs +3 -3
- package/lib/components/SelectBox/RadioSelectBox.js +3 -3
- package/lib/components/Skeleton/Skeleton.cjs +2 -2
- package/lib/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/Skeleton.js +2 -2
- package/lib/components/Snackbar/Snackbar.cjs +2 -2
- package/lib/components/Snackbar/Snackbar.js +2 -2
- package/lib/components/ToggleButton/ToggleButton.cjs +3 -5
- package/lib/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/lib/components/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +3 -5
- package/lib/components/index.cjs +4 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -0
- package/lib/components/private/useDismissible.d.ts +3 -3
- package/lib/index.cjs +4 -0
- package/lib/index.js +2 -0
- package/lib/utils/createRecipeContext.cjs +6 -41
- package/lib/utils/createRecipeContext.d.ts +4 -12
- package/lib/utils/createRecipeContext.d.ts.map +1 -1
- package/lib/utils/createRecipeContext.js +6 -41
- package/lib/utils/styled.cjs +2 -0
- package/lib/utils/styled.d.ts +2 -0
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +1 -1
- package/package.json +9 -8
- package/src/components/ActionButton/ActionButton.tsx +12 -17
- package/src/components/ActionChip/ActionChip.tsx +2 -2
- package/src/components/ActionSheet/ActionSheet.tsx +2 -2
- package/src/components/Badge/Badge.tsx +2 -2
- package/src/components/ControlChip/ControlChip.tsx +2 -2
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +2 -2
- package/src/components/ExtendedFab/ExtendedFab.tsx +2 -2
- package/src/components/Fab/Fab.tsx +2 -2
- package/src/components/Icon/Icon.tsx +37 -20
- package/src/components/LinkContent/LinkContent.tsx +2 -2
- package/src/components/MannerTemp/MannerTemp.tsx +25 -0
- package/src/components/MannerTemp/MannerTempEmote.tsx +464 -0
- package/src/components/MannerTemp/index.ts +2 -0
- package/src/components/MannerTempBadge/MannerTempBadge.tsx +2 -2
- package/src/components/NotificationBadge/NotificationBadge.tsx +2 -2
- package/src/components/ReactionButton/ReactionButton.tsx +8 -13
- package/src/components/SelectBox/CheckSelectBox.tsx +3 -3
- package/src/components/SelectBox/RadioSelectBox.tsx +3 -3
- package/src/components/Skeleton/Skeleton.tsx +2 -2
- package/src/components/Snackbar/Snackbar.tsx +2 -2
- package/src/components/ToggleButton/ToggleButton.tsx +9 -14
- package/src/components/index.ts +1 -0
- package/src/utils/createRecipeContext.tsx +12 -72
- package/src/utils/styled.tsx +2 -2
|
@@ -7,7 +7,6 @@ const actionButton = require('@seed-design/css/recipes/action-button');
|
|
|
7
7
|
const reactPrimitive = require('@seed-design/react-primitive');
|
|
8
8
|
const clsx = require('clsx');
|
|
9
9
|
const React = require('react');
|
|
10
|
-
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
11
10
|
const Icon = require('../Icon/Icon.cjs');
|
|
12
11
|
const usePendingButton = require('../LoadingIndicator/usePendingButton.cjs');
|
|
13
12
|
|
|
@@ -30,7 +29,6 @@ function _interopNamespaceDefault(e) {
|
|
|
30
29
|
|
|
31
30
|
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
32
31
|
|
|
33
|
-
const { ClassNameProvider } = createRecipeContext.createRecipeContext(actionButton.actionButton);
|
|
34
32
|
const ActionButton = React__namespace.forwardRef(
|
|
35
33
|
({ variant, size, loading = false, layout = "withText", className, children, ...otherProps }, ref) => {
|
|
36
34
|
const recipeClassName = actionButton.actionButton({ variant, layout, size });
|
|
@@ -40,7 +38,7 @@ const ActionButton = React__namespace.forwardRef(
|
|
|
40
38
|
"When layout is 'iconOnly', 'aria-label' or 'aria-labelledby' should be provided."
|
|
41
39
|
);
|
|
42
40
|
}
|
|
43
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(usePendingButton.PendingButtonProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(Icon.IconRequired, { enabled: layout === "iconOnly", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
42
|
reactPrimitive.Primitive.button,
|
|
45
43
|
{
|
|
46
44
|
ref,
|
|
@@ -49,7 +47,7 @@ const ActionButton = React__namespace.forwardRef(
|
|
|
49
47
|
...otherProps,
|
|
50
48
|
children
|
|
51
49
|
}
|
|
52
|
-
) }) })
|
|
50
|
+
) }) });
|
|
53
51
|
}
|
|
54
52
|
);
|
|
55
53
|
ActionButton.displayName = "ActionButton";
|
|
@@ -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;
|
|
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;AAE/B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAE9C,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,qBAAqB,EACrB,cAAc,EACd,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;CAAG;AAEpD,eAAO,MAAM,YAAY,6FA6BxB,CAAC"}
|
|
@@ -3,11 +3,9 @@ import { actionButton } from '@seed-design/css/recipes/action-button';
|
|
|
3
3
|
import { Primitive } from '@seed-design/react-primitive';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
7
6
|
import { IconRequired } from '../Icon/Icon.js';
|
|
8
7
|
import { usePendingButton, PendingButtonProvider } from '../LoadingIndicator/usePendingButton.js';
|
|
9
8
|
|
|
10
|
-
const { ClassNameProvider } = createRecipeContext(actionButton);
|
|
11
9
|
const ActionButton = React.forwardRef(
|
|
12
10
|
({ variant, size, loading = false, layout = "withText", className, children, ...otherProps }, ref) => {
|
|
13
11
|
const recipeClassName = actionButton({ variant, layout, size });
|
|
@@ -17,7 +15,7 @@ const ActionButton = React.forwardRef(
|
|
|
17
15
|
"When layout is 'iconOnly', 'aria-label' or 'aria-labelledby' should be provided."
|
|
18
16
|
);
|
|
19
17
|
}
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
+
return /* @__PURE__ */ jsx(PendingButtonProvider, { value: api, children: /* @__PURE__ */ jsx(IconRequired, { enabled: layout === "iconOnly", children: /* @__PURE__ */ jsx(
|
|
21
19
|
Primitive.button,
|
|
22
20
|
{
|
|
23
21
|
ref,
|
|
@@ -26,7 +24,7 @@ const ActionButton = React.forwardRef(
|
|
|
26
24
|
...otherProps,
|
|
27
25
|
children
|
|
28
26
|
}
|
|
29
|
-
) }) })
|
|
27
|
+
) }) });
|
|
30
28
|
}
|
|
31
29
|
);
|
|
32
30
|
ActionButton.displayName = "ActionButton";
|
|
@@ -7,9 +7,9 @@ const reactPrimitive = require('@seed-design/react-primitive');
|
|
|
7
7
|
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
8
8
|
const Icon = require('../Icon/Icon.cjs');
|
|
9
9
|
|
|
10
|
-
const {
|
|
10
|
+
const { withContext } = createRecipeContext.createRecipeContext(actionChip.actionChip);
|
|
11
11
|
const ActionChip = Icon.withIconRequired(
|
|
12
|
-
|
|
12
|
+
withContext(reactPrimitive.Primitive.button),
|
|
13
13
|
(props) => props.layout === "iconOnly"
|
|
14
14
|
);
|
|
15
15
|
ActionChip.displayName = "ActionChip";
|
|
@@ -3,9 +3,9 @@ import { Primitive } from '@seed-design/react-primitive';
|
|
|
3
3
|
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
4
4
|
import { withIconRequired } from '../Icon/Icon.js';
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const { withContext } = createRecipeContext(actionChip);
|
|
7
7
|
const ActionChip = withIconRequired(
|
|
8
|
-
|
|
8
|
+
withContext(Primitive.button),
|
|
9
9
|
(props) => props.layout === "iconOnly"
|
|
10
10
|
);
|
|
11
11
|
ActionChip.displayName = "ActionChip";
|
|
@@ -11,7 +11,7 @@ const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs
|
|
|
11
11
|
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
12
12
|
|
|
13
13
|
const { withRootProvider, withContext } = createSlotRecipeContext.createSlotRecipeContext(actionSheet.actionSheet);
|
|
14
|
-
const {
|
|
14
|
+
const { withContext: withItemContext } = createRecipeContext.createRecipeContext(actionSheetItem.actionSheetItem);
|
|
15
15
|
const withStateProps = createWithStateProps.createWithStateProps([reactDialog.useDialogContext]);
|
|
16
16
|
const ActionSheetRoot = withRootProvider(reactDialog.Dialog.Root, {
|
|
17
17
|
defaultProps: {
|
|
@@ -45,7 +45,7 @@ const ActionSheetList = withContext(
|
|
|
45
45
|
withStateProps(reactPrimitive.Primitive.div),
|
|
46
46
|
"list"
|
|
47
47
|
);
|
|
48
|
-
const ActionSheetItem =
|
|
48
|
+
const ActionSheetItem = withItemContext(
|
|
49
49
|
withStateProps(reactPrimitive.Primitive.button)
|
|
50
50
|
);
|
|
51
51
|
const ActionSheetCloseButton = withContext(
|
|
@@ -7,7 +7,7 @@ import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js'
|
|
|
7
7
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
8
8
|
|
|
9
9
|
const { withRootProvider, withContext } = createSlotRecipeContext(actionSheet);
|
|
10
|
-
const {
|
|
10
|
+
const { withContext: withItemContext } = createRecipeContext(actionSheetItem);
|
|
11
11
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
12
12
|
const ActionSheetRoot = withRootProvider(Dialog.Root, {
|
|
13
13
|
defaultProps: {
|
|
@@ -41,7 +41,7 @@ const ActionSheetList = withContext(
|
|
|
41
41
|
withStateProps(Primitive.div),
|
|
42
42
|
"list"
|
|
43
43
|
);
|
|
44
|
-
const ActionSheetItem =
|
|
44
|
+
const ActionSheetItem = withItemContext(
|
|
45
45
|
withStateProps(Primitive.button)
|
|
46
46
|
);
|
|
47
47
|
const ActionSheetCloseButton = withContext(
|
|
@@ -6,7 +6,7 @@ const reactPrimitive = require('@seed-design/react-primitive');
|
|
|
6
6
|
const badge = require('@seed-design/css/recipes/badge');
|
|
7
7
|
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
8
8
|
|
|
9
|
-
const {
|
|
10
|
-
const Badge =
|
|
9
|
+
const { withContext } = createRecipeContext.createRecipeContext(badge.badge);
|
|
10
|
+
const Badge = withContext(reactPrimitive.Primitive.span);
|
|
11
11
|
|
|
12
12
|
exports.Badge = Badge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAOpC,MAAM,WAAW,UACf,SAAQ,iBAAiB,EACvB,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAOpC,MAAM,WAAW,UACf,SAAQ,iBAAiB,EACvB,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAE5C,eAAO,MAAM,KAAK,oFAA2D,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { Primitive } from '@seed-design/react-primitive';
|
|
|
2
2
|
import { badge } from '@seed-design/css/recipes/badge';
|
|
3
3
|
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
const Badge =
|
|
5
|
+
const { withContext } = createRecipeContext(badge);
|
|
6
|
+
const Badge = withContext(Primitive.span);
|
|
7
7
|
|
|
8
8
|
export { Badge };
|
|
@@ -7,9 +7,9 @@ const reactPrimitive = require('@seed-design/react-primitive');
|
|
|
7
7
|
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
8
8
|
const Icon = require('../Icon/Icon.cjs');
|
|
9
9
|
|
|
10
|
-
const {
|
|
10
|
+
const { withContext } = createRecipeContext.createRecipeContext(controlChip.controlChip);
|
|
11
11
|
const ControlChip = Icon.withIconRequired(
|
|
12
|
-
|
|
12
|
+
withContext(reactPrimitive.Primitive.button),
|
|
13
13
|
(props) => props.layout === "iconOnly"
|
|
14
14
|
);
|
|
15
15
|
|
|
@@ -3,9 +3,9 @@ import { Primitive } from '@seed-design/react-primitive';
|
|
|
3
3
|
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
4
4
|
import { withIconRequired } from '../Icon/Icon.js';
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const { withContext } = createRecipeContext(controlChip);
|
|
7
7
|
const ControlChip = withIconRequired(
|
|
8
|
-
|
|
8
|
+
withContext(Primitive.button),
|
|
9
9
|
(props) => props.layout === "iconOnly"
|
|
10
10
|
);
|
|
11
11
|
|
|
@@ -11,7 +11,7 @@ const createSlotRecipeContext = require('../../utils/createSlotRecipeContext.cjs
|
|
|
11
11
|
const createWithStateProps = require('../../utils/createWithStateProps.cjs');
|
|
12
12
|
|
|
13
13
|
const { withRootProvider, withContext } = createSlotRecipeContext.createSlotRecipeContext(extendedActionSheet.extendedActionSheet);
|
|
14
|
-
const {
|
|
14
|
+
const { withContext: withItemContext } = createRecipeContext.createRecipeContext(extendedActionSheetItem.extendedActionSheetItem);
|
|
15
15
|
const withStateProps = createWithStateProps.createWithStateProps([reactDialog.useDialogContext]);
|
|
16
16
|
const ExtendedActionSheetRoot = withRootProvider(
|
|
17
17
|
reactDialog.Dialog.Root,
|
|
@@ -36,7 +36,7 @@ const ExtendedActionSheetGroup = withContext(
|
|
|
36
36
|
withStateProps(reactPrimitive.Primitive.div),
|
|
37
37
|
"group"
|
|
38
38
|
);
|
|
39
|
-
const ExtendedActionSheetItem =
|
|
39
|
+
const ExtendedActionSheetItem = withItemContext(withStateProps(reactPrimitive.Primitive.button));
|
|
40
40
|
const ExtendedActionSheetFooter = withContext(withStateProps(reactPrimitive.Primitive.div), "footer");
|
|
41
41
|
const ExtendedActionSheetCloseButton = withContext(reactDialog.Dialog.CloseButton, "closeButton");
|
|
42
42
|
|
|
@@ -7,7 +7,7 @@ import { createSlotRecipeContext } from '../../utils/createSlotRecipeContext.js'
|
|
|
7
7
|
import { createWithStateProps } from '../../utils/createWithStateProps.js';
|
|
8
8
|
|
|
9
9
|
const { withRootProvider, withContext } = createSlotRecipeContext(extendedActionSheet);
|
|
10
|
-
const {
|
|
10
|
+
const { withContext: withItemContext } = createRecipeContext(extendedActionSheetItem);
|
|
11
11
|
const withStateProps = createWithStateProps([useDialogContext]);
|
|
12
12
|
const ExtendedActionSheetRoot = withRootProvider(
|
|
13
13
|
Dialog.Root,
|
|
@@ -32,7 +32,7 @@ const ExtendedActionSheetGroup = withContext(
|
|
|
32
32
|
withStateProps(Primitive.div),
|
|
33
33
|
"group"
|
|
34
34
|
);
|
|
35
|
-
const ExtendedActionSheetItem =
|
|
35
|
+
const ExtendedActionSheetItem = withItemContext(withStateProps(Primitive.button));
|
|
36
36
|
const ExtendedActionSheetFooter = withContext(withStateProps(Primitive.div), "footer");
|
|
37
37
|
const ExtendedActionSheetCloseButton = withContext(Dialog.CloseButton, "closeButton");
|
|
38
38
|
|
|
@@ -6,8 +6,8 @@ const reactPrimitive = require('@seed-design/react-primitive');
|
|
|
6
6
|
const extendedFab = require('@seed-design/css/recipes/extended-fab');
|
|
7
7
|
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
8
8
|
|
|
9
|
-
const {
|
|
10
|
-
const ExtendedFab =
|
|
9
|
+
const { withContext } = createRecipeContext.createRecipeContext(extendedFab.extendedFab);
|
|
10
|
+
const ExtendedFab = withContext(reactPrimitive.Primitive.button, {
|
|
11
11
|
defaultProps: {
|
|
12
12
|
variant: "neutralSolid",
|
|
13
13
|
size: "medium"
|
|
@@ -2,8 +2,8 @@ import { Primitive } from '@seed-design/react-primitive';
|
|
|
2
2
|
import { extendedFab } from '@seed-design/css/recipes/extended-fab';
|
|
3
3
|
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
const ExtendedFab =
|
|
5
|
+
const { withContext } = createRecipeContext(extendedFab);
|
|
6
|
+
const ExtendedFab = withContext(Primitive.button, {
|
|
7
7
|
defaultProps: {
|
|
8
8
|
variant: "neutralSolid",
|
|
9
9
|
size: "medium"
|
|
@@ -6,7 +6,7 @@ const reactPrimitive = require('@seed-design/react-primitive');
|
|
|
6
6
|
const fab = require('@seed-design/css/recipes/fab');
|
|
7
7
|
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
8
8
|
|
|
9
|
-
const {
|
|
10
|
-
const Fab =
|
|
9
|
+
const { withContext } = createRecipeContext.createRecipeContext(fab.fab);
|
|
10
|
+
const Fab = withContext(reactPrimitive.Primitive.button);
|
|
11
11
|
|
|
12
12
|
exports.Fab = Fab;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.d.ts","sourceRoot":"","sources":["../../../src/components/Fab/Fab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAO,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAOpC,MAAM,WAAW,QACf,SAAQ,eAAe,EACrB,cAAc,EACd,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;CAAG;AAEpD,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Fab.d.ts","sourceRoot":"","sources":["../../../src/components/Fab/Fab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAO,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAOpC,MAAM,WAAW,QACf,SAAQ,eAAe,EACrB,cAAc,EACd,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;CAAG;AAEpD,eAAO,MAAM,GAAG,oFAA6D,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { Primitive } from '@seed-design/react-primitive';
|
|
|
2
2
|
import { fab } from '@seed-design/css/recipes/fab';
|
|
3
3
|
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
const Fab =
|
|
5
|
+
const { withContext } = createRecipeContext(fab);
|
|
6
|
+
const Fab = withContext(Primitive.button);
|
|
7
7
|
|
|
8
8
|
export { Fab };
|
|
@@ -6,6 +6,7 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
const reactSlot = require('@radix-ui/react-slot');
|
|
7
7
|
const reactUseLayoutEffect = require('@radix-ui/react-use-layout-effect');
|
|
8
8
|
const React = require('react');
|
|
9
|
+
const styled = require('../../utils/styled.cjs');
|
|
9
10
|
|
|
10
11
|
const PrefixIcon = React.forwardRef(
|
|
11
12
|
({ svg, ...otherProps }, ref) => {
|
|
@@ -83,25 +84,33 @@ const IconRequired = ({
|
|
|
83
84
|
}, [enabled, parentContext, register, unregister]);
|
|
84
85
|
return /* @__PURE__ */ jsxRuntime.jsx(IconContext.Provider, { value: providerValue, children });
|
|
85
86
|
};
|
|
86
|
-
const Icon = React.forwardRef(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
87
|
+
const Icon = React.forwardRef(
|
|
88
|
+
({ svg, size, color, ...otherProps }, ref) => {
|
|
89
|
+
const context = React.useContext(IconContext);
|
|
90
|
+
reactUseLayoutEffect.useLayoutEffect(() => {
|
|
91
|
+
context?.register();
|
|
92
|
+
return () => {
|
|
93
|
+
context?.unregister();
|
|
94
|
+
};
|
|
95
|
+
}, [context]);
|
|
96
|
+
const sizeValue = styled.handleDimension(size);
|
|
97
|
+
const colorValue = styled.handleColor(color);
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
reactSlot.Slot,
|
|
100
|
+
{
|
|
101
|
+
ref,
|
|
102
|
+
"aria-hidden": true,
|
|
103
|
+
className: "seed-icon",
|
|
104
|
+
style: {
|
|
105
|
+
"--seed-icon-size": sizeValue,
|
|
106
|
+
"--seed-icon-color": colorValue
|
|
107
|
+
},
|
|
108
|
+
...otherProps,
|
|
109
|
+
children: svg
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
105
114
|
function withIconRequired(Component, enabledPredicate) {
|
|
106
115
|
const Node = React.forwardRef((props, ref) => {
|
|
107
116
|
const enabled = enabledPredicate(props);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ColorFg, ColorPalette, Dimension } from '@seed-design/css/vars';
|
|
1
2
|
import { ForwardRefExoticComponent, RefAttributes, PropsWithoutRef } from 'react';
|
|
2
3
|
export interface PrefixIconProps {
|
|
3
4
|
svg: React.ReactNode;
|
|
@@ -13,6 +14,8 @@ export declare const IconRequired: ({ children, enabled, }: {
|
|
|
13
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export interface IconProps {
|
|
15
16
|
svg: React.ReactNode;
|
|
17
|
+
size?: Dimension | string;
|
|
18
|
+
color?: `fg.${ColorFg}` | `palette.${ColorPalette}`;
|
|
16
19
|
}
|
|
17
20
|
export declare const Icon: ForwardRefExoticComponent<IconProps & RefAttributes<SVGSVGElement>>;
|
|
18
21
|
export declare function withIconRequired<P extends {}, R>(Component: React.ComponentType<P & React.RefAttributes<R>>, enabledPredicate: (props: React.PropsWithoutRef<P>) => boolean): ForwardRefExoticComponent< PropsWithoutRef<P> & RefAttributes<R>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAI9E,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,2GAatB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,2GAatB,CAAC;AAIF,eAAO,MAAM,YAAY,2BAGtB;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,4CAsDjD,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC;IAErB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAE1B,KAAK,CAAC,EAAE,MAAM,OAAO,EAAE,GAAG,WAAW,YAAY,EAAE,CAAC;CACrD;AAED,eAAO,MAAM,IAAI,qGA+BhB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAC9C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAC1D,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,OAAO,oHAe/D"}
|
|
@@ -2,6 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
3
|
import { useLayoutEffect } from '@radix-ui/react-use-layout-effect';
|
|
4
4
|
import { forwardRef, useContext, createContext, useRef, useCallback, useMemo } from 'react';
|
|
5
|
+
import { handleDimension, handleColor } from '../../utils/styled.js';
|
|
5
6
|
|
|
6
7
|
const PrefixIcon = forwardRef(
|
|
7
8
|
({ svg, ...otherProps }, ref) => {
|
|
@@ -79,25 +80,33 @@ const IconRequired = ({
|
|
|
79
80
|
}, [enabled, parentContext, register, unregister]);
|
|
80
81
|
return /* @__PURE__ */ jsx(IconContext.Provider, { value: providerValue, children });
|
|
81
82
|
};
|
|
82
|
-
const Icon = forwardRef(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
83
|
+
const Icon = forwardRef(
|
|
84
|
+
({ svg, size, color, ...otherProps }, ref) => {
|
|
85
|
+
const context = useContext(IconContext);
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
context?.register();
|
|
88
|
+
return () => {
|
|
89
|
+
context?.unregister();
|
|
90
|
+
};
|
|
91
|
+
}, [context]);
|
|
92
|
+
const sizeValue = handleDimension(size);
|
|
93
|
+
const colorValue = handleColor(color);
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
Slot,
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
"aria-hidden": true,
|
|
99
|
+
className: "seed-icon",
|
|
100
|
+
style: {
|
|
101
|
+
"--seed-icon-size": sizeValue,
|
|
102
|
+
"--seed-icon-color": colorValue
|
|
103
|
+
},
|
|
104
|
+
...otherProps,
|
|
105
|
+
children: svg
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
101
110
|
function withIconRequired(Component, enabledPredicate) {
|
|
102
111
|
const Node = forwardRef((props, ref) => {
|
|
103
112
|
const enabled = enabledPredicate(props);
|
|
@@ -7,8 +7,8 @@ const reactPrimitive = require('@seed-design/react-primitive');
|
|
|
7
7
|
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
8
8
|
const styled = require('../../utils/styled.cjs');
|
|
9
9
|
|
|
10
|
-
const {
|
|
11
|
-
const LinkContent =
|
|
10
|
+
const { withContext } = createRecipeContext.createRecipeContext(linkContent.linkContent);
|
|
11
|
+
const LinkContent = withContext(
|
|
12
12
|
styled.withStyleProps(reactPrimitive.Primitive.span)
|
|
13
13
|
);
|
|
14
14
|
|
|
@@ -3,8 +3,8 @@ import { Primitive } from '@seed-design/react-primitive';
|
|
|
3
3
|
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
4
4
|
import { withStyleProps } from '../../utils/styled.js';
|
|
5
5
|
|
|
6
|
-
const {
|
|
7
|
-
const LinkContent =
|
|
6
|
+
const { withContext } = createRecipeContext(linkContent);
|
|
7
|
+
const LinkContent = withContext(
|
|
8
8
|
withStyleProps(Primitive.span)
|
|
9
9
|
);
|
|
10
10
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const mannerTemp = require('@seed-design/css/recipes/manner-temp');
|
|
7
|
+
const reactPrimitive = require('@seed-design/react-primitive');
|
|
8
|
+
const React = require('react');
|
|
9
|
+
const createRecipeContext = require('../../utils/createRecipeContext.cjs');
|
|
10
|
+
const MannerTempEmote = require('./MannerTempEmote.cjs');
|
|
11
|
+
|
|
12
|
+
const { withContext } = createRecipeContext.createRecipeContext(mannerTemp.mannerTemp);
|
|
13
|
+
const MannerTempBase = withContext(reactPrimitive.Primitive.span);
|
|
14
|
+
const MannerTemp = React.forwardRef((props, ref) => {
|
|
15
|
+
const emoteProps = React.useMemo(() => ({ level: props.level }), [props.level]);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MannerTempEmote.MannerTempEmotePropsProvider, { value: emoteProps, children: /* @__PURE__ */ jsxRuntime.jsx(MannerTempBase, { ...props, ref }) });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
exports.MannerTemp = MannerTemp;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MannerTempVariantProps } from '@seed-design/css/recipes/manner-temp';
|
|
2
|
+
import { PrimitiveProps } from '@seed-design/react-primitive';
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
export interface MannerTempProps extends MannerTempVariantProps, PrimitiveProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
}
|
|
6
|
+
export declare const MannerTemp: React.ForwardRefExoticComponent<MannerTempProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
//# sourceMappingURL=MannerTemp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MannerTemp.d.ts","sourceRoot":"","sources":["../../../src/components/MannerTemp/MannerTemp.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAOpC,MAAM,WAAW,eACf,SAAQ,sBAAsB,EAC5B,cAAc,EACd,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;CAAG;AAI5C,eAAO,MAAM,UAAU,yFAQrB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { mannerTemp } from '@seed-design/css/recipes/manner-temp';
|
|
3
|
+
import { Primitive } from '@seed-design/react-primitive';
|
|
4
|
+
import { forwardRef, useMemo } from 'react';
|
|
5
|
+
import { createRecipeContext } from '../../utils/createRecipeContext.js';
|
|
6
|
+
import { MannerTempEmotePropsProvider } from './MannerTempEmote.js';
|
|
7
|
+
|
|
8
|
+
const { withContext } = createRecipeContext(mannerTemp);
|
|
9
|
+
const MannerTempBase = withContext(Primitive.span);
|
|
10
|
+
const MannerTemp = forwardRef((props, ref) => {
|
|
11
|
+
const emoteProps = useMemo(() => ({ level: props.level }), [props.level]);
|
|
12
|
+
return /* @__PURE__ */ jsx(MannerTempEmotePropsProvider, { value: emoteProps, children: /* @__PURE__ */ jsx(MannerTempBase, { ...props, ref }) });
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { MannerTemp };
|