@blockle/blocks-react 3.1.0 → 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.
Files changed (66) hide show
  1. package/dist/components/display/Tag/Tag.d.ts +28 -0
  2. package/dist/components/display/Tag/Tag.d.ts.map +1 -0
  3. package/dist/components/display/Tag/Tag.js +46 -0
  4. package/dist/components/feedback/Alert/Alert.d.ts +15 -6
  5. package/dist/components/feedback/Alert/Alert.d.ts.map +1 -1
  6. package/dist/components/feedback/Alert/Alert.js +8 -37
  7. package/dist/components/feedback/Toast/ToastContext.d.ts +6 -0
  8. package/dist/components/feedback/Toast/ToastContext.d.ts.map +1 -1
  9. package/dist/components/feedback/Toast/ToastProvider.d.ts +6 -0
  10. package/dist/components/feedback/Toast/ToastProvider.d.ts.map +1 -1
  11. package/dist/components/feedback/Toast/ToastProvider.js +90 -29
  12. package/dist/components/feedback/Toast/useCountdowns.d.ts +14 -0
  13. package/dist/components/feedback/Toast/useCountdowns.d.ts.map +1 -0
  14. package/dist/components/feedback/Toast/useCountdowns.js +74 -0
  15. package/dist/components/form/Button/Button.d.ts +11 -3
  16. package/dist/components/form/Button/Button.d.ts.map +1 -1
  17. package/dist/components/form/Checkbox/Checkbox.d.ts.map +1 -1
  18. package/dist/components/form/Checkbox/Checkbox.js +7 -25
  19. package/dist/components/form/IconButton/IconButton.d.ts +29 -0
  20. package/dist/components/form/IconButton/IconButton.d.ts.map +1 -0
  21. package/dist/components/form/IconButton/IconButton.js +61 -0
  22. package/dist/components/form/NumericInput/NumericInput.d.ts +11 -1
  23. package/dist/components/form/NumericInput/NumericInput.d.ts.map +1 -1
  24. package/dist/components/form/NumericInput/NumericInput.js +52 -24
  25. package/dist/components/form/Select/Select.d.ts.map +1 -1
  26. package/dist/components/form/Select/Select.js +2 -23
  27. package/dist/components/form/Textarea/Textarea.css.d.ts +2 -0
  28. package/dist/components/form/Textarea/Textarea.css.d.ts.map +1 -1
  29. package/dist/components/form/Textarea/Textarea.css.js +17 -1
  30. package/dist/components/form/Textarea/Textarea.d.ts +11 -0
  31. package/dist/components/form/Textarea/Textarea.d.ts.map +1 -1
  32. package/dist/components/form/Textarea/Textarea.js +8 -2
  33. package/dist/components/layout/Inline/Inline.d.ts +11 -3
  34. package/dist/components/layout/Inline/Inline.d.ts.map +1 -1
  35. package/dist/components/layout/Inline/Inline.js +5 -3
  36. package/dist/components/layout/Stack/Stack.d.ts +12 -8
  37. package/dist/components/layout/Stack/Stack.d.ts.map +1 -1
  38. package/dist/components/layout/Stack/Stack.js +8 -4
  39. package/dist/components/navigation/Link/Link.d.ts +1 -1
  40. package/dist/components/navigation/Link/Link.d.ts.map +1 -1
  41. package/dist/components/navigation/Link/Link.js +2 -2
  42. package/dist/components/typography/Heading/Heading.d.ts +2 -1
  43. package/dist/components/typography/Heading/Heading.d.ts.map +1 -1
  44. package/dist/components/typography/Heading/Heading.js +9 -1
  45. package/dist/components/typography/Text/Text.d.ts +3 -2
  46. package/dist/components/typography/Text/Text.d.ts.map +1 -1
  47. package/dist/components/typography/Text/Text.js +9 -1
  48. package/dist/components/typography/textOverflow.css.d.ts +3 -0
  49. package/dist/components/typography/textOverflow.css.d.ts.map +1 -0
  50. package/dist/components/typography/textOverflow.css.js +32 -0
  51. package/dist/components/typography/textOverflow.d.ts +9 -0
  52. package/dist/components/typography/textOverflow.d.ts.map +1 -0
  53. package/dist/components/typography/textOverflow.js +10 -0
  54. package/dist/icons/icons.d.ts +8 -0
  55. package/dist/icons/icons.d.ts.map +1 -0
  56. package/dist/icons/icons.js +39 -0
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +4 -0
  60. package/dist/testUtils/browser/consumerStyles.css.d.ts +2 -0
  61. package/dist/testUtils/browser/consumerStyles.css.d.ts.map +1 -0
  62. package/dist/testUtils/testTheme.css.d.ts.map +1 -1
  63. package/package.json +2 -2
  64. package/dist/components/feedback/Alert/Alert.css.d.ts +0 -2
  65. package/dist/components/feedback/Alert/Alert.css.d.ts.map +0 -1
  66. 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
