@blockle/blocks-react 3.1.0 → 3.3.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/display/Divider/divider.css.js +3 -3
- 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 +15 -6
- package/dist/components/feedback/Alert/Alert.d.ts.map +1 -1
- package/dist/components/feedback/Alert/Alert.js +8 -37
- 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 +6 -0
- package/dist/components/feedback/Toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/feedback/Toast/ToastProvider.js +90 -29
- 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.map +1 -1
- package/dist/components/form/Checkbox/Checkbox.js +7 -25
- 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/Label/Label.d.ts +1 -1
- package/dist/components/form/Label/Label.d.ts.map +1 -1
- 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/Select/Select.d.ts.map +1 -1
- package/dist/components/form/Select/Select.js +2 -23
- package/dist/components/form/Select/select.css.js +1 -1
- 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/navigation/Tabs/Tab.d.ts +21 -0
- package/dist/components/navigation/Tabs/Tab.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/Tab.js +138 -0
- package/dist/components/navigation/Tabs/TabIndicator.d.ts +6 -0
- package/dist/components/navigation/Tabs/TabIndicator.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/TabIndicator.js +19 -0
- package/dist/components/navigation/Tabs/TabList.d.ts +10 -0
- package/dist/components/navigation/Tabs/TabList.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/TabList.js +101 -0
- package/dist/components/navigation/Tabs/TabListContext.d.ts +13 -0
- package/dist/components/navigation/Tabs/TabListContext.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/TabListContext.js +6 -0
- package/dist/components/navigation/Tabs/TabNav.d.ts +15 -0
- package/dist/components/navigation/Tabs/TabNav.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/TabNav.js +44 -0
- package/dist/components/navigation/Tabs/TabPanel.d.ts +14 -0
- package/dist/components/navigation/Tabs/TabPanel.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/TabPanel.js +31 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts +13 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/Tabs.js +33 -0
- package/dist/components/navigation/Tabs/TabsContext.d.ts +13 -0
- package/dist/components/navigation/Tabs/TabsContext.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/TabsContext.js +27 -0
- package/dist/components/navigation/Tabs/tabs.css.d.ts +7 -0
- package/dist/components/navigation/Tabs/tabs.css.d.ts.map +1 -0
- package/dist/components/navigation/Tabs/tabs.css.js +122 -0
- package/dist/components/overlay/Dialog/Dialog.d.ts +1 -1
- package/dist/components/overlay/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/overlay/Dialog/Dialog.js +9 -7
- package/dist/components/overlay/Drawer/Drawer.d.ts +1 -1
- package/dist/components/overlay/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/overlay/Drawer/Drawer.js +9 -7
- package/dist/components/overlay/Menu/Menu.d.ts +52 -0
- package/dist/components/overlay/Menu/Menu.d.ts.map +1 -0
- package/dist/components/overlay/Menu/Menu.js +273 -0
- package/dist/components/overlay/Menu/menu-utils.d.ts +33 -0
- package/dist/components/overlay/Menu/menu-utils.d.ts.map +1 -0
- package/dist/components/overlay/Menu/menu-utils.js +54 -0
- package/dist/components/overlay/Popover/Popover.d.ts +9 -0
- package/dist/components/overlay/Popover/Popover.d.ts.map +1 -1
- package/dist/components/overlay/Popover/Popover.js +70 -31
- package/dist/components/overlay/Popover/popover-utils.d.ts +32 -1
- package/dist/components/overlay/Popover/popover-utils.d.ts.map +1 -1
- package/dist/components/overlay/Popover/popover-utils.js +77 -22
- package/dist/components/overlay/modalOverlayStack.d.ts +8 -0
- package/dist/components/overlay/modalOverlayStack.d.ts.map +1 -0
- package/dist/components/overlay/modalOverlayStack.js +37 -0
- package/dist/components/overlay/useModalOverlay.d.ts +6 -14
- package/dist/components/overlay/useModalOverlay.d.ts.map +1 -1
- package/dist/components/overlay/useModalOverlay.js +8 -31
- 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/useModalDialog/useModalDialog.d.ts +5 -0
- package/dist/hooks/useModalDialog/useModalDialog.d.ts.map +1 -1
- package/dist/hooks/useModalDialog/useModalDialog.js +3 -2
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.d.ts +5 -0
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.d.ts.map +1 -1
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.js +31 -16
- 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 +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -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/contrast.d.ts +6 -2
- package/dist/testUtils/browser/contrast.d.ts.map +1 -1
- package/dist/testUtils/browser/emulateNoAnchorPositioning.d.ts +8 -0
- package/dist/testUtils/browser/emulateNoAnchorPositioning.d.ts.map +1 -0
- package/dist/testUtils/browser/render.d.ts +6 -2
- package/dist/testUtils/browser/render.d.ts.map +1 -1
- package/dist/testUtils/browser/screenshot.d.ts +2 -0
- package/dist/testUtils/browser/screenshot.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
|
@@ -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
|
+
};
|
|
@@ -13,7 +13,7 @@ export type LabelProps = {
|
|
|
13
13
|
required?: boolean;
|
|
14
14
|
size?: LabelTheme['variants']['size'];
|
|
15
15
|
cursor?: Atoms['cursor'];
|
|
16
|
-
} & HTMLElementProps<HTMLLabelElement>;
|
|
16
|
+
} & Omit<HTMLElementProps<HTMLLabelElement>, 'size'>;
|
|
17
17
|
export declare const Label: React.FC<LabelProps>;
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Label/Label.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAI9B,KAAK,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC1B,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Label/Label.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAI9B,KAAK,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC1B,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAuBtC,CAAC"}
|
|
@@ -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":"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,6 +2,7 @@
|
|
|
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 = ({
|
|
@@ -36,33 +37,11 @@ const Select = ({
|
|
|
36
37
|
className: classnames(icon, iconClassName),
|
|
37
38
|
role: "presentation",
|
|
38
39
|
"aria-hidden": true,
|
|
39
|
-
children: /* @__PURE__ */ jsx(
|
|
40
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { style: { width: "1rem", height: "1rem" } })
|
|
40
41
|
}
|
|
41
42
|
)
|
|
42
43
|
] });
|
|
43
44
|
};
|
|
44
|
-
const DefaultIcon = () => {
|
|
45
|
-
return (
|
|
46
|
-
// TOOD - replace with actual icon component renderer
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
48
|
-
"svg",
|
|
49
|
-
{
|
|
50
|
-
role: "presentation",
|
|
51
|
-
viewBox: "0 0 24 24",
|
|
52
|
-
style: { width: "1rem", height: "1rem" },
|
|
53
|
-
children: /* @__PURE__ */ jsx(
|
|
54
|
-
"path",
|
|
55
|
-
{
|
|
56
|
-
fill: "currentColor",
|
|
57
|
-
fillRule: "evenodd",
|
|
58
|
-
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",
|
|
59
|
-
clipRule: "evenodd"
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
45
|
export {
|
|
67
46
|
Select
|
|
68
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.css.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Textarea/Textarea.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QASnB,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAE7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"Textarea.css.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Textarea/Textarea.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QASnB,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAE7B,CAAC;AAEH,eAAO,MAAM,aAAa,QAMxB,CAAC;AAEH,eAAO,MAAM,YAAY,QAMvB,CAAC"}
|
|
@@ -15,8 +15,24 @@ const textarea = style({
|
|
|
15
15
|
const fieldSizingEnabled = style({
|
|
16
16
|
fieldSizing: "content"
|
|
17
17
|
});
|
|
18
|
+
const containerFill = style({
|
|
19
|
+
"@layer": {
|
|
20
|
+
[layers.molecule]: {
|
|
21
|
+
blockSize: "100%"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const textareaFill = style({
|
|
26
|
+
"@layer": {
|
|
27
|
+
[layers.molecule]: {
|
|
28
|
+
minBlockSize: "100%"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
18
32
|
endFileScope();
|
|
19
33
|
export {
|
|
34
|
+
containerFill,
|
|
20
35
|
fieldSizingEnabled,
|
|
21
|
-
textarea
|
|
36
|
+
textarea,
|
|
37
|
+
textareaFill
|
|
22
38
|
};
|
|
@@ -11,6 +11,17 @@ export type TextareaProps = {
|
|
|
11
11
|
* itself keeps growing inside it.
|
|
12
12
|
*/
|
|
13
13
|
maxBlockSize?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* If true, the wrapper stretches to its parent's block size and the
|
|
16
|
+
* `<textarea>` is at least as tall as the wrapper. Combine with `grow` to
|
|
17
|
+
* give textareas side by side, such as in a `Grid`, equal heights.
|
|
18
|
+
*
|
|
19
|
+
* The heights match up to the container's maximum block size. Past it, the
|
|
20
|
+
* containers stay equal while the typed-in `<textarea>` scrolls inside its
|
|
21
|
+
* own; raise `maxBlockSize` to lift the limit. The parent needs a definite
|
|
22
|
+
* block size, such as a stretched grid cell.
|
|
23
|
+
*/
|
|
24
|
+
fill?: boolean;
|
|
14
25
|
/**
|
|
15
26
|
* Props for the wrapper element. Accepts the same atoms as `Box`.
|
|
16
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAM9B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B;;OAEG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC;CAE9E,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAM9B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC;CAE9E,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiD5C,CAAC"}
|
|
@@ -3,12 +3,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { classnames } from "@blockle/blocks-core";
|
|
4
4
|
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
5
5
|
import { Box } from "../../layout/Box/Box.js";
|
|
6
|
-
import { textarea, fieldSizingEnabled } from "./Textarea.css.js";
|
|
6
|
+
import { textarea, fieldSizingEnabled, textareaFill, containerFill } from "./Textarea.css.js";
|
|
7
7
|
const Textarea = ({
|
|
8
8
|
ref,
|
|
9
9
|
value,
|
|
10
10
|
grow,
|
|
11
11
|
maxBlockSize,
|
|
12
|
+
fill,
|
|
12
13
|
containerProps,
|
|
13
14
|
...restProps
|
|
14
15
|
}) => {
|
|
@@ -27,7 +28,11 @@ const Textarea = ({
|
|
|
27
28
|
return /* @__PURE__ */ jsx(
|
|
28
29
|
Box,
|
|
29
30
|
{
|
|
30
|
-
className: classnames(
|
|
31
|
+
className: classnames(
|
|
32
|
+
containerClassName,
|
|
33
|
+
fill && containerFill,
|
|
34
|
+
containerClassNameFromProps
|
|
35
|
+
),
|
|
31
36
|
style: {
|
|
32
37
|
maxHeight: grow ? maxBlockSize : void 0,
|
|
33
38
|
...containerStyleFromProps
|
|
@@ -41,6 +46,7 @@ const Textarea = ({
|
|
|
41
46
|
className: classnames(
|
|
42
47
|
textarea,
|
|
43
48
|
grow && fieldSizingEnabled,
|
|
49
|
+
fill && textareaFill,
|
|
44
50
|
inputClassName,
|
|
45
51
|
className
|
|
46
52
|
),
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { AlignItemsMap, Atoms, JustifyContentMap } from '@blockle/blocks-core';
|
|
1
|
+
import { AlignItemsMap, Atoms, HTMLElementProps, JustifyContentMap } from '@blockle/blocks-core';
|
|
2
2
|
export type InlineProps = {
|
|
3
3
|
alignX?: keyof JustifyContentMap;
|
|
4
4
|
alignY?: keyof AlignItemsMap;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Render the single child element instead of a `div`, with the layout
|
|
7
|
+
* classes and attributes merged onto it. A `ul` or `ol` child keeps its
|
|
8
|
+
* list markers unless `listStyle="none"` is passed. WebKit then no longer
|
|
9
|
+
* exposes the element as a list, so pass `role="list"` when list
|
|
10
|
+
* semantics matter.
|
|
11
|
+
*/
|
|
12
|
+
asChild?: boolean;
|
|
6
13
|
children: React.ReactNode;
|
|
7
14
|
className?: string;
|
|
15
|
+
ref?: React.Ref<HTMLElement>;
|
|
8
16
|
gap: Atoms['gap'];
|
|
9
17
|
style?: React.CSSProperties;
|
|
10
|
-
} & Omit<Atoms, 'flexDirection' | 'gap'>;
|
|
18
|
+
} & Omit<Atoms, 'flexDirection' | 'gap'> & Omit<HTMLElementProps<HTMLElement>, 'children' | 'ref'>;
|
|
11
19
|
export declare const Inline: React.FC<InlineProps>;
|
|
12
20
|
//# sourceMappingURL=Inline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,iBAAiB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/Inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,iBAAiB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC;IAC7B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,GAAG,IAAI,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,GACtC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,CAAC;AAE1D,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyBxC,CAAC"}
|
|
@@ -4,24 +4,26 @@ import { Box } from "../Box/Box.js";
|
|
|
4
4
|
const Inline = ({
|
|
5
5
|
alignX,
|
|
6
6
|
alignY,
|
|
7
|
-
|
|
7
|
+
asChild,
|
|
8
8
|
children,
|
|
9
9
|
display = "flex",
|
|
10
10
|
gap,
|
|
11
|
+
ref,
|
|
11
12
|
...props
|
|
12
13
|
}) => {
|
|
13
14
|
return /* @__PURE__ */ jsx(
|
|
14
15
|
Box,
|
|
15
16
|
{
|
|
16
|
-
asChild
|
|
17
|
+
asChild,
|
|
17
18
|
display,
|
|
18
19
|
gap,
|
|
19
20
|
flexDirection: "row",
|
|
20
21
|
justifyContent: alignX ? justifyContentMap[alignX] : void 0,
|
|
21
22
|
alignItems: alignY ? alignItemsMap[alignY] : void 0,
|
|
22
23
|
flexWrap: "wrap",
|
|
24
|
+
ref,
|
|
23
25
|
...props,
|
|
24
|
-
children
|
|
26
|
+
children
|
|
25
27
|
}
|
|
26
28
|
);
|
|
27
29
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { AlignItemsMap, Atoms } from '@blockle/blocks-core';
|
|
1
|
+
import { AlignItemsMap, Atoms, HTMLElementProps, JustifyContentMap } from '@blockle/blocks-core';
|
|
2
2
|
export type StackProps = {
|
|
3
3
|
alignX?: keyof AlignItemsMap;
|
|
4
|
-
|
|
4
|
+
alignY?: keyof JustifyContentMap;
|
|
5
|
+
/**
|
|
6
|
+
* Render the single child element instead of a `div`, with the layout
|
|
7
|
+
* classes and attributes merged onto it. A `ul` or `ol` child keeps its
|
|
8
|
+
* list markers unless `listStyle="none"` is passed. WebKit then no longer
|
|
9
|
+
* exposes the element as a list, so pass `role="list"` when list
|
|
10
|
+
* semantics matter.
|
|
11
|
+
*/
|
|
12
|
+
asChild?: boolean;
|
|
5
13
|
children: React.ReactNode;
|
|
6
14
|
className?: string;
|
|
15
|
+
ref?: React.Ref<HTMLElement>;
|
|
7
16
|
gap: Atoms['gap'];
|
|
8
17
|
style?: React.CSSProperties;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Start prop is only valid when tag="ol"
|
|
12
|
-
*/
|
|
13
|
-
start?: number;
|
|
14
|
-
} & Omit<Atoms, 'flexDirection' | 'gap'>;
|
|
18
|
+
} & Omit<Atoms, 'flexDirection' | 'gap'> & Omit<HTMLElementProps<HTMLElement>, 'children' | 'ref'>;
|
|
15
19
|
export declare const Stack: React.FC<StackProps>;
|
|
16
20
|
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/Stack/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/Stack/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,iBAAiB,CAAC;IACjC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,GAAG,IAAI,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,GACtC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,CAAC;AAE1D,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwBtC,CAAC"}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { alignItemsMap } from "@blockle/blocks-core";
|
|
2
|
+
import { justifyContentMap, alignItemsMap } from "@blockle/blocks-core";
|
|
3
3
|
import { Box } from "../Box/Box.js";
|
|
4
4
|
const Stack = ({
|
|
5
|
-
|
|
5
|
+
asChild,
|
|
6
6
|
display = "flex",
|
|
7
7
|
children,
|
|
8
8
|
gap,
|
|
9
9
|
alignX,
|
|
10
|
+
alignY,
|
|
11
|
+
ref,
|
|
10
12
|
...restProps
|
|
11
13
|
}) => {
|
|
12
14
|
return /* @__PURE__ */ jsx(
|
|
13
15
|
Box,
|
|
14
16
|
{
|
|
15
|
-
asChild
|
|
17
|
+
asChild,
|
|
16
18
|
display,
|
|
17
19
|
gap,
|
|
18
20
|
flexDirection: "column",
|
|
19
21
|
alignItems: alignX ? alignItemsMap[alignX] : void 0,
|
|
22
|
+
justifyContent: alignY ? justifyContentMap[alignY] : void 0,
|
|
23
|
+
ref,
|
|
20
24
|
...restProps,
|
|
21
|
-
children
|
|
25
|
+
children
|
|
22
26
|
}
|
|
23
27
|
);
|
|
24
28
|
};
|
|
@@ -3,8 +3,8 @@ type LinkTheme = ComponentThemes['link'];
|
|
|
3
3
|
export type LinkProps = {
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
+
intent?: LinkTheme['variants']['intent'];
|
|
6
7
|
underline?: LinkTheme['variants']['underline'];
|
|
7
|
-
variant?: LinkTheme['variants']['variant'];
|
|
8
8
|
} & HTMLElementProps<HTMLAnchorElement> & MarginAtoms;
|
|
9
9
|
export declare const Link: React.FC<LinkProps>;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/Link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAK9B,KAAK,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/Link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAC;AAK9B,KAAK,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC;CAChD,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,GACrC,WAAW,CAAC;AAId,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsBpC,CAAC"}
|
|
@@ -8,13 +8,13 @@ const Link = ({
|
|
|
8
8
|
asChild,
|
|
9
9
|
children,
|
|
10
10
|
className,
|
|
11
|
+
intent,
|
|
11
12
|
underline,
|
|
12
|
-
variant,
|
|
13
13
|
...restProps
|
|
14
14
|
}) => {
|
|
15
15
|
const linkClassName = useComponentStyles("link", {
|
|
16
16
|
root: true,
|
|
17
|
-
variants: {
|
|
17
|
+
variants: { intent, underline }
|
|
18
18
|
});
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
20
20
|
Template,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLElementProps } from '@blockle/blocks-core';
|
|
2
|
+
export type TabProps = {
|
|
3
|
+
/** In a `TabNav`: render the child element (a router link) as the tab's link */
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** In a `TabNav`: this tab is the current page. Sets `aria-current="page"` */
|
|
7
|
+
current?: boolean;
|
|
8
|
+
/** Content after the tab, such as a close `IconButton`; never inside the tab itself */
|
|
9
|
+
endSlot?: React.ReactNode;
|
|
10
|
+
ref?: React.Ref<HTMLAnchorElement & HTMLButtonElement>;
|
|
11
|
+
/** Content before the tab, such as a status dot or an Icon */
|
|
12
|
+
startSlot?: React.ReactNode;
|
|
13
|
+
/** In `Tabs`: matches the `value` of the TabPanel this tab shows. Required there. */
|
|
14
|
+
value?: string;
|
|
15
|
+
} & Omit<HTMLElementProps<HTMLElement>, 'children' | 'ref' | 'type' | 'value'>;
|
|
16
|
+
/**
|
|
17
|
+
* Inside `Tabs` a `button` with `role="tab"`; inside `TabNav` a link (`a`, or
|
|
18
|
+
* any element through `asChild`) that is `aria-current="page"` when `current`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Tab: React.FC<TabProps>;
|
|
21
|
+
//# sourceMappingURL=Tab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/Tabs/Tab.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AASzE,MAAM,MAAM,QAAQ,GAAG;IACrB,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uFAAuF;IACvF,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IACvD,8DAA8D;IAC9D,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAgK/E;;;GAGG;AACH,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAIlC,CAAC"}
|