@blockle/blocks-react 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.stories.d.ts +1 -1
- package/dist/components/display/Divider/Divider.js +2 -2
- package/dist/components/display/Divider/Divider.stories.d.ts +1 -1
- package/dist/components/display/Divider/divider.css.js +2 -2
- package/dist/components/feedback/Progress/Progress.stories.d.ts +1 -1
- package/dist/components/feedback/Spinner/Spinner.stories.d.ts +1 -1
- package/dist/components/form/Button/Button.css.js +2 -2
- package/dist/components/form/Button/Button.js +2 -2
- package/dist/components/form/Button/Button.stories.d.ts +1 -1
- package/dist/components/form/Checkbox/Checkbox.js +1 -1
- package/dist/components/form/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/components/form/Checkbox/checkbox.css.js +3 -3
- package/dist/components/form/Input/Input.js +2 -2
- package/dist/components/form/Input/Input.stories.d.ts +1 -1
- package/dist/components/form/Input/input.css.js +2 -2
- package/dist/components/form/Label/Label.stories.d.ts +1 -1
- package/dist/components/form/Radio/Radio.js +1 -1
- package/dist/components/form/Radio/Radio.stories.d.ts +1 -1
- package/dist/components/form/Radio/radio.css.js +3 -3
- package/dist/components/form/Select/Select.js +1 -1
- package/dist/components/form/Select/Select.stories.d.ts +1 -1
- package/dist/components/form/Select/select.css.js +4 -4
- package/dist/components/form/Slider/Slider.js +1 -1
- package/dist/components/form/Slider/Slider.stories.d.ts +1 -1
- package/dist/components/form/Slider/slider.css.js +6 -6
- package/dist/components/form/Switch/Switch.js +1 -1
- package/dist/components/form/Switch/Switch.stories.d.ts +1 -1
- package/dist/components/form/Switch/switch.css.js +3 -3
- package/dist/components/layout/Box/Box.stories.d.ts +1 -1
- package/dist/components/layout/Inline/Inline.stories.d.ts +1 -1
- package/dist/components/layout/Stack/Stack.stories.d.ts +1 -1
- package/dist/components/navigation/Link/Link.stories.d.ts +1 -1
- package/dist/components/overlay/Dialog/Dialog.js +5 -5
- package/dist/components/overlay/Dialog/Dialog.stories.d.ts +1 -1
- package/dist/components/overlay/Dialog/dialog.css.js +2 -2
- package/dist/components/overlay/Popover/Popover.js +2 -2
- package/dist/components/overlay/Popover/Popover.stories.d.ts +1 -1
- package/dist/components/overlay/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/overlay/Tooltip/Tooltip.stories.d.ts +1 -1
- package/dist/components/typography/Heading/Heading.js +1 -1
- package/dist/components/typography/Heading/heading.css.js +2 -2
- package/dist/components/typography/Heading/heading.stories.d.ts +1 -1
- package/dist/components/typography/Text/Text.js +1 -1
- package/dist/components/typography/Text/Text.stories.d.ts +1 -1
- package/dist/components/typography/Text/text.css.js +2 -2
- package/dist/index.d.ts +28 -27
- package/package.json +8 -14
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.cjs +0 -20
- package/dist/components/accessibility/VisuallyHidden/index.d.ts +0 -1
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.cjs +0 -16
- package/dist/components/display/Divider/Divider.cjs +0 -28
- package/dist/components/display/Divider/divider.css.cjs +0 -16
- package/dist/components/display/Divider/index.d.ts +0 -1
- package/dist/components/feedback/Progress/Progress.cjs +0 -55
- package/dist/components/feedback/Progress/index.d.ts +0 -1
- package/dist/components/feedback/Spinner/Spinner.cjs +0 -27
- package/dist/components/feedback/Spinner/index.d.ts +0 -1
- package/dist/components/form/Button/Button.cjs +0 -58
- package/dist/components/form/Button/Button.css.cjs +0 -16
- package/dist/components/form/Button/index.d.ts +0 -1
- package/dist/components/form/Checkbox/Checkbox.cjs +0 -80
- package/dist/components/form/Checkbox/checkbox.css.cjs +0 -32
- package/dist/components/form/Checkbox/index.d.ts +0 -1
- package/dist/components/form/Input/Input.cjs +0 -52
- package/dist/components/form/Input/index.d.ts +0 -1
- package/dist/components/form/Input/input.css.cjs +0 -21
- package/dist/components/form/Label/Label.cjs +0 -30
- package/dist/components/form/Label/index.d.ts +0 -1
- package/dist/components/form/Radio/Radio.cjs +0 -50
- package/dist/components/form/Radio/index.d.ts +0 -2
- package/dist/components/form/Radio/radio.css.cjs +0 -32
- package/dist/components/form/Select/Select.cjs +0 -73
- package/dist/components/form/Select/index.d.ts +0 -1
- package/dist/components/form/Select/select.css.cjs +0 -38
- package/dist/components/form/Slider/Slider.cjs +0 -139
- package/dist/components/form/Slider/index.d.ts +0 -1
- package/dist/components/form/Slider/slider.css.cjs +0 -75
- package/dist/components/form/Slider/usePointerProgress.cjs +0 -46
- package/dist/components/form/Switch/Switch.cjs +0 -73
- package/dist/components/form/Switch/index.d.ts +0 -1
- package/dist/components/form/Switch/switch.css.cjs +0 -27
- package/dist/components/layout/Box/Box.cjs +0 -26
- package/dist/components/layout/Box/index.d.ts +0 -1
- package/dist/components/layout/Inline/Inline.cjs +0 -30
- package/dist/components/layout/Inline/index.d.ts +0 -1
- package/dist/components/layout/Stack/Stack.cjs +0 -27
- package/dist/components/layout/Stack/index.d.ts +0 -1
- package/dist/components/navigation/Link/Link.cjs +0 -33
- package/dist/components/navigation/Link/index.d.ts +0 -1
- package/dist/components/overlay/Dialog/Dialog.cjs +0 -82
- package/dist/components/overlay/Dialog/dialog.css.cjs +0 -22
- package/dist/components/overlay/Dialog/dialogHelper.cjs +0 -21
- package/dist/components/overlay/Dialog/index.d.ts +0 -1
- package/dist/components/overlay/Popover/Popover.cjs +0 -106
- package/dist/components/overlay/Popover/index.d.ts +0 -1
- package/dist/components/overlay/Popover/popover-utils.cjs +0 -57
- package/dist/components/overlay/Portal/Portal.cjs +0 -15
- package/dist/components/overlay/Portal/index.d.ts +0 -1
- package/dist/components/overlay/Tooltip/Tooltip.cjs +0 -73
- package/dist/components/overlay/Tooltip/index.d.ts +0 -1
- package/dist/components/providers/BlocksProvider/BlocksProvider.cjs +0 -35
- package/dist/components/providers/BlocksProvider/context.cjs +0 -5
- package/dist/components/providers/BlocksProvider/index.d.ts +0 -2
- package/dist/components/typography/Heading/Heading.cjs +0 -24
- package/dist/components/typography/Heading/heading.css.cjs +0 -16
- package/dist/components/typography/Heading/index.d.ts +0 -1
- package/dist/components/typography/Text/Text.cjs +0 -21
- package/dist/components/typography/Text/index.d.ts +0 -1
- package/dist/components/typography/Text/text.css.cjs +0 -16
- package/dist/hooks/useClickOutside/useClickOutside.cjs +0 -23
- package/dist/hooks/useComponentStyles/index.d.ts +0 -2
- package/dist/hooks/useComponentStyles/useComponentStyleDefaultProps.cjs +0 -12
- package/dist/hooks/useComponentStyles/useComponentStyles.cjs +0 -74
- package/dist/hooks/useControlledValue/index.d.ts +0 -1
- package/dist/hooks/useControlledValue/useControlledValue.cjs +0 -33
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.ts +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +0 -6
- package/dist/hooks/useKeyboard/index.d.ts +0 -1
- package/dist/hooks/useKeyboard/useKeyboard.cjs +0 -21
- package/dist/hooks/useLayer/index.d.ts +0 -1
- package/dist/hooks/usePreventBodyScroll/index.d.ts +0 -1
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.cjs +0 -31
- package/dist/hooks/useRestoreFocus/index.d.ts +0 -1
- package/dist/hooks/useRestoreFocus/useRestoreFocus.cjs +0 -19
- package/dist/hooks/useTheme/index.d.ts +0 -1
- package/dist/hooks/useTheme/useTheme.cjs +0 -13
- package/dist/hooks/useVisibilityState/index.d.ts +0 -1
- package/dist/index.cjs +0 -58
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
export { VisuallyHidden, type VisuallyHiddenProps, } from './components/accessibility/VisuallyHidden';
|
|
2
|
-
export { Divider, type DividerProps } from './components/display/Divider';
|
|
3
|
-
export { Progress, type ProgressProps } from './components/feedback/Progress';
|
|
4
|
-
export { Spinner, type SpinnerProps } from './components/feedback/Spinner';
|
|
5
|
-
export { Button, type ButtonProps } from './components/form/Button';
|
|
6
|
-
export { Checkbox, type CheckboxProps } from './components/form/Checkbox';
|
|
7
|
-
export { Input, type InputProps } from './components/form/Input';
|
|
8
|
-
export { Label, type LabelProps } from './components/form/Label';
|
|
9
|
-
export { Radio, type RadioProps } from './components/form/Radio';
|
|
10
|
-
export { Select, type SelectProps } from './components/form/Select';
|
|
11
|
-
export { Slider, type SliderProps } from './components/form/Slider';
|
|
12
|
-
export { Switch, type SwitchProps } from './components/form/Switch';
|
|
13
|
-
export { Box, type BoxProps } from './components/layout/Box';
|
|
14
|
-
export { Inline, type InlineProps } from './components/layout/Inline';
|
|
15
|
-
export { Stack, type StackProps } from './components/layout/Stack';
|
|
16
|
-
export { Link, type LinkProps } from './components/navigation/Link';
|
|
17
|
-
export { Dialog, type DialogProps } from './components/overlay/Dialog';
|
|
18
|
-
export { Portal, type PortalProps } from './components/overlay/Portal';
|
|
19
|
-
export { Tooltip, type TooltipProps } from './components/overlay/Tooltip';
|
|
20
|
-
export { BlocksProvider, type BlocksProviderProps, } from './components/providers/BlocksProvider';
|
|
21
|
-
export { Heading, type HeadingProps } from './components/typography/Heading';
|
|
22
|
-
export { Text, type TextProps } from './components/typography/Text';
|
|
23
|
-
export { useComponentStyleDefaultProps
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
1
|
+
export { VisuallyHidden, type VisuallyHiddenProps, } from './components/accessibility/VisuallyHidden/VisuallyHidden.js';
|
|
2
|
+
export { Divider, type DividerProps, } from './components/display/Divider/Divider.js';
|
|
3
|
+
export { Progress, type ProgressProps, } from './components/feedback/Progress/Progress.js';
|
|
4
|
+
export { Spinner, type SpinnerProps, } from './components/feedback/Spinner/Spinner.js';
|
|
5
|
+
export { Button, type ButtonProps } from './components/form/Button/Button.js';
|
|
6
|
+
export { Checkbox, type CheckboxProps, } from './components/form/Checkbox/Checkbox.js';
|
|
7
|
+
export { Input, type InputProps } from './components/form/Input/Input.js';
|
|
8
|
+
export { Label, type LabelProps } from './components/form/Label/Label.js';
|
|
9
|
+
export { Radio, type RadioProps } from './components/form/Radio/Radio.js';
|
|
10
|
+
export { Select, type SelectProps } from './components/form/Select/Select.js';
|
|
11
|
+
export { Slider, type SliderProps } from './components/form/Slider/Slider.js';
|
|
12
|
+
export { Switch, type SwitchProps } from './components/form/Switch/Switch.js';
|
|
13
|
+
export { Box, type BoxProps } from './components/layout/Box/Box.js';
|
|
14
|
+
export { Inline, type InlineProps } from './components/layout/Inline/Inline.js';
|
|
15
|
+
export { Stack, type StackProps } from './components/layout/Stack/Stack.js';
|
|
16
|
+
export { Link, type LinkProps } from './components/navigation/Link/Link.js';
|
|
17
|
+
export { Dialog, type DialogProps, } from './components/overlay/Dialog/Dialog.js';
|
|
18
|
+
export { Portal, type PortalProps, } from './components/overlay/Portal/Portal.js';
|
|
19
|
+
export { Tooltip, type TooltipProps, } from './components/overlay/Tooltip/Tooltip.js';
|
|
20
|
+
export { BlocksProvider, type BlocksProviderProps, } from './components/providers/BlocksProvider/BlocksProvider.js';
|
|
21
|
+
export { Heading, type HeadingProps, } from './components/typography/Heading/Heading.js';
|
|
22
|
+
export { Text, type TextProps } from './components/typography/Text/Text.js';
|
|
23
|
+
export { useComponentStyleDefaultProps } from './hooks/useComponentStyles/useComponentStyleDefaultProps.js';
|
|
24
|
+
export { useComponentStyles } from './hooks/useComponentStyles/useComponentStyles.js';
|
|
25
|
+
export { useControlledValue } from './hooks/useControlledValue/useControlledValue.js';
|
|
26
|
+
export { useIsomorphicLayoutEffect } from './hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js';
|
|
27
|
+
export { useKeyboard } from './hooks/useKeyboard/useKeyboard.js';
|
|
28
|
+
export { usePreventBodyScroll } from './hooks/usePreventBodyScroll/usePreventBodyScroll.js';
|
package/package.json
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockle/blocks-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "React hooks and components for Blockle",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"types":
|
|
9
|
-
|
|
10
|
-
"require": "./dist/index.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
14
10
|
}
|
|
15
11
|
},
|
|
16
12
|
"files": [
|
|
17
13
|
"dist"
|
|
18
14
|
],
|
|
19
15
|
"sideEffects": false,
|
|
20
|
-
"main": "./dist/index.cjs",
|
|
21
|
-
"module": "./dist/index.mjs",
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
16
|
"scripts": {
|
|
24
17
|
"build": "vite build",
|
|
25
18
|
"test": "vitest",
|
|
@@ -41,9 +34,10 @@
|
|
|
41
34
|
"@vanilla-extract/css": "^1.17.1"
|
|
42
35
|
},
|
|
43
36
|
"peerDependencies": {
|
|
44
|
-
"react": "
|
|
45
|
-
"react-dom": "
|
|
46
|
-
"@
|
|
47
|
-
"@blockle/blocks-
|
|
37
|
+
"react": ">= 18 || >= 19",
|
|
38
|
+
"react-dom": ">= 18 || >= 19",
|
|
39
|
+
"@vanilla-extract/css": ">= 1.17.1",
|
|
40
|
+
"@blockle/blocks-core": ">= 0.x",
|
|
41
|
+
"@blockle/blocks-react-slot": ">= 1.x"
|
|
48
42
|
}
|
|
49
43
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
-
const visuallyHidden_css = require("./visually-hidden.css.cjs");
|
|
6
|
-
const VisuallyHidden = ({
|
|
7
|
-
children,
|
|
8
|
-
className,
|
|
9
|
-
...restProps
|
|
10
|
-
}) => {
|
|
11
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12
|
-
"span",
|
|
13
|
-
{
|
|
14
|
-
className: blocksCore.classnames(visuallyHidden_css.visuallyHidden, className),
|
|
15
|
-
...restProps,
|
|
16
|
-
children
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
exports.VisuallyHidden = VisuallyHidden;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { VisuallyHidden, type VisuallyHiddenProps } from './VisuallyHidden';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
-
const css = require("@vanilla-extract/css");
|
|
5
|
-
fileScope.setFileScope("src/components/accessibility/VisuallyHidden/visually-hidden.css.ts", "@blockle/blocks-react");
|
|
6
|
-
const visuallyHidden = css.style({
|
|
7
|
-
clip: "rect(0 0 0 0)",
|
|
8
|
-
clipPath: "inset(50%)",
|
|
9
|
-
height: "1px",
|
|
10
|
-
overflow: "hidden",
|
|
11
|
-
position: "absolute",
|
|
12
|
-
whiteSpace: "nowrap",
|
|
13
|
-
width: "1px"
|
|
14
|
-
});
|
|
15
|
-
fileScope.endFileScope();
|
|
16
|
-
exports.visuallyHidden = visuallyHidden;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const divider_css = require("./divider.css.cjs");
|
|
7
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
8
|
-
const useComponentStyleDefaultProps = require("../../../hooks/useComponentStyles/useComponentStyleDefaultProps.cjs");
|
|
9
|
-
const Box = require("../../layout/Box/Box.cjs");
|
|
10
|
-
const Divider = ({
|
|
11
|
-
className,
|
|
12
|
-
color,
|
|
13
|
-
...restProps
|
|
14
|
-
}) => {
|
|
15
|
-
const dividerClass = useComponentStyles.useComponentStyles("divider", { base: true });
|
|
16
|
-
const dividerDefaults = useComponentStyleDefaultProps.useComponentStyleDefaultProps("divider");
|
|
17
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
-
Box.Box,
|
|
19
|
-
{
|
|
20
|
-
role: "separator",
|
|
21
|
-
inlineSize: "full",
|
|
22
|
-
backgroundColor: color ?? dividerDefaults.color,
|
|
23
|
-
className: blocksCore.classnames(className, dividerClass, divider_css.divider),
|
|
24
|
-
...restProps
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
exports.Divider = Divider;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
-
const css = require("@vanilla-extract/css");
|
|
6
|
-
fileScope.setFileScope("src/components/display/Divider/divider.css.ts", "@blockle/blocks-react");
|
|
7
|
-
const divider = css.style({
|
|
8
|
-
"@layer": {
|
|
9
|
-
[blocksCore.blocksLayer]: {
|
|
10
|
-
clear: "both",
|
|
11
|
-
blockSize: "1px"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
fileScope.endFileScope();
|
|
16
|
-
exports.divider = divider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Divider, type DividerProps } from './Divider';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
7
|
-
const Box = require("../../layout/Box/Box.cjs");
|
|
8
|
-
const Progress = ({
|
|
9
|
-
className,
|
|
10
|
-
indeterminate,
|
|
11
|
-
max = 100,
|
|
12
|
-
ref,
|
|
13
|
-
value = 0,
|
|
14
|
-
...restProps
|
|
15
|
-
}) => {
|
|
16
|
-
const progress = value / max * 100;
|
|
17
|
-
const containerClassName = useComponentStyles.useComponentStyles(
|
|
18
|
-
"progress",
|
|
19
|
-
{
|
|
20
|
-
base: true
|
|
21
|
-
},
|
|
22
|
-
false
|
|
23
|
-
);
|
|
24
|
-
const barClassName = useComponentStyles.useComponentStyles(
|
|
25
|
-
"progress",
|
|
26
|
-
{ bar: true, variants: { indeterminate } },
|
|
27
|
-
false
|
|
28
|
-
);
|
|
29
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
-
Box.Box,
|
|
31
|
-
{
|
|
32
|
-
ref,
|
|
33
|
-
className: blocksCore.classnames(containerClassName, className),
|
|
34
|
-
overflow: "hidden",
|
|
35
|
-
role: "progressbar",
|
|
36
|
-
"aria-valuenow": value,
|
|
37
|
-
"aria-valuemin": 0,
|
|
38
|
-
"aria-valuemax": max,
|
|
39
|
-
...restProps,
|
|
40
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
-
Box.Box,
|
|
42
|
-
{
|
|
43
|
-
className: barClassName,
|
|
44
|
-
backgroundColor: "currentColor",
|
|
45
|
-
inlineSize: "full",
|
|
46
|
-
blockSize: "full",
|
|
47
|
-
style: {
|
|
48
|
-
transform: indeterminate ? void 0 : `translateX(-${100 - progress}%)`
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
exports.Progress = Progress;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Progress, type ProgressProps } from './Progress';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
7
|
-
const Box = require("../../layout/Box/Box.cjs");
|
|
8
|
-
const Spinner = ({
|
|
9
|
-
className,
|
|
10
|
-
size,
|
|
11
|
-
color,
|
|
12
|
-
...restProps
|
|
13
|
-
}) => {
|
|
14
|
-
const spinnerClassName = useComponentStyles.useComponentStyles("spinner", {
|
|
15
|
-
base: true,
|
|
16
|
-
variants: { size, color }
|
|
17
|
-
});
|
|
18
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
-
Box.Box,
|
|
20
|
-
{
|
|
21
|
-
color,
|
|
22
|
-
className: blocksCore.classnames(spinnerClassName, className),
|
|
23
|
-
...restProps
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
exports.Spinner = Spinner;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Spinner, type SpinnerProps } from './Spinner';
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const blocksReactSlot = require("@blockle/blocks-react-slot");
|
|
7
|
-
const Button_css = require("./Button.css.cjs");
|
|
8
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
9
|
-
const Spinner = require("../../feedback/Spinner/Spinner.cjs");
|
|
10
|
-
const [Template, Slot] = blocksReactSlot.createSlottable("button");
|
|
11
|
-
const Button = ({
|
|
12
|
-
asChild,
|
|
13
|
-
children,
|
|
14
|
-
className,
|
|
15
|
-
disabled,
|
|
16
|
-
endSlot,
|
|
17
|
-
intent,
|
|
18
|
-
loading,
|
|
19
|
-
ref,
|
|
20
|
-
size,
|
|
21
|
-
startSlot,
|
|
22
|
-
variant,
|
|
23
|
-
...restProps
|
|
24
|
-
}) => {
|
|
25
|
-
const buttonClassName = useComponentStyles.useComponentStyles("button", {
|
|
26
|
-
base: true,
|
|
27
|
-
variants: {
|
|
28
|
-
variant,
|
|
29
|
-
intent,
|
|
30
|
-
size,
|
|
31
|
-
disabled,
|
|
32
|
-
loading
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const [atomsProps, otherProps] = blocksCore.getAtomsAndProps(restProps);
|
|
36
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37
|
-
Template,
|
|
38
|
-
{
|
|
39
|
-
ref,
|
|
40
|
-
asChild,
|
|
41
|
-
disabled: disabled || loading,
|
|
42
|
-
className: blocksCore.classnames(
|
|
43
|
-
Button_css.buttonReset,
|
|
44
|
-
buttonClassName,
|
|
45
|
-
blocksCore.atoms(atomsProps),
|
|
46
|
-
className
|
|
47
|
-
),
|
|
48
|
-
...otherProps,
|
|
49
|
-
children: [
|
|
50
|
-
startSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { children: startSlot }),
|
|
51
|
-
loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner.Spinner, { size }),
|
|
52
|
-
/* @__PURE__ */ jsxRuntime.jsx(Slot, { children }),
|
|
53
|
-
endSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { children: endSlot })
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
exports.Button = Button;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
-
const css = require("@vanilla-extract/css");
|
|
6
|
-
fileScope.setFileScope("src/components/form/Button/Button.css.ts", "@blockle/blocks-react");
|
|
7
|
-
const buttonReset = css.style({
|
|
8
|
-
"@layer": {
|
|
9
|
-
[blocksCore.blocksLayer]: {
|
|
10
|
-
all: "unset",
|
|
11
|
-
cursor: "pointer"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
fileScope.endFileScope();
|
|
16
|
-
exports.buttonReset = buttonReset;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button, type ButtonProps } from './Button';
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const Label = require("../Label/Label.cjs");
|
|
8
|
-
const checkbox_css = require("./checkbox.css.cjs");
|
|
9
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
10
|
-
const Checkbox = ({
|
|
11
|
-
children,
|
|
12
|
-
className,
|
|
13
|
-
id,
|
|
14
|
-
name,
|
|
15
|
-
ref,
|
|
16
|
-
required,
|
|
17
|
-
...restProps
|
|
18
|
-
}) => {
|
|
19
|
-
const containerClassName = useComponentStyles.useComponentStyles(
|
|
20
|
-
"checkbox",
|
|
21
|
-
{ base: true },
|
|
22
|
-
false
|
|
23
|
-
);
|
|
24
|
-
const iconClassName = useComponentStyles.useComponentStyles("checkbox", { icon: true }, false);
|
|
25
|
-
const labelClassName = useComponentStyles.useComponentStyles("checkbox", { label: true }, false);
|
|
26
|
-
const reactId = react.useId();
|
|
27
|
-
const inputId = id || reactId;
|
|
28
|
-
const input = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29
|
-
"div",
|
|
30
|
-
{
|
|
31
|
-
className: blocksCore.classnames(checkbox_css.container, containerClassName, className),
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
"input",
|
|
35
|
-
{
|
|
36
|
-
ref,
|
|
37
|
-
type: "checkbox",
|
|
38
|
-
name,
|
|
39
|
-
id: inputId,
|
|
40
|
-
className: checkbox_css.input,
|
|
41
|
-
...restProps
|
|
42
|
-
}
|
|
43
|
-
),
|
|
44
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: blocksCore.classnames(checkbox_css.icon, iconClassName), "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(DefaultIcon, {}) })
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
if (!children) {
|
|
49
|
-
return input;
|
|
50
|
-
}
|
|
51
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: labelClassName, children: [
|
|
52
|
-
input,
|
|
53
|
-
children && /* @__PURE__ */ jsxRuntime.jsx(Label.Label, { required, htmlFor: inputId, children })
|
|
54
|
-
] });
|
|
55
|
-
};
|
|
56
|
-
const DefaultIcon = () => {
|
|
57
|
-
return (
|
|
58
|
-
// TOOD - replace with actual icon component renderer
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
-
"svg",
|
|
61
|
-
{
|
|
62
|
-
viewBox: "0 0 24 24",
|
|
63
|
-
fill: "none",
|
|
64
|
-
strokeWidth: "1.5",
|
|
65
|
-
stroke: "currentColor",
|
|
66
|
-
style: { width: "1rem", height: "1rem", display: "block" },
|
|
67
|
-
role: "presentation",
|
|
68
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
-
"path",
|
|
70
|
-
{
|
|
71
|
-
strokeLinecap: "round",
|
|
72
|
-
strokeLinejoin: "round",
|
|
73
|
-
d: "m4.5 12.75 6 6 9-13.5"
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
exports.Checkbox = Checkbox;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
-
const css = require("@vanilla-extract/css");
|
|
6
|
-
fileScope.setFileScope("src/components/form/Checkbox/checkbox.css.ts", "@blockle/blocks-react");
|
|
7
|
-
const container = css.style({
|
|
8
|
-
"@layer": {
|
|
9
|
-
[blocksCore.blocksLayer]: {
|
|
10
|
-
position: "relative",
|
|
11
|
-
cursor: "pointer",
|
|
12
|
-
overflow: "hidden"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
const input = css.style({
|
|
17
|
-
position: "absolute",
|
|
18
|
-
inset: 0,
|
|
19
|
-
opacity: 0,
|
|
20
|
-
"@layer": {
|
|
21
|
-
[blocksCore.blocksLayer]: {
|
|
22
|
-
all: "unset"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const icon = css.style({
|
|
27
|
-
pointerEvents: "none"
|
|
28
|
-
});
|
|
29
|
-
fileScope.endFileScope();
|
|
30
|
-
exports.container = container;
|
|
31
|
-
exports.icon = icon;
|
|
32
|
-
exports.input = input;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const react = require("react");
|
|
6
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
7
|
-
const input_css = require("./input.css.cjs");
|
|
8
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
9
|
-
const Box = require("../../layout/Box/Box.cjs");
|
|
10
|
-
const Input = ({
|
|
11
|
-
className,
|
|
12
|
-
endSlot,
|
|
13
|
-
name,
|
|
14
|
-
placeholder,
|
|
15
|
-
ref,
|
|
16
|
-
startSlot,
|
|
17
|
-
type = "text",
|
|
18
|
-
...restProps
|
|
19
|
-
}) => {
|
|
20
|
-
const id = react.useId();
|
|
21
|
-
const containerClassName = useComponentStyles.useComponentStyles(
|
|
22
|
-
"input",
|
|
23
|
-
{ container: true },
|
|
24
|
-
false
|
|
25
|
-
);
|
|
26
|
-
const inputClassName = useComponentStyles.useComponentStyles("input", { input: true });
|
|
27
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28
|
-
Box.Box,
|
|
29
|
-
{
|
|
30
|
-
display: "flex",
|
|
31
|
-
alignItems: "center",
|
|
32
|
-
className: blocksCore.classnames(containerClassName, className),
|
|
33
|
-
children: [
|
|
34
|
-
startSlot,
|
|
35
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
-
"input",
|
|
37
|
-
{
|
|
38
|
-
id,
|
|
39
|
-
ref,
|
|
40
|
-
name,
|
|
41
|
-
type,
|
|
42
|
-
placeholder,
|
|
43
|
-
className: blocksCore.classnames(input_css.input, inputClassName),
|
|
44
|
-
...restProps
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
endSlot
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
) });
|
|
51
|
-
};
|
|
52
|
-
exports.Input = Input;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Input, type InputProps } from './Input';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
-
const css = require("@vanilla-extract/css");
|
|
6
|
-
fileScope.setFileScope("src/components/form/Input/input.css.ts", "@blockle/blocks-react");
|
|
7
|
-
const input = css.style({
|
|
8
|
-
"@layer": {
|
|
9
|
-
[blocksCore.blocksLayer]: {
|
|
10
|
-
appearance: "none",
|
|
11
|
-
width: "100%",
|
|
12
|
-
selectors: {
|
|
13
|
-
"&:-webkit-autofill": {
|
|
14
|
-
transitionDelay: "9999s"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
fileScope.endFileScope();
|
|
21
|
-
exports.input = input;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
7
|
-
const Label = ({
|
|
8
|
-
asSpan,
|
|
9
|
-
children,
|
|
10
|
-
className,
|
|
11
|
-
required,
|
|
12
|
-
size,
|
|
13
|
-
cursor,
|
|
14
|
-
...restProps
|
|
15
|
-
}) => {
|
|
16
|
-
const Component = asSpan ? "span" : "label";
|
|
17
|
-
const containerClassName = useComponentStyles.useComponentStyles("label", {
|
|
18
|
-
base: true,
|
|
19
|
-
variants: { required, size }
|
|
20
|
-
});
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
-
Component,
|
|
23
|
-
{
|
|
24
|
-
className: blocksCore.classnames(containerClassName, className, blocksCore.atoms({ cursor })),
|
|
25
|
-
...restProps,
|
|
26
|
-
children
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
exports.Label = Label;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Label, type LabelProps } from './Label';
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const radio_css = require("./radio.css.cjs");
|
|
8
|
-
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
9
|
-
const Label = require("../Label/Label.cjs");
|
|
10
|
-
const Radio = ({
|
|
11
|
-
name,
|
|
12
|
-
children,
|
|
13
|
-
className,
|
|
14
|
-
ref,
|
|
15
|
-
...restProps
|
|
16
|
-
}) => {
|
|
17
|
-
const rid = react.useId();
|
|
18
|
-
const id = restProps.id ?? rid;
|
|
19
|
-
const containerClassName = useComponentStyles.useComponentStyles("radio", { base: true }, false);
|
|
20
|
-
const iconClassName = useComponentStyles.useComponentStyles("radio", { icon: true }, false);
|
|
21
|
-
const labelClassName = useComponentStyles.useComponentStyles("checkbox", { label: true }, false);
|
|
22
|
-
const input = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
className: blocksCore.classnames(radio_css.container, containerClassName, className),
|
|
26
|
-
children: [
|
|
27
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
28
|
-
"input",
|
|
29
|
-
{
|
|
30
|
-
ref,
|
|
31
|
-
type: "radio",
|
|
32
|
-
name,
|
|
33
|
-
id,
|
|
34
|
-
className: radio_css.input,
|
|
35
|
-
...restProps
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: blocksCore.classnames(radio_css.icon, iconClassName) })
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
if (!children) {
|
|
43
|
-
return input;
|
|
44
|
-
}
|
|
45
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: id, className: labelClassName, children: [
|
|
46
|
-
input,
|
|
47
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label.Label, { asSpan: true, children })
|
|
48
|
-
] });
|
|
49
|
-
};
|
|
50
|
-
exports.Radio = Radio;
|