@blockle/blocks-react 3.0.1 → 3.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/README.md +138 -0
- package/dist/components/display/Tag/Tag.d.ts +28 -0
- package/dist/components/display/Tag/Tag.d.ts.map +1 -0
- package/dist/components/display/Tag/Tag.js +46 -0
- package/dist/components/feedback/Alert/Alert.d.ts +17 -2
- package/dist/components/feedback/Alert/Alert.d.ts.map +1 -1
- package/dist/components/feedback/Alert/Alert.js +8 -35
- package/dist/components/feedback/Toast/Toast.css.d.ts +10 -1
- package/dist/components/feedback/Toast/Toast.css.d.ts.map +1 -1
- package/dist/components/feedback/Toast/Toast.css.js +37 -10
- package/dist/components/feedback/Toast/ToastContext.d.ts +6 -0
- package/dist/components/feedback/Toast/ToastContext.d.ts.map +1 -1
- package/dist/components/feedback/Toast/ToastProvider.d.ts +15 -1
- package/dist/components/feedback/Toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/feedback/Toast/ToastProvider.js +128 -44
- package/dist/components/feedback/Toast/useCountdowns.d.ts +14 -0
- package/dist/components/feedback/Toast/useCountdowns.d.ts.map +1 -0
- package/dist/components/feedback/Toast/useCountdowns.js +74 -0
- package/dist/components/form/Button/Button.d.ts +11 -3
- package/dist/components/form/Button/Button.d.ts.map +1 -1
- package/dist/components/form/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/form/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/form/Checkbox/Checkbox.js +7 -27
- package/dist/components/form/Checkbox/checkbox.css.d.ts.map +1 -1
- package/dist/components/form/Checkbox/checkbox.css.js +1 -0
- package/dist/components/form/IconButton/IconButton.d.ts +29 -0
- package/dist/components/form/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/form/IconButton/IconButton.js +61 -0
- package/dist/components/form/NumericInput/NumericInput.d.ts +11 -1
- package/dist/components/form/NumericInput/NumericInput.d.ts.map +1 -1
- package/dist/components/form/NumericInput/NumericInput.js +52 -24
- package/dist/components/form/Radio/Radio.d.ts +0 -1
- package/dist/components/form/Radio/Radio.d.ts.map +1 -1
- package/dist/components/form/Radio/Radio.js +1 -11
- package/dist/components/form/Radio/radio.css.d.ts.map +1 -1
- package/dist/components/form/Radio/radio.css.js +1 -0
- package/dist/components/form/Select/Select.d.ts +2 -1
- package/dist/components/form/Select/Select.d.ts.map +1 -1
- package/dist/components/form/Select/Select.js +4 -24
- package/dist/components/form/Switch/Switch.d.ts +5 -1
- package/dist/components/form/Switch/Switch.d.ts.map +1 -1
- package/dist/components/form/Switch/Switch.js +19 -29
- package/dist/components/form/Switch/switch.css.d.ts.map +1 -1
- package/dist/components/form/Switch/switch.css.js +1 -0
- package/dist/components/form/TextInput/TextInput.d.ts +0 -1
- package/dist/components/form/TextInput/TextInput.d.ts.map +1 -1
- package/dist/components/form/TextInput/TextInput.js +0 -2
- package/dist/components/form/Textarea/Textarea.css.d.ts +2 -0
- package/dist/components/form/Textarea/Textarea.css.d.ts.map +1 -1
- package/dist/components/form/Textarea/Textarea.css.js +17 -1
- package/dist/components/form/Textarea/Textarea.d.ts +11 -0
- package/dist/components/form/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/form/Textarea/Textarea.js +8 -2
- package/dist/components/layout/Inline/Inline.d.ts +11 -3
- package/dist/components/layout/Inline/Inline.d.ts.map +1 -1
- package/dist/components/layout/Inline/Inline.js +5 -3
- package/dist/components/layout/Stack/Stack.d.ts +12 -8
- package/dist/components/layout/Stack/Stack.d.ts.map +1 -1
- package/dist/components/layout/Stack/Stack.js +8 -4
- package/dist/components/navigation/Link/Link.d.ts +1 -1
- package/dist/components/navigation/Link/Link.d.ts.map +1 -1
- package/dist/components/navigation/Link/Link.js +2 -2
- package/dist/components/overlay/Dialog/Dialog.d.ts +4 -1
- package/dist/components/overlay/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/overlay/Dialog/Dialog.js +19 -46
- package/dist/components/overlay/Drawer/Drawer.d.ts +9 -2
- package/dist/components/overlay/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/overlay/Drawer/Drawer.js +25 -44
- package/dist/components/overlay/Drawer/drawer.css.d.ts.map +1 -1
- package/dist/components/overlay/Drawer/drawer.css.js +4 -8
- package/dist/components/overlay/Popover/Popover.d.ts +15 -3
- package/dist/components/overlay/Popover/Popover.d.ts.map +1 -1
- package/dist/components/overlay/Popover/Popover.js +35 -11
- package/dist/components/overlay/Popover/popover-utils.d.ts +38 -1
- package/dist/components/overlay/Popover/popover-utils.d.ts.map +1 -1
- package/dist/components/overlay/Popover/popover-utils.js +92 -41
- package/dist/components/overlay/Tooltip/Tooltip.d.ts +8 -0
- package/dist/components/overlay/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/overlay/Tooltip/Tooltip.js +3 -2
- package/dist/components/overlay/requestCloseReason.d.ts +6 -0
- package/dist/components/overlay/requestCloseReason.d.ts.map +1 -0
- package/dist/components/overlay/useModalOverlay.d.ts +35 -0
- package/dist/components/overlay/useModalOverlay.d.ts.map +1 -0
- package/dist/components/overlay/useModalOverlay.js +85 -0
- package/dist/components/typography/Heading/Heading.d.ts +2 -1
- package/dist/components/typography/Heading/Heading.d.ts.map +1 -1
- package/dist/components/typography/Heading/Heading.js +9 -1
- package/dist/components/typography/Text/Text.d.ts +3 -2
- package/dist/components/typography/Text/Text.d.ts.map +1 -1
- package/dist/components/typography/Text/Text.js +9 -1
- package/dist/components/typography/textOverflow.css.d.ts +3 -0
- package/dist/components/typography/textOverflow.css.d.ts.map +1 -0
- package/dist/components/typography/textOverflow.css.js +32 -0
- package/dist/components/typography/textOverflow.d.ts +9 -0
- package/dist/components/typography/textOverflow.d.ts.map +1 -0
- package/dist/components/typography/textOverflow.js +10 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts.map +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +27 -7
- package/dist/hooks/useModalDialog/useModalDialog.d.ts +13 -0
- package/dist/hooks/useModalDialog/useModalDialog.d.ts.map +1 -0
- package/dist/hooks/useModalDialog/useModalDialog.js +39 -0
- package/dist/icons/icons.d.ts +8 -0
- package/dist/icons/icons.d.ts.map +1 -0
- package/dist/icons/icons.js +39 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/testUtils/browser/consumerStyles.css.d.ts +2 -0
- package/dist/testUtils/browser/consumerStyles.css.d.ts.map +1 -0
- package/dist/testUtils/browser/pointer.d.ts +18 -0
- package/dist/testUtils/browser/pointer.d.ts.map +1 -0
- package/dist/testUtils/testTheme.css.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/feedback/Alert/Alert.css.d.ts +0 -2
- package/dist/components/feedback/Alert/Alert.css.d.ts.map +0 -1
- package/dist/components/feedback/Alert/Alert.css.js +0 -15
- package/dist/components/overlay/Dialog/dialogHelper.d.ts +0 -7
- package/dist/components/overlay/Dialog/dialogHelper.d.ts.map +0 -1
- package/dist/components/overlay/Dialog/dialogHelper.js +0 -22
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Countdowns = {
|
|
2
|
+
/** Starts a countdown of `duration` for `id`, replacing any it had */
|
|
3
|
+
set: (id: string, duration: number) => void;
|
|
4
|
+
/** Drops the countdown of `id` without calling `onEnd` */
|
|
5
|
+
clear: (id: string) => void;
|
|
6
|
+
/** Pauses or resumes every countdown; a resumed one runs its time left */
|
|
7
|
+
setPaused: (paused: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Pausable countdowns keyed by id, calling `onEnd` with the id once its
|
|
11
|
+
* time has run. They only count down while mounted, and are stopped on unmount.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCountdowns(onEnd: (id: string) => void): Countdowns;
|
|
14
|
+
//# sourceMappingURL=useCountdowns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCountdowns.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/Toast/useCountdowns.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG;IACvB,sEAAsE;IACtE,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,0DAA0D;IAC1D,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,UAAU,CAsFrE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef, useMemo, useEffect } from "react";
|
|
3
|
+
function useCountdowns(onEnd) {
|
|
4
|
+
const onEndRef = useRef(onEnd);
|
|
5
|
+
onEndRef.current = onEnd;
|
|
6
|
+
const countdownsRef = useRef(/* @__PURE__ */ new Map());
|
|
7
|
+
const pausedRef = useRef(false);
|
|
8
|
+
const mountedRef = useRef(false);
|
|
9
|
+
const countdowns = useMemo(() => {
|
|
10
|
+
function run(id, countdown) {
|
|
11
|
+
countdown.startedAt = Date.now();
|
|
12
|
+
countdown.timeout = setTimeout(() => {
|
|
13
|
+
countdownsRef.current.delete(id);
|
|
14
|
+
onEndRef.current(id);
|
|
15
|
+
}, countdown.remaining);
|
|
16
|
+
}
|
|
17
|
+
function stop(countdown) {
|
|
18
|
+
clearTimeout(countdown.timeout);
|
|
19
|
+
if (countdown.startedAt !== void 0) {
|
|
20
|
+
countdown.remaining -= Date.now() - countdown.startedAt;
|
|
21
|
+
countdown.startedAt = void 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function isRunning() {
|
|
25
|
+
return mountedRef.current && !pausedRef.current;
|
|
26
|
+
}
|
|
27
|
+
function clear(id) {
|
|
28
|
+
const countdown = countdownsRef.current.get(id);
|
|
29
|
+
if (countdown) {
|
|
30
|
+
stop(countdown);
|
|
31
|
+
countdownsRef.current.delete(id);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function sync() {
|
|
35
|
+
for (const [id, countdown] of countdownsRef.current) {
|
|
36
|
+
stop(countdown);
|
|
37
|
+
if (isRunning()) {
|
|
38
|
+
run(id, countdown);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
set(id, duration) {
|
|
44
|
+
clear(id);
|
|
45
|
+
const countdown = { remaining: duration };
|
|
46
|
+
countdownsRef.current.set(id, countdown);
|
|
47
|
+
if (isRunning()) {
|
|
48
|
+
run(id, countdown);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
clear,
|
|
52
|
+
setPaused(paused) {
|
|
53
|
+
if (paused === pausedRef.current) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
pausedRef.current = paused;
|
|
57
|
+
sync();
|
|
58
|
+
},
|
|
59
|
+
sync
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
mountedRef.current = true;
|
|
64
|
+
countdowns.sync();
|
|
65
|
+
return () => {
|
|
66
|
+
mountedRef.current = false;
|
|
67
|
+
countdowns.sync();
|
|
68
|
+
};
|
|
69
|
+
}, [countdowns]);
|
|
70
|
+
return countdowns;
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
useCountdowns
|
|
74
|
+
};
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { Atoms, ComponentThemes, HTMLElementProps, MarginAtoms } from '@blockle/blocks-core';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
type ButtonTheme = ComponentThemes['button'];
|
|
4
|
+
type ButtonIntentProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Use the surrounding text color; only for the ghost and outline variants
|
|
7
|
+
*/
|
|
8
|
+
intent: 'inherit';
|
|
9
|
+
variant: Exclude<ButtonTheme['variants']['variant'], 'solid'>;
|
|
10
|
+
} | {
|
|
11
|
+
intent?: Exclude<ButtonTheme['variants']['intent'], 'inherit'>;
|
|
12
|
+
variant?: ButtonTheme['variants']['variant'];
|
|
13
|
+
};
|
|
4
14
|
export type ButtonProps = {
|
|
5
15
|
alignSelf?: Atoms['alignSelf'];
|
|
6
16
|
asChild?: boolean;
|
|
@@ -8,14 +18,12 @@ export type ButtonProps = {
|
|
|
8
18
|
disabled?: boolean;
|
|
9
19
|
endSlot?: React.ReactNode;
|
|
10
20
|
inlineSize?: Atoms['inlineSize'];
|
|
11
|
-
intent?: ButtonTheme['variants']['intent'];
|
|
12
21
|
loading?: boolean;
|
|
13
22
|
popovertarget?: string;
|
|
14
23
|
size?: ButtonTheme['variants']['size'];
|
|
15
24
|
startSlot?: React.ReactNode;
|
|
16
25
|
type?: 'button' | 'submit' | 'reset';
|
|
17
|
-
|
|
18
|
-
} & Omit<HTMLElementProps<HTMLButtonElement>, 'size'> & MarginAtoms;
|
|
26
|
+
} & ButtonIntentProps & Omit<HTMLElementProps<HTMLButtonElement>, 'size'> & MarginAtoms;
|
|
19
27
|
export declare const Button: React.FC<ButtonProps>;
|
|
20
28
|
export {};
|
|
21
29
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACjC,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAE7C,KAAK,iBAAiB,GAClB;IACE;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;CAC/D,GACD;IACE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/D,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;CAC9C,CAAC;AAEN,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC,GAAG,iBAAiB,GACnB,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,GACjD,WAAW,CAAC;AAId,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsDxC,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { HTMLElementProps } from '@blockle/blocks-core';
|
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
export type CheckboxProps = {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
name: string;
|
|
6
5
|
required?: boolean;
|
|
7
6
|
} & HTMLElementProps<HTMLInputElement>;
|
|
8
7
|
export declare const Checkbox: React.FC<CheckboxProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AAEvC,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiD5C,CAAC"}
|
|
@@ -3,13 +3,13 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { classnames } from "@blockle/blocks-core";
|
|
4
4
|
import { useId } from "react";
|
|
5
5
|
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
6
|
+
import { CheckIcon } from "../../../icons/icons.js";
|
|
6
7
|
import { Label } from "../Label/Label.js";
|
|
7
8
|
import { input, icon, container } from "./checkbox.css.js";
|
|
8
9
|
const Checkbox = ({
|
|
9
10
|
children,
|
|
10
11
|
className,
|
|
11
12
|
id,
|
|
12
|
-
name,
|
|
13
13
|
required,
|
|
14
14
|
...restProps
|
|
15
15
|
}) => {
|
|
@@ -31,13 +31,17 @@ const Checkbox = ({
|
|
|
31
31
|
"input",
|
|
32
32
|
{
|
|
33
33
|
type: "checkbox",
|
|
34
|
-
name,
|
|
35
34
|
id: inputId,
|
|
36
35
|
className: input,
|
|
37
36
|
...restProps
|
|
38
37
|
}
|
|
39
38
|
),
|
|
40
|
-
/* @__PURE__ */ jsx("div", { className: classnames(icon, iconClassName), "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: classnames(icon, iconClassName), "aria-hidden": true, children: /* @__PURE__ */ jsx(
|
|
40
|
+
CheckIcon,
|
|
41
|
+
{
|
|
42
|
+
style: { width: "1rem", height: "1rem", display: "block" }
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
41
45
|
]
|
|
42
46
|
}
|
|
43
47
|
);
|
|
@@ -49,30 +53,6 @@ const Checkbox = ({
|
|
|
49
53
|
children && /* @__PURE__ */ jsx(Label, { required, htmlFor: inputId, children })
|
|
50
54
|
] });
|
|
51
55
|
};
|
|
52
|
-
const DefaultIcon = () => {
|
|
53
|
-
return (
|
|
54
|
-
// TOOD - replace with actual icon component renderer
|
|
55
|
-
/* @__PURE__ */ jsx(
|
|
56
|
-
"svg",
|
|
57
|
-
{
|
|
58
|
-
viewBox: "0 0 24 24",
|
|
59
|
-
fill: "none",
|
|
60
|
-
strokeWidth: "1.5",
|
|
61
|
-
stroke: "currentColor",
|
|
62
|
-
style: { width: "1rem", height: "1rem", display: "block" },
|
|
63
|
-
role: "presentation",
|
|
64
|
-
children: /* @__PURE__ */ jsx(
|
|
65
|
-
"path",
|
|
66
|
-
{
|
|
67
|
-
strokeLinecap: "round",
|
|
68
|
-
strokeLinejoin: "round",
|
|
69
|
-
d: "m4.5 12.75 6 6 9-13.5"
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
56
|
export {
|
|
77
57
|
Checkbox
|
|
78
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.css.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Checkbox/checkbox.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"checkbox.css.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Checkbox/checkbox.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,QASpB,CAAC;AAEH,eAAO,MAAM,KAAK,QAShB,CAAC;AAEH,eAAO,MAAM,IAAI,QAEf,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentThemes, HTMLElementProps, MarginAtoms } from '@blockle/blocks-core';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type IconButtonTheme = ComponentThemes['iconButton'];
|
|
4
|
+
type IconButtonIntentProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Use the surrounding text color; only for the ghost and outline variants
|
|
7
|
+
*/
|
|
8
|
+
intent: 'inherit';
|
|
9
|
+
variant: Exclude<IconButtonTheme['variants']['variant'], 'solid'>;
|
|
10
|
+
} | {
|
|
11
|
+
intent?: Exclude<IconButtonTheme['variants']['intent'], 'inherit'>;
|
|
12
|
+
variant?: IconButtonTheme['variants']['variant'];
|
|
13
|
+
};
|
|
14
|
+
export type IconButtonProps = {
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Accessible name of the button, rendered as `aria-label`
|
|
20
|
+
*/
|
|
21
|
+
label: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
shape?: IconButtonTheme['variants']['shape'];
|
|
24
|
+
size?: IconButtonTheme['variants']['size'];
|
|
25
|
+
type?: 'button' | 'submit' | 'reset';
|
|
26
|
+
} & IconButtonIntentProps & Omit<HTMLElementProps<HTMLButtonElement>, 'size'> & MarginAtoms;
|
|
27
|
+
export declare const IconButton: React.FC<IconButtonProps>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/form/IconButton/IconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,eAAe,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;AAErD,KAAK,qBAAqB,GACtB;IACE;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;CACnE,GACD;IACE,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;IACnE,OAAO,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;CAClD,CAAC;AAEN,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC,GAAG,qBAAqB,GACvB,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,GACjD,WAAW,CAAC;AAId,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgEhD,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { getAtomsAndProps, classnames, atoms } from "@blockle/blocks-core";
|
|
4
|
+
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
5
|
+
import { isValidElement, cloneElement } from "react";
|
|
6
|
+
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
7
|
+
import { Spinner } from "../../feedback/Spinner/Spinner.js";
|
|
8
|
+
import { buttonReset } from "../Button/Button.css.js";
|
|
9
|
+
const [Template, Slot] = createSlottable("button");
|
|
10
|
+
const IconButton = ({
|
|
11
|
+
asChild,
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
disabled,
|
|
15
|
+
intent,
|
|
16
|
+
label,
|
|
17
|
+
loading,
|
|
18
|
+
shape,
|
|
19
|
+
size,
|
|
20
|
+
type,
|
|
21
|
+
variant,
|
|
22
|
+
...restProps
|
|
23
|
+
}) => {
|
|
24
|
+
const iconButtonClassName = useComponentStyles("iconButton", {
|
|
25
|
+
root: true,
|
|
26
|
+
variants: {
|
|
27
|
+
variant,
|
|
28
|
+
intent,
|
|
29
|
+
size,
|
|
30
|
+
shape,
|
|
31
|
+
disabled,
|
|
32
|
+
loading
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const [atomsProps, otherProps] = getAtomsAndProps(restProps);
|
|
36
|
+
const spinner = /* @__PURE__ */ jsx(Spinner, { size });
|
|
37
|
+
let content = children;
|
|
38
|
+
if (loading) {
|
|
39
|
+
content = asChild && isValidElement(children) ? cloneElement(children, void 0, spinner) : spinner;
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
Template,
|
|
43
|
+
{
|
|
44
|
+
asChild,
|
|
45
|
+
"aria-label": label,
|
|
46
|
+
disabled: disabled || loading,
|
|
47
|
+
className: classnames(
|
|
48
|
+
buttonReset,
|
|
49
|
+
iconButtonClassName,
|
|
50
|
+
atoms(atomsProps),
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
type: asChild ? void 0 : type ?? "button",
|
|
54
|
+
...otherProps,
|
|
55
|
+
children: /* @__PURE__ */ jsx(Slot, { children: content })
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
IconButton
|
|
61
|
+
};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { TextInputProps } from '../TextInput/TextInput.js';
|
|
2
2
|
export type NumericInputProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible name of the decrement button. Pass your own wording to translate it.
|
|
5
|
+
* @default 'Decrease'
|
|
6
|
+
*/
|
|
7
|
+
decrementLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Accessible name of the increment button. Pass your own wording to translate it.
|
|
10
|
+
* @default 'Increase'
|
|
11
|
+
*/
|
|
12
|
+
incrementLabel?: string;
|
|
3
13
|
value?: number | string;
|
|
4
14
|
min?: number;
|
|
5
15
|
max?: number;
|
|
6
16
|
step?: number;
|
|
7
|
-
} & TextInputProps
|
|
17
|
+
} & Omit<TextInputProps, 'startSlot' | 'endSlot'>;
|
|
8
18
|
export declare const NumericInput: React.FC<NumericInputProps>;
|
|
9
19
|
//# sourceMappingURL=NumericInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumericInput.d.ts","sourceRoot":"","sources":["../../../../src/components/form/NumericInput/NumericInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumericInput.d.ts","sourceRoot":"","sources":["../../../../src/components/form/NumericInput/NumericInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;AAOlD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAgEpD,CAAC"}
|
|
@@ -1,42 +1,70 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { composeRefs } from "@blockle/blocks-core";
|
|
3
|
+
import { classnames, composeRefs } from "@blockle/blocks-core";
|
|
4
4
|
import { useRef, useCallback } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { PlusIcon, MinusIcon } from "../../../icons/icons.js";
|
|
6
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
6
7
|
import { TextInput } from "../TextInput/TextInput.js";
|
|
7
8
|
import { numericInput } from "./NumericInput.css.js";
|
|
8
|
-
const
|
|
9
|
+
const shiftMultiplier = 10;
|
|
10
|
+
const stepsFor = (event) => event.shiftKey ? shiftMultiplier : 1;
|
|
11
|
+
const NumericInput = ({
|
|
12
|
+
decrementLabel = "Decrease",
|
|
13
|
+
incrementLabel = "Increase",
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
9
16
|
const inputRef = useRef(null);
|
|
17
|
+
const { onKeyDown: consumerOnKeyDown } = props;
|
|
10
18
|
const onDecrement = useCallback((event) => {
|
|
11
|
-
|
|
12
|
-
inputRef.current?.stepDown(size);
|
|
19
|
+
inputRef.current?.stepDown(stepsFor(event));
|
|
13
20
|
}, []);
|
|
14
21
|
const onIncrement = useCallback((event) => {
|
|
15
|
-
|
|
16
|
-
inputRef.current?.stepUp(stepSize);
|
|
17
|
-
}, []);
|
|
18
|
-
const onKeyDown = useCallback((event) => {
|
|
19
|
-
if (!event.shiftKey) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (event.key === "ArrowUp") {
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
inputRef.current?.stepUp(10);
|
|
25
|
-
} else if (event.key === "ArrowDown") {
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
inputRef.current?.stepDown(10);
|
|
28
|
-
}
|
|
22
|
+
inputRef.current?.stepUp(stepsFor(event));
|
|
29
23
|
}, []);
|
|
24
|
+
const onKeyDown = useCallback(
|
|
25
|
+
(event) => {
|
|
26
|
+
consumerOnKeyDown?.(event);
|
|
27
|
+
if (event.defaultPrevented || !event.shiftKey) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (event.key === "ArrowUp") {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
inputRef.current?.stepUp(stepsFor(event));
|
|
33
|
+
} else if (event.key === "ArrowDown") {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
inputRef.current?.stepDown(stepsFor(event));
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
[consumerOnKeyDown]
|
|
39
|
+
);
|
|
30
40
|
return /* @__PURE__ */ jsx(
|
|
31
41
|
TextInput,
|
|
32
42
|
{
|
|
43
|
+
...props,
|
|
33
44
|
ref: composeRefs(props.ref, inputRef),
|
|
34
|
-
inputClassName: numericInput,
|
|
45
|
+
inputClassName: classnames(numericInput, props.inputClassName),
|
|
35
46
|
type: "number",
|
|
36
|
-
startSlot: /* @__PURE__ */ jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
startSlot: /* @__PURE__ */ jsx(
|
|
48
|
+
IconButton,
|
|
49
|
+
{
|
|
50
|
+
label: decrementLabel,
|
|
51
|
+
variant: "ghost",
|
|
52
|
+
size: "small",
|
|
53
|
+
onClick: onDecrement,
|
|
54
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
endSlot: /* @__PURE__ */ jsx(
|
|
58
|
+
IconButton,
|
|
59
|
+
{
|
|
60
|
+
label: incrementLabel,
|
|
61
|
+
variant: "ghost",
|
|
62
|
+
size: "small",
|
|
63
|
+
onClick: onIncrement,
|
|
64
|
+
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
onKeyDown
|
|
40
68
|
}
|
|
41
69
|
);
|
|
42
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Radio/Radio.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAOzE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Radio/Radio.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAOzE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AAEvC,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8BtC,CAAC"}
|
|
@@ -6,7 +6,6 @@ import { useComponentStyles } from "../../../hooks/useComponentStyles/useCompone
|
|
|
6
6
|
import { Label } from "../Label/Label.js";
|
|
7
7
|
import { input, icon, container } from "./radio.css.js";
|
|
8
8
|
const Radio = ({
|
|
9
|
-
name,
|
|
10
9
|
children,
|
|
11
10
|
className,
|
|
12
11
|
...restProps
|
|
@@ -21,16 +20,7 @@ const Radio = ({
|
|
|
21
20
|
{
|
|
22
21
|
className: classnames(container, containerClassName, className),
|
|
23
22
|
children: [
|
|
24
|
-
/* @__PURE__ */ jsx(
|
|
25
|
-
"input",
|
|
26
|
-
{
|
|
27
|
-
type: "radio",
|
|
28
|
-
name,
|
|
29
|
-
id,
|
|
30
|
-
className: input,
|
|
31
|
-
...restProps
|
|
32
|
-
}
|
|
33
|
-
),
|
|
23
|
+
/* @__PURE__ */ jsx("input", { type: "radio", id, className: input, ...restProps }),
|
|
34
24
|
/* @__PURE__ */ jsx("div", { className: classnames(icon, iconClassName) })
|
|
35
25
|
]
|
|
36
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.css.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Radio/radio.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"radio.css.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Radio/radio.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,QASpB,CAAC;AAEH,eAAO,MAAM,KAAK,QAShB,CAAC;AAEH,eAAO,MAAM,IAAI,QAEf,CAAC"}
|
|
@@ -4,8 +4,9 @@ type SelectTheme = ComponentThemes['select'];
|
|
|
4
4
|
export type SelectProps = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
placeholder?: string;
|
|
7
|
+
size?: SelectTheme['variants']['size'];
|
|
7
8
|
variant?: SelectTheme['variants']['variant'];
|
|
8
|
-
} & HTMLElementProps<HTMLSelectElement>;
|
|
9
|
+
} & Omit<HTMLElementProps<HTMLSelectElement>, 'size'>;
|
|
9
10
|
export declare const Select: React.FC<SelectProps>;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;CAC9C,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC;AAEtD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAiCxC,CAAC"}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { classnames } from "@blockle/blocks-core";
|
|
4
4
|
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
5
|
+
import { ChevronDownIcon } from "../../../icons/icons.js";
|
|
5
6
|
import { Box } from "../../layout/Box/Box.js";
|
|
6
7
|
import { select, icon, wrapper } from "./select.css.js";
|
|
7
8
|
const Select = ({
|
|
8
9
|
children,
|
|
9
10
|
placeholder,
|
|
10
11
|
className,
|
|
12
|
+
size,
|
|
11
13
|
variant,
|
|
12
14
|
...restProps
|
|
13
15
|
}) => {
|
|
14
16
|
const wrapperClassName = useComponentStyles("select", { root: true }, false);
|
|
15
17
|
const selectClassName = useComponentStyles("select", {
|
|
16
18
|
select: true,
|
|
17
|
-
variants: { variant }
|
|
19
|
+
variants: { variant, size }
|
|
18
20
|
});
|
|
19
21
|
const iconClassName = useComponentStyles("select", { icon: true }, false);
|
|
20
22
|
return /* @__PURE__ */ jsxs(Box, { className: classnames(wrapper, wrapperClassName), children: [
|
|
@@ -35,33 +37,11 @@ const Select = ({
|
|
|
35
37
|
className: classnames(icon, iconClassName),
|
|
36
38
|
role: "presentation",
|
|
37
39
|
"aria-hidden": true,
|
|
38
|
-
children: /* @__PURE__ */ jsx(
|
|
40
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { style: { width: "1rem", height: "1rem" } })
|
|
39
41
|
}
|
|
40
42
|
)
|
|
41
43
|
] });
|
|
42
44
|
};
|
|
43
|
-
const DefaultIcon = () => {
|
|
44
|
-
return (
|
|
45
|
-
// TOOD - replace with actual icon component renderer
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
"svg",
|
|
48
|
-
{
|
|
49
|
-
role: "presentation",
|
|
50
|
-
viewBox: "0 0 24 24",
|
|
51
|
-
style: { width: "1rem", height: "1rem" },
|
|
52
|
-
children: /* @__PURE__ */ jsx(
|
|
53
|
-
"path",
|
|
54
|
-
{
|
|
55
|
-
fill: "currentColor",
|
|
56
|
-
fillRule: "evenodd",
|
|
57
|
-
d: "m11.625 14.3666 7.9365-7.653c.5241-.5055 1.3133-.4372 1.7625.1525.4493.5897.3886 1.4774-.1355 1.9829l-8.75 8.4375c-.4681.4513-1.1589.4513-1.627 0l-8.75-8.4375c-.5241-.5055-.5848-1.3932-.1356-1.9829.4493-.5897 1.2385-.658 1.7626-.1525l7.9365 7.653Z",
|
|
58
|
-
clipRule: "evenodd"
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
45
|
export {
|
|
66
46
|
Select
|
|
67
47
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { HTMLElementProps } from '@blockle/blocks-core';
|
|
2
2
|
export type SwitchProps = {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The native change handler of the underlying input.
|
|
5
|
+
* Read the new value from `event.target.checked`.
|
|
6
|
+
*/
|
|
7
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
4
8
|
} & Omit<HTMLElementProps<HTMLInputElement>, 'onChange'>;
|
|
5
9
|
export declare const Switch: React.FC<SwitchProps>;
|
|
6
10
|
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAM9B,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;CACvD,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,CAAC;AAEzD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyDxC,CAAC"}
|