+ };
@@ -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":"AAMA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,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,cAAc,CAAC;AAEnB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2CpD,CAAC"}
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 { Button } from "../Button/Button.js";
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 NumericInput = (props) => {
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
- const size = event.shiftKey ? 10 : 1;
12
- inputRef.current?.stepDown(size);
19
+ inputRef.current?.stepDown(stepsFor(event));
13
20
  }, []);
14
21
  const onIncrement = useCallback((event) => {
15
- const stepSize = event.shiftKey ? 10 : 1;
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(Button, { variant: "ghost", size: "small", onClick: onDecrement, children: "-" }),
37
- endSlot: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "small", onClick: onIncrement, children: "+" }),
38
- onKeyDown,
39
- ...props
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;AAM/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"}
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(DefaultIcon, {})
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,3 +1,5 @@
1
1
  export declare const textarea: string;
2
2
  export declare const fieldSizingEnabled: string;
3
+ export declare const containerFill: string;
4
+ export declare const textareaFill: string;
3
5
  //# sourceMappingURL=Textarea.css.d.ts.map
@@ -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,CA2C5C,CAAC"}
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(containerClassName, containerClassNameFromProps),
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
- tag?: 'div' | 'ul' | 'ol' | 'nav';
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,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,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,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAuBxC,CAAC"}
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
- tag: Tag = "div",
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: true,
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: /* @__PURE__ */ jsx(Tag, { 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
- tag?: 'div' | 'section' | 'ul' | 'ol';
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
- role?: React.AriaRole;
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,EAEX,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,aAAa,CAAC;IAC7B,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,CAAC;AAEzC,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwBtC,CAAC"}
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
- tag: Tag = "div",
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: true,
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: /* @__PURE__ */ jsx(Tag, { 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,SAAS,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;CAC5C,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,GACrC,WAAW,CAAC;AAId,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsBpC,CAAC"}
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: { variant, underline }
17
+ variants: { intent, underline }
18
18
  });
19
19
  return /* @__PURE__ */ jsx(
20
20
  Template,
@@ -1,10 +1,11 @@
1
1
  import { HTMLElementProps, MarginAtoms, PaddingAtoms, TextAtoms } from '@blockle/blocks-core';
2
2
  import { TextColor } from '../textColor.js';
3
+ import { TextOverflowProps } from '../textOverflow.js';
3
4
  export type HeadingProps = {
4
5
  className?: string;
5
6
  /** A text Color role, which follows the Color mode, or a fixed Palette color. */
6
7
  color?: TextColor;
7
8
  level?: 1 | 2 | 3 | 4 | 5 | 6;
8
- } & HTMLElementProps<HTMLHeadingElement> & Omit<TextAtoms, 'color'> & MarginAtoms & PaddingAtoms;
9
+ } & TextOverflowProps & HTMLElementProps<HTMLHeadingElement> & Omit<TextAtoms, 'color'> & MarginAtoms & PaddingAtoms;
9
10
  export declare const Heading: React.FC<HeadingProps>;
10
11
  //# sourceMappingURL=Heading.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Heading/Heading.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAGhE,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC/B,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,GACtC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GACxB,WAAW,GACX,YAAY,CAAC;AAEf,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAuB1C,CAAC"}
1
+ {"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Heading/Heading.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC/B,GAAG,iBAAiB,GACnB,gBAAgB,CAAC,kBAAkB,CAAC,GACpC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GACxB,WAAW,GACX,YAAY,CAAC;AAEf,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8B1C,CAAC"}
@@ -3,11 +3,14 @@ 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 { textOverflowClassName } from "../textOverflow.js";
6
7
  import { heading } from "./heading.css.js";
7
8
  const Heading = ({
8
9
  className,
9
10
  color,
10
11
  level = 1,
12
+ lineClamp,
13
+ truncate,
11
14
  children,
12
15
  ...restProps
13
16
  }) => {
@@ -20,7 +23,12 @@ const Heading = ({
20
23
  Box,
21
24
  {
22
25
  asChild: true,
23
- className: classnames(heading, themeClassName, className),
26
+ className: classnames(
27
+ heading,
28
+ themeClassName,
29
+ textOverflowClassName("Heading", { lineClamp, truncate }),
30
+ className
31
+ ),
24
32
  color,
25
33
  ...restProps,
26
34
  children: /* @__PURE__ */ jsx(Tag, { children })
@@ -1,6 +1,7 @@
1
1
  import { HTMLElementProps, MarginAtoms, PaddingAtoms, TextAtoms } from '@blockle/blocks-core';
2
2
  import { default as React } from 'react';
3
3
  import { TextColor } from '../textColor.js';
4
+ import { TextOverflowProps } from '../textOverflow.js';
4
5
  type Tags = 'cite' | 'code' | 'del' | 'em' | 'ins' | 'kbd' | 'label' | 'mark' | 'p' | 'q' | 's' | 'small' | 'span' | 'strong' | 'sub' | 'sup';
5
6
  export type TextProps<Tag extends Tags = 'span'> = {
6
7
  asChild?: boolean;
@@ -9,7 +10,7 @@ export type TextProps<Tag extends Tags = 'span'> = {
9
10
  tag?: Tag;
10
11
  /** A text Color role, which follows the Color mode, or a fixed Palette color. */
11
12
  color?: TextColor;
12
- } & Omit<HTMLElementProps<HTMLSpanElement>, 'children' | 'ref'> & Omit<TextAtoms, 'color'> & MarginAtoms & PaddingAtoms;
13
- export declare const Text: <T extends Tags = "span">({ asChild, children, className, color, ref, tag, ...restProps }: TextProps<T>) => import("react/jsx-runtime").JSX.Element;
13
+ } & TextOverflowProps & Omit<HTMLElementProps<HTMLSpanElement>, 'children' | 'ref'> & Omit<TextAtoms, 'color'> & MarginAtoms & PaddingAtoms;
14
+ export declare const Text: <T extends Tags = "span">({ asChild, children, className, color, lineClamp, ref, tag, truncate, ...restProps }: TextProps<T>) => import("react/jsx-runtime").JSX.Element;
14
15
  export {};
15
16
  //# sourceMappingURL=Text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Text/Text.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAGhE,KAAK,IAAI,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,GACL,OAAO,GACP,MAAM,GACN,GAAG,GACH,GAAG,GACH,GAAG,GACH,OAAO,GACP,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,SAAS,CAAC,GAAG,SAAS,IAAI,GAAG,MAAM,IAAI;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,iFAAiF;IACjF,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,GAC7D,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GACxB,WAAW,GACX,YAAY,CAAC;AAEf,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,IAAI,GAAG,MAAM,EAAE,iEAQ3C,SAAS,CAAC,CAAC,CAAC,4CAsBd,CAAC"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/Text/Text.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,oBAAoB,CAAC;AAG5B,KAAK,IAAI,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,GACL,OAAO,GACP,MAAM,GACN,GAAG,GACH,GAAG,GACH,GAAG,GACH,OAAO,GACP,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,SAAS,CAAC,GAAG,SAAS,IAAI,GAAG,MAAM,IAAI;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,iFAAiF;IACjF,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG,iBAAiB,GACnB,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,GAC3D,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GACxB,WAAW,GACX,YAAY,CAAC;AAEf,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,IAAI,GAAG,MAAM,EAAE,sFAU3C,SAAS,CAAC,CAAC,CAAC,4CA2Bd,CAAC"}
@@ -3,14 +3,17 @@ 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 { textOverflowClassName } from "../textOverflow.js";
6
7
  import { text } from "./text.css.js";
7
8
  const Text = ({
8
9
  asChild,
9
10
  children,
10
11
  className,
11
12
  color,
13
+ lineClamp,
12
14
  ref,
13
15
  tag,
16
+ truncate,
14
17
  ...restProps
15
18
  }) => {
16
19
  const Component = tag ?? "span";
@@ -22,7 +25,12 @@ const Text = ({
22
25
  Box,
23
26
  {
24
27
  asChild: true,
25
- className: classnames(text, themeClassName, className),
28
+ className: classnames(
29
+ text,
30
+ themeClassName,
31
+ textOverflowClassName("Text", { lineClamp, truncate }),
32
+ className
33
+ ),
26
34
  color,
27
35
  ...restProps,
28
36
  children: asChild ? children : (
@@ -0,0 +1,3 @@
1
+ export declare const lineClamp: Record<1 | 2 | 3 | 4 | 5, string>;
2
+ export declare const truncate: string;
3
+ //# sourceMappingURL=textOverflow.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textOverflow.css.d.ts","sourceRoot":"","sources":["../../../src/components/typography/textOverflow.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,mCAYrB,CAAC;AAEF,eAAO,MAAM,QAAQ,QASnB,CAAC"}