@seed-design/react 0.0.29 → 0.0.31
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/ContextualFloatingButton/ContextualFloatingButton.cjs +54 -0
- package/lib/components/ContextualFloatingButton/ContextualFloatingButton.d.ts +8 -0
- package/lib/components/ContextualFloatingButton/ContextualFloatingButton.d.ts.map +1 -0
- package/lib/components/ContextualFloatingButton/ContextualFloatingButton.js +31 -0
- package/lib/components/ContextualFloatingButton/index.cjs +9 -0
- package/lib/components/ContextualFloatingButton/index.d.ts +2 -0
- package/lib/components/ContextualFloatingButton/index.d.ts.map +1 -0
- package/lib/components/ContextualFloatingButton/index.js +1 -0
- package/lib/components/ExtendedFab/ExtendedFab.d.ts +6 -0
- package/lib/components/ExtendedFab/ExtendedFab.d.ts.map +1 -1
- package/lib/components/Fab/Fab.d.ts +6 -0
- package/lib/components/Fab/Fab.d.ts.map +1 -1
- package/lib/components/Float/Float.cjs +97 -0
- package/lib/components/Float/Float.d.ts +17 -0
- package/lib/components/Float/Float.d.ts.map +1 -0
- package/lib/components/Float/Float.js +74 -0
- package/lib/components/Float/index.cjs +9 -0
- package/lib/components/Float/index.d.ts +2 -0
- package/lib/components/Float/index.d.ts.map +1 -0
- package/lib/components/Float/index.js +1 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.cjs +18 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.d.ts +14 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.d.ts.map +1 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.js +12 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.namespace.cjs +11 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.namespace.d.ts +2 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.namespace.d.ts.map +1 -0
- package/lib/components/FloatingActionButton/FloatingActionButton.namespace.js +1 -0
- package/lib/components/FloatingActionButton/index.cjs +13 -0
- package/lib/components/FloatingActionButton/index.d.ts +3 -0
- package/lib/components/FloatingActionButton/index.d.ts.map +1 -0
- package/lib/components/FloatingActionButton/index.js +3 -0
- package/lib/components/Icon/Icon.d.ts +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.namespace.cjs +5 -0
- package/lib/components/Tabs/Tabs.namespace.d.ts +1 -0
- package/lib/components/Tabs/Tabs.namespace.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.namespace.js +1 -0
- package/lib/components/Tabs/index.cjs +5 -0
- package/lib/components/Tabs/index.d.ts +1 -0
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +1 -0
- package/lib/components/index.cjs +15 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +6 -0
- package/lib/index.cjs +15 -0
- package/lib/index.js +6 -0
- package/lib/utils/styled.cjs +4 -0
- package/lib/utils/styled.d.ts +3 -1
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +4 -0
- package/package.json +5 -5
- package/src/components/ContextualFloatingButton/ContextualFloatingButton.tsx +49 -0
- package/src/components/ContextualFloatingButton/index.ts +4 -0
- package/src/components/ExtendedFab/ExtendedFab.tsx +6 -0
- package/src/components/Fab/Fab.tsx +6 -0
- package/src/components/Float/Float.tsx +116 -0
- package/src/components/Float/index.ts +1 -0
- package/src/components/FloatingActionButton/FloatingActionButton.namespace.tsx +8 -0
- package/src/components/FloatingActionButton/FloatingActionButton.tsx +38 -0
- package/src/components/FloatingActionButton/index.ts +10 -0
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Tabs/Tabs.namespace.ts +2 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/index.ts +3 -0
- package/src/utils/styled.tsx +10 -1
|
@@ -11,6 +11,7 @@ export * from './Checkbox';
|
|
|
11
11
|
export * from './ChipTabs';
|
|
12
12
|
export * from './Columns';
|
|
13
13
|
export * from './ConsistentWidth';
|
|
14
|
+
export * from './ContextualFloatingButton';
|
|
14
15
|
export * from './ControlChip';
|
|
15
16
|
export * from './Count';
|
|
16
17
|
export * from './Dialog';
|
|
@@ -18,7 +19,9 @@ export * from './Divider';
|
|
|
18
19
|
export * from './ExtendedActionSheet';
|
|
19
20
|
export * from './ExtendedFab';
|
|
20
21
|
export * from './Fab';
|
|
22
|
+
export * from './FloatingActionButton';
|
|
21
23
|
export * from './Flex';
|
|
24
|
+
export * from './Float';
|
|
22
25
|
export * from './HelpBubble';
|
|
23
26
|
export * from './Icon';
|
|
24
27
|
export * from './IdentityPlaceholder';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAA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AAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import * as ChipTabs_namespace from './ChipTabs/ChipTabs.namespace.js';
|
|
|
23
23
|
export { ChipTabs_namespace as ChipTabs };
|
|
24
24
|
export { Column, Columns } from './Columns/Columns.js';
|
|
25
25
|
export { ConsistentWidth } from './ConsistentWidth/ConsistentWidth.js';
|
|
26
|
+
export { ContextualFloatingButton } from './ContextualFloatingButton/ContextualFloatingButton.js';
|
|
26
27
|
export { ControlChip } from './ControlChip/ControlChip.js';
|
|
27
28
|
export { Count } from './Count/Count.js';
|
|
28
29
|
export { DialogAction, DialogBackdrop, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPositioner, DialogRoot, DialogTitle, DialogTrigger } from './Dialog/Dialog.js';
|
|
@@ -34,7 +35,11 @@ import * as ExtendedActionSheet_namespace from './ExtendedActionSheet/ExtendedAc
|
|
|
34
35
|
export { ExtendedActionSheet_namespace as ExtendedActionSheet };
|
|
35
36
|
export { ExtendedFab } from './ExtendedFab/ExtendedFab.js';
|
|
36
37
|
export { Fab } from './Fab/Fab.js';
|
|
38
|
+
export { FloatingActionButtonIcon, FloatingActionButtonLabel, FloatingActionButtonRoot } from './FloatingActionButton/FloatingActionButton.js';
|
|
39
|
+
import * as FloatingActionButton_namespace from './FloatingActionButton/FloatingActionButton.namespace.js';
|
|
40
|
+
export { FloatingActionButton_namespace as FloatingActionButton };
|
|
37
41
|
export { Flex } from './Flex/Flex.js';
|
|
42
|
+
export { Float } from './Float/Float.js';
|
|
38
43
|
export { HelpBubbleAnchor, HelpBubbleArrow, HelpBubbleArrowTip, HelpBubbleCloseButton, HelpBubbleContent, HelpBubbleDescription, HelpBubblePositioner, HelpBubbleRoot, HelpBubbleTitle, HelpBubbleTrigger } from './HelpBubble/HelpBubble.js';
|
|
39
44
|
import * as HelpBubble_namespace from './HelpBubble/HelpBubble.namespace.js';
|
|
40
45
|
export { HelpBubble_namespace as HelpBubble };
|
|
@@ -81,6 +86,7 @@ export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb
|
|
|
81
86
|
import * as Switch_namespace from './Switch/Switch.namespace.js';
|
|
82
87
|
export { Switch_namespace as Switch };
|
|
83
88
|
export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './Tabs/Tabs.js';
|
|
89
|
+
export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
|
|
84
90
|
import * as Tabs_namespace from './Tabs/Tabs.namespace.js';
|
|
85
91
|
export { Tabs_namespace as Tabs };
|
|
86
92
|
export { Text } from './Text/Text.js';
|
package/lib/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ const ChipTabs = require('./components/ChipTabs/ChipTabs.cjs');
|
|
|
21
21
|
const ChipTabs_namespace = require('./components/ChipTabs/ChipTabs.namespace.cjs');
|
|
22
22
|
const Columns = require('./components/Columns/Columns.cjs');
|
|
23
23
|
const ConsistentWidth = require('./components/ConsistentWidth/ConsistentWidth.cjs');
|
|
24
|
+
const ContextualFloatingButton = require('./components/ContextualFloatingButton/ContextualFloatingButton.cjs');
|
|
24
25
|
const ControlChip = require('./components/ControlChip/ControlChip.cjs');
|
|
25
26
|
const Count = require('./components/Count/Count.cjs');
|
|
26
27
|
const Dialog = require('./components/Dialog/Dialog.cjs');
|
|
@@ -30,7 +31,10 @@ const ExtendedActionSheet = require('./components/ExtendedActionSheet/ExtendedAc
|
|
|
30
31
|
const ExtendedActionSheet_namespace = require('./components/ExtendedActionSheet/ExtendedActionSheet.namespace.cjs');
|
|
31
32
|
const ExtendedFab = require('./components/ExtendedFab/ExtendedFab.cjs');
|
|
32
33
|
const Fab = require('./components/Fab/Fab.cjs');
|
|
34
|
+
const FloatingActionButton = require('./components/FloatingActionButton/FloatingActionButton.cjs');
|
|
35
|
+
const FloatingActionButton_namespace = require('./components/FloatingActionButton/FloatingActionButton.namespace.cjs');
|
|
33
36
|
const Flex = require('./components/Flex/Flex.cjs');
|
|
37
|
+
const Float = require('./components/Float/Float.cjs');
|
|
34
38
|
const HelpBubble = require('./components/HelpBubble/HelpBubble.cjs');
|
|
35
39
|
const HelpBubble_namespace = require('./components/HelpBubble/HelpBubble.namespace.cjs');
|
|
36
40
|
const Icon = require('./components/Icon/Icon.cjs');
|
|
@@ -67,6 +71,7 @@ const Stack = require('./components/Stack/Stack.cjs');
|
|
|
67
71
|
const Switch = require('./components/Switch/Switch.cjs');
|
|
68
72
|
const Switch_namespace = require('./components/Switch/Switch.namespace.cjs');
|
|
69
73
|
const Tabs = require('./components/Tabs/Tabs.cjs');
|
|
74
|
+
const reactTabs = require('@seed-design/react-tabs');
|
|
70
75
|
const Tabs_namespace = require('./components/Tabs/Tabs.namespace.cjs');
|
|
71
76
|
const Text = require('./components/Text/Text.cjs');
|
|
72
77
|
const TextField = require('./components/TextField/TextField.cjs');
|
|
@@ -134,6 +139,7 @@ exports.ChipTabs = ChipTabs_namespace;
|
|
|
134
139
|
exports.Column = Columns.Column;
|
|
135
140
|
exports.Columns = Columns.Columns;
|
|
136
141
|
exports.ConsistentWidth = ConsistentWidth.ConsistentWidth;
|
|
142
|
+
exports.ContextualFloatingButton = ContextualFloatingButton.ContextualFloatingButton;
|
|
137
143
|
exports.ControlChip = ControlChip.ControlChip;
|
|
138
144
|
exports.Count = Count.Count;
|
|
139
145
|
exports.DialogAction = Dialog.DialogAction;
|
|
@@ -163,7 +169,12 @@ exports.ExtendedActionSheetTrigger = ExtendedActionSheet.ExtendedActionSheetTrig
|
|
|
163
169
|
exports.ExtendedActionSheet = ExtendedActionSheet_namespace;
|
|
164
170
|
exports.ExtendedFab = ExtendedFab.ExtendedFab;
|
|
165
171
|
exports.Fab = Fab.Fab;
|
|
172
|
+
exports.FloatingActionButtonIcon = FloatingActionButton.FloatingActionButtonIcon;
|
|
173
|
+
exports.FloatingActionButtonLabel = FloatingActionButton.FloatingActionButtonLabel;
|
|
174
|
+
exports.FloatingActionButtonRoot = FloatingActionButton.FloatingActionButtonRoot;
|
|
175
|
+
exports.FloatingActionButton = FloatingActionButton_namespace;
|
|
166
176
|
exports.Flex = Flex.Flex;
|
|
177
|
+
exports.Float = Float.Float;
|
|
167
178
|
exports.HelpBubbleAnchor = HelpBubble.HelpBubbleAnchor;
|
|
168
179
|
exports.HelpBubbleArrow = HelpBubble.HelpBubbleArrow;
|
|
169
180
|
exports.HelpBubbleArrowTip = HelpBubble.HelpBubbleArrowTip;
|
|
@@ -265,6 +276,10 @@ exports.TabsIndicator = Tabs.TabsIndicator;
|
|
|
265
276
|
exports.TabsList = Tabs.TabsList;
|
|
266
277
|
exports.TabsRoot = Tabs.TabsRoot;
|
|
267
278
|
exports.TabsTrigger = Tabs.TabsTrigger;
|
|
279
|
+
Object.defineProperty(exports, "tabsCarouselPreventDrag", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: () => reactTabs.tabsCarouselPreventDrag
|
|
282
|
+
});
|
|
268
283
|
exports.Tabs = Tabs_namespace;
|
|
269
284
|
exports.Text = Text.Text;
|
|
270
285
|
exports.TextFieldCharacterCount = TextField.TextFieldCharacterCount;
|
package/lib/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import * as ChipTabs_namespace from './components/ChipTabs/ChipTabs.namespace.js
|
|
|
23
23
|
export { ChipTabs_namespace as ChipTabs };
|
|
24
24
|
export { Column, Columns } from './components/Columns/Columns.js';
|
|
25
25
|
export { ConsistentWidth } from './components/ConsistentWidth/ConsistentWidth.js';
|
|
26
|
+
export { ContextualFloatingButton } from './components/ContextualFloatingButton/ContextualFloatingButton.js';
|
|
26
27
|
export { ControlChip } from './components/ControlChip/ControlChip.js';
|
|
27
28
|
export { Count } from './components/Count/Count.js';
|
|
28
29
|
export { DialogAction, DialogBackdrop, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPositioner, DialogRoot, DialogTitle, DialogTrigger } from './components/Dialog/Dialog.js';
|
|
@@ -34,7 +35,11 @@ import * as ExtendedActionSheet_namespace from './components/ExtendedActionSheet
|
|
|
34
35
|
export { ExtendedActionSheet_namespace as ExtendedActionSheet };
|
|
35
36
|
export { ExtendedFab } from './components/ExtendedFab/ExtendedFab.js';
|
|
36
37
|
export { Fab } from './components/Fab/Fab.js';
|
|
38
|
+
export { FloatingActionButtonIcon, FloatingActionButtonLabel, FloatingActionButtonRoot } from './components/FloatingActionButton/FloatingActionButton.js';
|
|
39
|
+
import * as FloatingActionButton_namespace from './components/FloatingActionButton/FloatingActionButton.namespace.js';
|
|
40
|
+
export { FloatingActionButton_namespace as FloatingActionButton };
|
|
37
41
|
export { Flex } from './components/Flex/Flex.js';
|
|
42
|
+
export { Float } from './components/Float/Float.js';
|
|
38
43
|
export { HelpBubbleAnchor, HelpBubbleArrow, HelpBubbleArrowTip, HelpBubbleCloseButton, HelpBubbleContent, HelpBubbleDescription, HelpBubblePositioner, HelpBubbleRoot, HelpBubbleTitle, HelpBubbleTrigger } from './components/HelpBubble/HelpBubble.js';
|
|
39
44
|
import * as HelpBubble_namespace from './components/HelpBubble/HelpBubble.namespace.js';
|
|
40
45
|
export { HelpBubble_namespace as HelpBubble };
|
|
@@ -81,6 +86,7 @@ export { SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchThumb
|
|
|
81
86
|
import * as Switch_namespace from './components/Switch/Switch.namespace.js';
|
|
82
87
|
export { Switch_namespace as Switch };
|
|
83
88
|
export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from './components/Tabs/Tabs.js';
|
|
89
|
+
export { tabsCarouselPreventDrag } from '@seed-design/react-tabs';
|
|
84
90
|
import * as Tabs_namespace from './components/Tabs/Tabs.namespace.js';
|
|
85
91
|
export { Tabs_namespace as Tabs };
|
|
86
92
|
export { Text } from './components/Text/Text.js';
|
package/lib/utils/styled.cjs
CHANGED
|
@@ -165,6 +165,7 @@ function useStyleProps(props) {
|
|
|
165
165
|
position,
|
|
166
166
|
overflowX,
|
|
167
167
|
overflowY,
|
|
168
|
+
zIndex,
|
|
168
169
|
flexGrow,
|
|
169
170
|
flexShrink,
|
|
170
171
|
flexDirection,
|
|
@@ -174,6 +175,7 @@ function useStyleProps(props) {
|
|
|
174
175
|
alignContent,
|
|
175
176
|
alignSelf,
|
|
176
177
|
gap,
|
|
178
|
+
unstable_transform,
|
|
177
179
|
style,
|
|
178
180
|
...restProps
|
|
179
181
|
} = props;
|
|
@@ -214,6 +216,7 @@ function useStyleProps(props) {
|
|
|
214
216
|
"--seed-box-position": position,
|
|
215
217
|
"--seed-box-overflow-x": overflowX,
|
|
216
218
|
"--seed-box-overflow-y": overflowY,
|
|
219
|
+
"--seed-box-z-index": zIndex,
|
|
217
220
|
"--seed-box-flex-grow": flexGrow,
|
|
218
221
|
"--seed-box-flex-shrink": flexShrink,
|
|
219
222
|
"--seed-box-flex-direction": handleFlexDirection(flexDirection),
|
|
@@ -222,6 +225,7 @@ function useStyleProps(props) {
|
|
|
222
225
|
"--seed-box-align-items": handleAlignItems(alignItems),
|
|
223
226
|
"--seed-box-align-content": handleAlignItems(alignContent),
|
|
224
227
|
"--seed-box-align-self": handleAlignItems(alignSelf),
|
|
228
|
+
"--seed-box-unstable-transform": unstable_transform,
|
|
225
229
|
...style
|
|
226
230
|
},
|
|
227
231
|
restProps
|
package/lib/utils/styled.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScopedColorBg, ScopedColorFg, ScopedColorPalette, ScopedColorStroke, Dimension, Radius, SpacingX, SpacingY } from '@seed-design/css/vars';
|
|
2
2
|
import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
|
|
3
3
|
export declare function handleColor(color: string | undefined): any;
|
|
4
|
-
export declare function handleDimension(dimension: string | 0 | undefined):
|
|
4
|
+
export declare function handleDimension(dimension: string | 0 | undefined): string | undefined;
|
|
5
5
|
export interface StyleProps {
|
|
6
6
|
background?: ScopedColorBg | ScopedColorPalette | (string & {});
|
|
7
7
|
/**
|
|
@@ -69,6 +69,7 @@ export interface StyleProps {
|
|
|
69
69
|
position?: "relative" | "absolute" | "fixed" | "sticky";
|
|
70
70
|
overflowX?: "visible" | "hidden" | "scroll" | "auto";
|
|
71
71
|
overflowY?: "visible" | "hidden" | "scroll" | "auto";
|
|
72
|
+
zIndex?: number | (string & {});
|
|
72
73
|
flexGrow?: 0 | 1 | (number & {});
|
|
73
74
|
flexShrink?: 0 | (number & {});
|
|
74
75
|
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | "rowReverse" | "columnReverse";
|
|
@@ -78,6 +79,7 @@ export interface StyleProps {
|
|
|
78
79
|
alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "flexStart" | "flexEnd";
|
|
79
80
|
alignSelf?: "flex-start" | "flex-end" | "center" | "stretch" | "flexStart" | "flexEnd";
|
|
80
81
|
gap?: Dimension | `spacingX.${SpacingX}` | `spacingY.${SpacingY}` | 0 | (string & {});
|
|
82
|
+
unstable_transform?: string;
|
|
81
83
|
}
|
|
82
84
|
interface UseStyleProps extends StyleProps {
|
|
83
85
|
style?: React.CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/utils/styled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAI/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,OAOpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../src/utils/styled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAI/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,OAOpD;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAiBrF;AAgHD,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEhE;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAExD,KAAK,CAAC,EAAE,aAAa,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAE3D,WAAW,CAAC,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAErE,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAEpC,cAAc,CA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Z,UAAU,GACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,SAAS,CAAC;IAEd,GAAG,CAAC,EAAE,SAAS,GAAG,YAAY,QAAQ,EAAE,GAAG,YAAY,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAGtF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,UAAU,aAAc,SAAQ,UAAU;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EACnD,KAAK,EAAE,CAAC,GACP;IACD,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,aAAa,CAAC,CAAC;CACzC,CAkHA;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAC5C,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,oHAY3D"}
|
package/lib/utils/styled.js
CHANGED
|
@@ -161,6 +161,7 @@ function useStyleProps(props) {
|
|
|
161
161
|
position,
|
|
162
162
|
overflowX,
|
|
163
163
|
overflowY,
|
|
164
|
+
zIndex,
|
|
164
165
|
flexGrow,
|
|
165
166
|
flexShrink,
|
|
166
167
|
flexDirection,
|
|
@@ -170,6 +171,7 @@ function useStyleProps(props) {
|
|
|
170
171
|
alignContent,
|
|
171
172
|
alignSelf,
|
|
172
173
|
gap,
|
|
174
|
+
unstable_transform,
|
|
173
175
|
style,
|
|
174
176
|
...restProps
|
|
175
177
|
} = props;
|
|
@@ -210,6 +212,7 @@ function useStyleProps(props) {
|
|
|
210
212
|
"--seed-box-position": position,
|
|
211
213
|
"--seed-box-overflow-x": overflowX,
|
|
212
214
|
"--seed-box-overflow-y": overflowY,
|
|
215
|
+
"--seed-box-z-index": zIndex,
|
|
213
216
|
"--seed-box-flex-grow": flexGrow,
|
|
214
217
|
"--seed-box-flex-shrink": flexShrink,
|
|
215
218
|
"--seed-box-flex-direction": handleFlexDirection(flexDirection),
|
|
@@ -218,6 +221,7 @@ function useStyleProps(props) {
|
|
|
218
221
|
"--seed-box-align-items": handleAlignItems(alignItems),
|
|
219
222
|
"--seed-box-align-content": handleAlignItems(alignContent),
|
|
220
223
|
"--seed-box-align-self": handleAlignItems(alignSelf),
|
|
224
|
+
"--seed-box-unstable-transform": unstable_transform,
|
|
221
225
|
...style
|
|
222
226
|
},
|
|
223
227
|
restProps
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -46,23 +46,23 @@
|
|
|
46
46
|
"@seed-design/react-portal": "0.0.2",
|
|
47
47
|
"@seed-design/react-primitive": "0.0.3",
|
|
48
48
|
"@seed-design/react-progress": "0.0.4",
|
|
49
|
-
"@seed-design/react-pull-to-refresh": "0.0.
|
|
49
|
+
"@seed-design/react-pull-to-refresh": "0.0.6",
|
|
50
50
|
"@seed-design/react-radio-group": "0.0.4",
|
|
51
51
|
"@seed-design/react-segmented-control": "0.0.5",
|
|
52
52
|
"@seed-design/react-snackbar": "0.0.5",
|
|
53
53
|
"@seed-design/react-switch": "0.0.4",
|
|
54
|
-
"@seed-design/react-tabs": "0.0.
|
|
54
|
+
"@seed-design/react-tabs": "0.0.8",
|
|
55
55
|
"@seed-design/react-text-field": "0.0.4",
|
|
56
56
|
"@seed-design/react-toggle": "0.0.4",
|
|
57
57
|
"clsx": "^2.1.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@seed-design/css": "0.0.
|
|
60
|
+
"@seed-design/css": "0.0.31",
|
|
61
61
|
"react": ">=18.0.0",
|
|
62
62
|
"react-dom": ">=18.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@seed-design/css": "0.0.
|
|
65
|
+
"@seed-design/css": "0.0.31",
|
|
66
66
|
"@vitejs/plugin-react": "^4.4.1",
|
|
67
67
|
"globby": "^14.1.0",
|
|
68
68
|
"react": "^19.1.0",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
contextualFloatingButton,
|
|
3
|
+
type ContextualFloatingButtonVariantProps,
|
|
4
|
+
} from "@seed-design/css/recipes/contextual-floating-button";
|
|
5
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { IconRequired } from "../Icon/Icon";
|
|
9
|
+
import {
|
|
10
|
+
PendingButtonProvider,
|
|
11
|
+
usePendingButton,
|
|
12
|
+
type UsePendingButtonProps,
|
|
13
|
+
} from "../LoadingIndicator/usePendingButton";
|
|
14
|
+
|
|
15
|
+
export interface ContextualFloatingButtonProps
|
|
16
|
+
extends ContextualFloatingButtonVariantProps,
|
|
17
|
+
UsePendingButtonProps,
|
|
18
|
+
PrimitiveProps,
|
|
19
|
+
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
20
|
+
|
|
21
|
+
export const ContextualFloatingButton = React.forwardRef<
|
|
22
|
+
HTMLButtonElement,
|
|
23
|
+
ContextualFloatingButtonProps
|
|
24
|
+
>(({ variant, loading = false, layout = "withText", className, children, ...otherProps }, ref) => {
|
|
25
|
+
const recipeClassName = contextualFloatingButton({ variant, layout });
|
|
26
|
+
const api = usePendingButton({ loading, disabled: otherProps.disabled });
|
|
27
|
+
|
|
28
|
+
if (layout === "iconOnly" && !(otherProps["aria-label"] || otherProps["aria-labelledby"])) {
|
|
29
|
+
console.warn(
|
|
30
|
+
"When layout is 'iconOnly', 'aria-label' or 'aria-labelledby' should be provided.",
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<PendingButtonProvider value={api}>
|
|
36
|
+
<IconRequired enabled={layout === "iconOnly"}>
|
|
37
|
+
<Primitive.button
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={clsx(recipeClassName, className)}
|
|
40
|
+
{...api.stateProps}
|
|
41
|
+
{...otherProps}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</Primitive.button>
|
|
45
|
+
</IconRequired>
|
|
46
|
+
</PendingButtonProvider>
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
ContextualFloatingButton.displayName = "ContextualFloatingButton";
|
|
@@ -6,11 +6,17 @@ const { withContext } = createRecipeContext(extendedFab);
|
|
|
6
6
|
|
|
7
7
|
////////////////////////////////////////////////////////////////////////////////////
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `ContextualFloatingButton` instead.
|
|
11
|
+
*/
|
|
9
12
|
export interface ExtendedFabProps
|
|
10
13
|
extends ExtendedFabVariantProps,
|
|
11
14
|
PrimitiveProps,
|
|
12
15
|
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
13
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `ContextualFloatingButton` instead.
|
|
19
|
+
*/
|
|
14
20
|
export const ExtendedFab = withContext<HTMLButtonElement, ExtendedFabProps>(Primitive.button, {
|
|
15
21
|
defaultProps: {
|
|
16
22
|
variant: "neutralSolid",
|
|
@@ -7,9 +7,15 @@ const { withContext } = createRecipeContext(fab);
|
|
|
7
7
|
|
|
8
8
|
////////////////////////////////////////////////////////////////////////////////////
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `ContextualFloatingButton` instead.
|
|
12
|
+
*/
|
|
10
13
|
export interface FabProps
|
|
11
14
|
extends FabVariantProps,
|
|
12
15
|
PrimitiveProps,
|
|
13
16
|
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
14
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `ContextualFloatingButton` instead.
|
|
20
|
+
*/
|
|
15
21
|
export const Fab = withContext<HTMLButtonElement, FabProps>(Primitive.button);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Dimension } from "@seed-design/css/vars";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Box } from "../Box/Box";
|
|
4
|
+
import { handleDimension } from "../../utils/styled";
|
|
5
|
+
|
|
6
|
+
export interface FloatProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
as?: React.ElementType;
|
|
8
|
+
|
|
9
|
+
placement:
|
|
10
|
+
| "bottom-end"
|
|
11
|
+
| "bottom-start"
|
|
12
|
+
| "top-end"
|
|
13
|
+
| "top-start"
|
|
14
|
+
| "bottom-center"
|
|
15
|
+
| "top-center"
|
|
16
|
+
| "middle-center"
|
|
17
|
+
| "middle-end"
|
|
18
|
+
| "middle-start";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
offsetX?: 0 | Dimension | (string & {});
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
offsetY?: 0 | Dimension | (string & {});
|
|
29
|
+
|
|
30
|
+
zIndex?: number | (string & {});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getPlacementStyle(
|
|
34
|
+
placement: FloatProps["placement"],
|
|
35
|
+
offsetX: 0 | (string & {}) | undefined,
|
|
36
|
+
offsetY: 0 | (string & {}) | undefined,
|
|
37
|
+
): {
|
|
38
|
+
top?: 0 | string | undefined;
|
|
39
|
+
left?: 0 | string | undefined;
|
|
40
|
+
right?: 0 | string | undefined;
|
|
41
|
+
bottom?: 0 | string | undefined;
|
|
42
|
+
unstable_transform?: string | undefined;
|
|
43
|
+
} {
|
|
44
|
+
const offsetXValue = handleDimension(offsetX);
|
|
45
|
+
const offsetYValue = handleDimension(offsetY);
|
|
46
|
+
|
|
47
|
+
const centerLeft = offsetXValue ? `calc(50% + ${offsetXValue})` : "50%";
|
|
48
|
+
const middleTop = offsetYValue ? `calc(50% + ${offsetYValue})` : "50%";
|
|
49
|
+
|
|
50
|
+
const shiftLeft = "translateX(-50%)";
|
|
51
|
+
const shiftTop = "translateY(-50%)";
|
|
52
|
+
const shiftBoth = "translate(-50%, -50%)";
|
|
53
|
+
|
|
54
|
+
switch (placement) {
|
|
55
|
+
case "top-start":
|
|
56
|
+
return {
|
|
57
|
+
top: offsetYValue ?? 0,
|
|
58
|
+
left: offsetXValue ?? 0,
|
|
59
|
+
};
|
|
60
|
+
case "top-center":
|
|
61
|
+
return {
|
|
62
|
+
top: offsetYValue ?? 0,
|
|
63
|
+
left: centerLeft,
|
|
64
|
+
unstable_transform: shiftLeft,
|
|
65
|
+
};
|
|
66
|
+
case "top-end":
|
|
67
|
+
return {
|
|
68
|
+
top: offsetYValue ?? 0,
|
|
69
|
+
right: offsetXValue ?? 0,
|
|
70
|
+
};
|
|
71
|
+
case "middle-start":
|
|
72
|
+
return {
|
|
73
|
+
top: middleTop,
|
|
74
|
+
left: offsetXValue ?? 0,
|
|
75
|
+
unstable_transform: shiftTop,
|
|
76
|
+
};
|
|
77
|
+
case "middle-center":
|
|
78
|
+
return {
|
|
79
|
+
top: middleTop,
|
|
80
|
+
left: centerLeft,
|
|
81
|
+
unstable_transform: shiftBoth,
|
|
82
|
+
};
|
|
83
|
+
case "middle-end":
|
|
84
|
+
return {
|
|
85
|
+
top: middleTop,
|
|
86
|
+
right: offsetXValue ?? 0,
|
|
87
|
+
unstable_transform: shiftTop,
|
|
88
|
+
};
|
|
89
|
+
case "bottom-start":
|
|
90
|
+
return {
|
|
91
|
+
bottom: offsetYValue ?? 0,
|
|
92
|
+
left: offsetXValue ?? 0,
|
|
93
|
+
};
|
|
94
|
+
case "bottom-center":
|
|
95
|
+
return {
|
|
96
|
+
bottom: offsetYValue ?? 0,
|
|
97
|
+
left: centerLeft,
|
|
98
|
+
unstable_transform: shiftLeft,
|
|
99
|
+
};
|
|
100
|
+
case "bottom-end":
|
|
101
|
+
return {
|
|
102
|
+
bottom: offsetYValue ?? 0,
|
|
103
|
+
right: offsetXValue ?? 0,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const Float = React.forwardRef<HTMLDivElement, FloatProps>((props, ref) => {
|
|
109
|
+
const { as, placement, offsetX, offsetY, zIndex, ...rest } = props;
|
|
110
|
+
|
|
111
|
+
const placementStyle = getPlacementStyle(placement, offsetX, offsetY);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Box ref={ref} as={as} position="absolute" zIndex={zIndex} {...placementStyle} {...rest} />
|
|
115
|
+
);
|
|
116
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Float, type FloatProps } from "./Float";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export {
|
|
2
|
+
FloatingActionButtonIcon as Icon,
|
|
3
|
+
FloatingActionButtonLabel as Label,
|
|
4
|
+
FloatingActionButtonRoot as Root,
|
|
5
|
+
type FloatingActionButtonIconProps as IconProps,
|
|
6
|
+
type FloatingActionButtonLabelProps as LabelProps,
|
|
7
|
+
type FloatingActionButtonRootProps as RootProps,
|
|
8
|
+
} from "./FloatingActionButton";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
floatingActionButton,
|
|
3
|
+
type FloatingActionButtonVariantProps,
|
|
4
|
+
} from "@seed-design/css/recipes/floating-action-button";
|
|
5
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
6
|
+
import type * as React from "react";
|
|
7
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
8
|
+
import { InternalIcon, type InternalIconProps } from "../private/Icon";
|
|
9
|
+
|
|
10
|
+
const { withProvider, withContext } = createSlotRecipeContext(floatingActionButton);
|
|
11
|
+
|
|
12
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
|
|
14
|
+
export interface FloatingActionButtonRootProps
|
|
15
|
+
extends FloatingActionButtonVariantProps,
|
|
16
|
+
PrimitiveProps,
|
|
17
|
+
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
18
|
+
|
|
19
|
+
export const FloatingActionButtonRoot = withProvider<
|
|
20
|
+
HTMLButtonElement,
|
|
21
|
+
FloatingActionButtonRootProps
|
|
22
|
+
>(Primitive.button, "root");
|
|
23
|
+
|
|
24
|
+
export interface FloatingActionButtonIconProps extends InternalIconProps {}
|
|
25
|
+
|
|
26
|
+
export const FloatingActionButtonIcon = withContext<
|
|
27
|
+
HTMLButtonElement,
|
|
28
|
+
FloatingActionButtonIconProps
|
|
29
|
+
>(InternalIcon, "icon");
|
|
30
|
+
|
|
31
|
+
export interface FloatingActionButtonLabelProps
|
|
32
|
+
extends PrimitiveProps,
|
|
33
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
34
|
+
|
|
35
|
+
export const FloatingActionButtonLabel = withContext<
|
|
36
|
+
HTMLSpanElement,
|
|
37
|
+
FloatingActionButtonLabelProps
|
|
38
|
+
>(Primitive.span, "label");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export {
|
|
2
|
+
FloatingActionButtonIcon,
|
|
3
|
+
FloatingActionButtonLabel,
|
|
4
|
+
FloatingActionButtonRoot,
|
|
5
|
+
type FloatingActionButtonIconProps,
|
|
6
|
+
type FloatingActionButtonLabelProps,
|
|
7
|
+
type FloatingActionButtonRootProps,
|
|
8
|
+
} from "./FloatingActionButton";
|
|
9
|
+
|
|
10
|
+
export * as FloatingActionButton from "./FloatingActionButton.namespace";
|
package/src/components/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./Checkbox";
|
|
|
11
11
|
export * from "./ChipTabs";
|
|
12
12
|
export * from "./Columns";
|
|
13
13
|
export * from "./ConsistentWidth";
|
|
14
|
+
export * from "./ContextualFloatingButton";
|
|
14
15
|
export * from "./ControlChip";
|
|
15
16
|
export * from "./Count";
|
|
16
17
|
export * from "./Dialog";
|
|
@@ -18,7 +19,9 @@ export * from "./Divider";
|
|
|
18
19
|
export * from "./ExtendedActionSheet";
|
|
19
20
|
export * from "./ExtendedFab";
|
|
20
21
|
export * from "./Fab";
|
|
22
|
+
export * from "./FloatingActionButton";
|
|
21
23
|
export * from "./Flex";
|
|
24
|
+
export * from "./Float";
|
|
22
25
|
export * from "./HelpBubble";
|
|
23
26
|
export * from "./Icon";
|
|
24
27
|
export * from "./IdentityPlaceholder";
|