@wonderflow/react-components 3.0.0-next.9 → 3.0.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 (170) hide show
  1. package/autocomplete/autocomplete-option.d.ts +39 -0
  2. package/autocomplete/autocomplete-option.js +11 -0
  3. package/autocomplete/autocomplete.d.ts +24 -0
  4. package/autocomplete/autocomplete.js +82 -0
  5. package/autocomplete/autocomplete.module.css +1 -0
  6. package/autocomplete/index.d.ts +2 -0
  7. package/autocomplete/index.js +1 -0
  8. package/avatar/avatar.d.ts +15 -3
  9. package/avatar/avatar.js +3 -6
  10. package/button/button.d.ts +35 -0
  11. package/button/button.js +7 -10
  12. package/button/button.module.css +1 -1
  13. package/card/card.d.ts +24 -0
  14. package/card/card.js +3 -6
  15. package/card/card.module.css +1 -1
  16. package/chip/chip.d.ts +28 -4
  17. package/chip/chip.js +3 -5
  18. package/circular-progress/circular-progress.d.ts +33 -3
  19. package/circular-progress/circular-progress.js +3 -2
  20. package/clamp-text/clamp-text.d.ts +6 -0
  21. package/clamp-text/clamp-text.js +3 -2
  22. package/container/container.d.ts +6 -0
  23. package/container/container.js +3 -2
  24. package/core/typography.css +1 -1
  25. package/core/utils/media.css +19 -1
  26. package/core/utils/vibrancy.css +0 -24
  27. package/core.css +1 -1
  28. package/datetime/datetime.d.ts +7 -0
  29. package/datetime/datetime.js +16 -0
  30. package/datetime/index.d.ts +2 -0
  31. package/datetime/index.js +1 -0
  32. package/disclosure/disclosure.d.ts +55 -3
  33. package/disclosure/disclosure.js +4 -7
  34. package/drawer/drawer.d.ts +85 -0
  35. package/drawer/drawer.js +34 -0
  36. package/drawer/drawer.module.css +1 -0
  37. package/drawer/index.d.ts +2 -0
  38. package/drawer/index.js +1 -0
  39. package/dropdown/dropdown.d.ts +43 -10
  40. package/dropdown/dropdown.js +45 -34
  41. package/dropdown/dropdown.module.css +1 -1
  42. package/dropdown/index.d.ts +0 -1
  43. package/elevator/elevator.d.ts +11 -0
  44. package/elevator/elevator.js +6 -5
  45. package/grid/grid.d.ts +32 -2
  46. package/grid/grid.js +4 -3
  47. package/grid/grid.module.css +1 -1
  48. package/grid/index.d.ts +1 -1
  49. package/grid/item/grid-item.d.ts +41 -0
  50. package/grid/item/grid-item.js +12 -0
  51. package/grid/item/grid-item.module.css +1 -0
  52. package/icon/icon.d.ts +30 -4
  53. package/icon/icon.js +3 -3
  54. package/icon-button/icon-button.js +3 -2
  55. package/index.d.ts +86 -40
  56. package/index.js +6 -3
  57. package/info-state/info-state.d.ts +50 -6
  58. package/info-state/info-state.js +3 -9
  59. package/input-group/input-group.d.ts +33 -3
  60. package/input-group/input-group.js +11 -15
  61. package/linear-progress/linear-progress.d.ts +33 -3
  62. package/linear-progress/linear-progress.js +6 -7
  63. package/list/list.d.ts +13 -0
  64. package/list/list.js +4 -5
  65. package/list/list.module.css +1 -1
  66. package/masonry/masonry.d.ts +22 -0
  67. package/masonry/masonry.js +5 -4
  68. package/menu/index.d.ts +6 -0
  69. package/menu/index.js +3 -0
  70. package/menu/menu-item/menu-item-checkbox.d.ts +11 -0
  71. package/menu/menu-item/menu-item-checkbox.js +5 -0
  72. package/menu/menu-item/menu-item.d.ts +60 -0
  73. package/menu/menu-item/menu-item.js +23 -0
  74. package/menu/menu-item/menu-item.module.css +1 -0
  75. package/menu/menu.d.ts +16 -0
  76. package/menu/menu.js +15 -0
  77. package/menu/menu.module.css +1 -0
  78. package/modal/content/modal-content.d.ts +19 -3
  79. package/modal/content/modal-content.js +6 -9
  80. package/modal/content/modal-content.module.css +1 -1
  81. package/modal/index.d.ts +0 -1
  82. package/modal/index.js +0 -1
  83. package/modal/modal.d.ts +6 -3
  84. package/modal/modal.js +25 -11
  85. package/modal/modal.module.css +1 -1
  86. package/overlay-container/index.d.ts +1 -0
  87. package/overlay-container/index.js +1 -0
  88. package/overlay-container/overlay-container.d.ts +27 -1
  89. package/overlay-container/overlay-container.js +9 -5
  90. package/overlay-container/overlay-container.module.css +1 -0
  91. package/overlay-container/overlay-context.d.ts +9 -0
  92. package/overlay-container/overlay-context.js +23 -0
  93. package/package.json +74 -30
  94. package/pagination/pagination.d.ts +26 -2
  95. package/pagination/pagination.js +5 -4
  96. package/polymorphic/polymorphic.d.ts +26 -1
  97. package/prose/prose.js +3 -2
  98. package/select/select.d.ts +45 -3
  99. package/select/select.js +4 -7
  100. package/select/select.module.css +1 -1
  101. package/selection-controls/checkbox.d.ts +31 -3
  102. package/selection-controls/checkbox.js +3 -2
  103. package/selection-controls/radio.d.ts +23 -3
  104. package/selection-controls/radio.js +3 -2
  105. package/selection-controls/selection-controls.module.css +1 -1
  106. package/selection-controls/toggle.d.ts +23 -3
  107. package/selection-controls/toggle.js +3 -2
  108. package/separator/separator.d.ts +2 -2
  109. package/separator/separator.js +3 -2
  110. package/skeleton-block/skeleton-block.d.ts +4 -0
  111. package/skeleton-block/skeleton-block.js +2 -2
  112. package/slider/slider.d.ts +65 -3
  113. package/slider/slider.js +3 -7
  114. package/snackbar/snackbar.d.ts +28 -2
  115. package/snackbar/snackbar.js +4 -11
  116. package/snackbar/snackbar.module.css +1 -1
  117. package/spinner/spinner.d.ts +15 -3
  118. package/spinner/spinner.js +4 -7
  119. package/split-button/split-button.d.ts +4 -2
  120. package/split-button/split-button.js +4 -5
  121. package/split-button/split-button.module.css +1 -1
  122. package/stack/stack.d.ts +35 -1
  123. package/stack/stack.js +3 -2
  124. package/stack/stack.module.css +1 -1
  125. package/star-meter/star-meter.d.ts +25 -0
  126. package/star-meter/star-meter.js +9 -16
  127. package/tab/primitive-tab.d.ts +1 -1
  128. package/tab/primitive-tab.js +3 -3
  129. package/tab/tab-item.d.ts +17 -3
  130. package/tab/tab-item.js +3 -4
  131. package/tab/tab-list.d.ts +6 -2
  132. package/tab/tab-list.js +3 -3
  133. package/tab/tab-panel.d.ts +25 -3
  134. package/tab/tab-panel.js +3 -2
  135. package/tab/tab.d.ts +18 -1
  136. package/tab/tab.js +6 -8
  137. package/table/table.d.ts +13 -0
  138. package/table/table.js +7 -9
  139. package/text/text.d.ts +31 -0
  140. package/text/text.js +4 -3
  141. package/text/text.module.css +1 -1
  142. package/textfield/base-field/base-field.d.ts +10 -1
  143. package/textfield/base-field/base-field.js +3 -2
  144. package/textfield/base-field/base-field.module.css +1 -1
  145. package/textfield/textfield.d.ts +76 -6
  146. package/textfield/textfield.js +10 -13
  147. package/themes/dark.css +1 -1
  148. package/themes/light.css +1 -1
  149. package/title/title.d.ts +20 -0
  150. package/title/title.js +3 -2
  151. package/title/title.module.css +1 -1
  152. package/toggle-button/toggle-button.d.ts +10 -0
  153. package/toggle-button/toggle-button.js +6 -5
  154. package/tooltip/tooltip.d.ts +33 -1
  155. package/tooltip/tooltip.js +24 -27
  156. package/tooltip/tooltip.module.css +1 -1
  157. package/dropdown/dropdown-item.d.ts +0 -21
  158. package/dropdown/dropdown-item.js +0 -26
  159. package/dropdown/dropdown-item.module.css +0 -1
  160. package/dropdown/dropdown-menu.d.ts +0 -7
  161. package/dropdown/dropdown-menu.js +0 -17
  162. package/dropdown/dropdown-menu.module.css +0 -1
  163. package/grid/grid-item.d.ts +0 -11
  164. package/grid/grid-item.js +0 -11
  165. package/modal/modal-context.d.ts +0 -9
  166. package/modal/modal-context.js +0 -22
  167. package/theme-switch/index.d.ts +0 -2
  168. package/theme-switch/index.js +0 -1
  169. package/theme-switch/theme-switch.d.ts +0 -9
  170. package/theme-switch/theme-switch.js +0 -14
@@ -0,0 +1,39 @@
1
+ import { MenuItemProps } from '..';
2
+ import { PropsWithChildren } from 'react';
3
+ import { Except } from 'type-fest';
4
+ export declare type AutocompleteOptionProps = PropsWithChildren<PropsWithClass> & Except<MenuItemProps, 'padding' | 'autoFocus' | 'description' | 'onClick'> & {
5
+ /**
6
+ * Value of the option.
7
+ * This is the value that will be passed to the `onChange` callback.
8
+ */
9
+ value: string;
10
+ /**
11
+ * Callback called when the option is clicked.
12
+ * It passes the value and the inner text of the option as arguments.
13
+ */
14
+ onClick?(value?: string, content?: string): void;
15
+ /**
16
+ * Label of the option. This is the text that will be displayed in the option, which can be
17
+ * different from the value.
18
+ */
19
+ children: string;
20
+ };
21
+ export declare const AutocompleteOption: import("react").ForwardRefExoticComponent<PropsWithClass & {
22
+ children?: import("react").ReactNode;
23
+ } & Except<MenuItemProps, "description" | "onClick" | "autoFocus" | "padding"> & {
24
+ /**
25
+ * Value of the option.
26
+ * This is the value that will be passed to the `onChange` callback.
27
+ */
28
+ value: string;
29
+ /**
30
+ * Callback called when the option is clicked.
31
+ * It passes the value and the inner text of the option as arguments.
32
+ */
33
+ onClick?(value?: string | undefined, content?: string | undefined): void;
34
+ /**
35
+ * Label of the option. This is the text that will be displayed in the option, which can be
36
+ * different from the value.
37
+ */
38
+ children: string;
39
+ } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Menu } from '..';
3
+ import { forwardRef, useCallback, useRef } from 'react';
4
+ export const AutocompleteOption = forwardRef(({ children, value, onClick, ...otherProps }, forwardedRef) => {
5
+ const contentRef = useRef(null);
6
+ const handleClick = useCallback(() => {
7
+ onClick && onClick(value, contentRef?.current?.innerText);
8
+ }, [onClick, value]);
9
+ return (_jsx(Menu.Item, { ref: forwardedRef, role: "option", padding: false, onClick: handleClick, ...otherProps, children: _jsx("span", { ref: contentRef, children: children }, void 0) }, void 0));
10
+ });
11
+ AutocompleteOption.displayName = 'Autocomplete.Option';
@@ -0,0 +1,24 @@
1
+ import { AutocompleteOptionProps } from './autocomplete-option';
2
+ import { ForwardRefExoticComponent, ReactNode } from 'react';
3
+ import { TextfieldProps } from '..';
4
+ export declare type AutocompleteProps = TextfieldProps & {
5
+ /**
6
+ * The callback called when an option is picked from the list
7
+ */
8
+ onChange?(value?: string): void;
9
+ /**
10
+ * Set the maximum height of the options list after which
11
+ * it will scroll.
12
+ */
13
+ maxHeight?: string;
14
+ /**
15
+ * Custom empty message to display when there are no options or
16
+ * when the value does not match any of the options.
17
+ */
18
+ emptyMessage?: ReactNode;
19
+ };
20
+ declare type AutocompleteComponent = ForwardRefExoticComponent<AutocompleteProps> & {
21
+ Option: ForwardRefExoticComponent<AutocompleteOptionProps>;
22
+ };
23
+ export declare const Autocomplete: AutocompleteComponent;
24
+ export {};
@@ -0,0 +1,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AnimatePresence, motion } from 'framer-motion';
3
+ import { AutocompleteOption } from './autocomplete-option';
4
+ import { Children, cloneElement, forwardRef, useCallback, useMemo, useRef, useState, useEffect } from 'react';
5
+ import { useDebounce, useFocusWithin, useKeyPress, useSize } from 'ahooks';
6
+ import { Text, Menu, Textfield } from '..';
7
+ import { Autocomplete as AutocompleteClass, OptionsList, PopUp } from './autocomplete.module.css';
8
+ import { usePopperTooltip } from 'react-popper-tooltip';
9
+ import { useUIDSeed } from 'react-uid';
10
+ const AutocompleteAnimation = {
11
+ visible: {
12
+ y: 0,
13
+ opacity: 1,
14
+ transition: {
15
+ ease: [0, 0, 0.34, 1],
16
+ duration: 0.1
17
+ }
18
+ },
19
+ hidden: {
20
+ y: -5,
21
+ opacity: 0,
22
+ transition: {
23
+ ease: [0.3, 0.07, 1, 1],
24
+ duration: 0.1
25
+ }
26
+ }
27
+ };
28
+ export const Autocomplete = forwardRef(({ children, onChange, disabled, readOnly, value, maxHeight = '200px', emptyMessage = 'No results found', ...otherProps }, forwardedRef) => {
29
+ const seedID = useUIDSeed();
30
+ const autocompleteRef = useRef(forwardedRef);
31
+ const [isOpen, setIsOpen] = useState(false);
32
+ const [content, setContent] = useState(value ? String(value) : '');
33
+ const isInteractive = useMemo(() => !disabled && !readOnly, [disabled, readOnly]);
34
+ const debouncedFieldContent = useDebounce(content, { wait: 100 });
35
+ const filteredOptions = useMemo(() => {
36
+ const items = Children.toArray(children);
37
+ return debouncedFieldContent
38
+ ? items.filter((o) => {
39
+ const stringToMatch = typeof o.props.children === 'string' ? o.props.children : o.props.children.join('');
40
+ return stringToMatch?.toLowerCase().includes(debouncedFieldContent.toLowerCase());
41
+ })
42
+ : items;
43
+ }, [debouncedFieldContent, children]);
44
+ const isFocusWithin = useFocusWithin(autocompleteRef, {
45
+ onChange: (isFocusWithin) => {
46
+ isFocusWithin ? setIsOpen(true) : setIsOpen(false);
47
+ }
48
+ });
49
+ useKeyPress('esc', () => setIsOpen(false));
50
+ const { getTooltipProps, setTooltipRef, setTriggerRef, triggerRef, visible } = usePopperTooltip({
51
+ delayShow: 0,
52
+ delayHide: 0,
53
+ trigger: null,
54
+ visible: isInteractive ? isOpen : false,
55
+ closeOnTriggerHidden: true,
56
+ placement: 'bottom-start',
57
+ offset: [0, 8],
58
+ interactive: true
59
+ });
60
+ const triggerSize = useSize(triggerRef);
61
+ const handleOptionClick = useCallback((optionValue, optionContent) => {
62
+ setContent(optionContent);
63
+ setIsOpen(false);
64
+ onChange && onChange(optionValue);
65
+ }, [onChange]);
66
+ const handleFilter = useCallback(({ currentTarget }) => {
67
+ setContent(currentTarget.value);
68
+ }, []);
69
+ const dynamicStyle = {
70
+ '--max-h': maxHeight
71
+ };
72
+ useEffect(() => {
73
+ value && setContent(String(value));
74
+ }, [value]);
75
+ return (_jsxs("div", { ref: autocompleteRef, className: AutocompleteClass, "data-focus-within": isFocusWithin, children: [_jsx(Textfield, { ref: setTriggerRef, id: seedID('autocomplete-trigger'), "aria-haspopup": "true", "aria-controls": seedID('autocomplete-menu'), "aria-expanded": isOpen, onChange: handleFilter, value: content, autoComplete: "off", disabled: disabled, readOnly: readOnly, ...otherProps }, seedID('autocomplete-trigger')), _jsx(AnimatePresence, { children: visible && (_jsx("div", { ref: setTooltipRef, ...getTooltipProps({ className: PopUp, style: { minInlineSize: triggerSize ? (triggerSize.width + 2) : 'auto' } }), children: _jsx(motion.div, { variants: AutocompleteAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: _jsx(Menu, { role: "listbox", id: seedID('autocomplete-menu'), className: OptionsList, style: dynamicStyle, "aria-labelledby": seedID('autocomplete-trigger'), children: filteredOptions.length === 0
76
+ ? _jsx(Text, { as: "div", textAlign: "center", dimmed: 5, children: emptyMessage }, void 0)
77
+ : Children.map(filteredOptions, (child) => cloneElement(child, {
78
+ onClick: handleOptionClick
79
+ })) }, void 0) }, void 0) }, void 0)) }, void 0)] }, void 0));
80
+ });
81
+ Autocomplete.Option = AutocompleteOption;
82
+ Autocomplete.displayName = 'Autocomplete';
@@ -0,0 +1 @@
1
+ .Autocomplete{display:contents}.PopUp{z-index:2}.OptionsList{-webkit-overflow-scrolling:touch;max-block-size:var(--max-h);overflow:auto;overscroll-behavior:contain}
@@ -0,0 +1,2 @@
1
+ export { Autocomplete } from './autocomplete';
2
+ export type { AutocompleteProps } from './autocomplete';
@@ -0,0 +1 @@
1
+ export { Autocomplete } from './autocomplete';
@@ -1,9 +1,21 @@
1
- import React, { ImgHTMLAttributes } from 'react';
1
+ import { ImgHTMLAttributes } from 'react';
2
2
  export declare type AvatarProps = ImgHTMLAttributes<HTMLImageElement> & {
3
+ /**
4
+ * The source of the image to use as avatar
5
+ */
3
6
  src?: string;
7
+ /**
8
+ * Define the size of the avatar
9
+ */
4
10
  dimension?: 'small' | 'regular' | 'big';
5
11
  };
6
- export declare const Avatar: React.ForwardRefExoticComponent<React.ImgHTMLAttributes<HTMLImageElement> & {
12
+ export declare const Avatar: import("react").ForwardRefExoticComponent<ImgHTMLAttributes<HTMLImageElement> & {
13
+ /**
14
+ * The source of the image to use as avatar
15
+ */
7
16
  src?: string | undefined;
17
+ /**
18
+ * Define the size of the avatar
19
+ */
8
20
  dimension?: "big" | "small" | "regular" | undefined;
9
- } & React.RefAttributes<HTMLImageElement>>;
21
+ } & import("react").RefAttributes<HTMLImageElement>>;
package/avatar/avatar.js CHANGED
@@ -1,11 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import clsx from 'clsx';
2
- import React, { forwardRef } from 'react';
3
+ import { forwardRef } from 'react';
3
4
  import { Avatar as AvatarClass, Placeholder } from './avatar.module.css';
4
5
  export const Avatar = forwardRef(({ className, src, dimension = 'regular', ...otherProps }, forwardedRef) => {
5
- return (React.createElement("picture", { className: clsx(AvatarClass, className), "data-avatar-dimension": dimension },
6
- React.createElement("svg", { "aria-hidden": "true", className: Placeholder, height: 18, viewBox: "0 0 12 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
7
- React.createElement("path", { opacity: 0.7, d: "M6 0C3.795 0 2 1.794 2 4s1.795 4 4 4 4-1.794 4-4-1.795-4-4-4z", fill: "var(--highlight-blue-foreground)" }),
8
- React.createElement("path", { d: "M8.4 9H3.6C1.612 9 0 10.575 0 12.531v5.126C1.814 18.517 3.85 19 6 19s4.186-.483 6-1.343v-5.126C12 10.581 10.394 9 8.4 9z", fill: "var(--highlight-blue-foreground)" })),
9
- src && (React.createElement("img", { ref: forwardedRef, alt: "", src: src, ...otherProps }))));
6
+ return (_jsxs("picture", { className: clsx(AvatarClass, className), "data-avatar-dimension": dimension, children: [_jsxs("svg", { "aria-hidden": "true", className: Placeholder, height: 18, viewBox: "0 0 12 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { opacity: 0.7, d: "M6 0C3.795 0 2 1.794 2 4s1.795 4 4 4 4-1.794 4-4-1.795-4-4-4z", fill: "var(--highlight-blue-foreground)" }, void 0), _jsx("path", { d: "M8.4 9H3.6C1.612 9 0 10.575 0 12.531v5.126C1.814 18.517 3.85 19 6 19s4.186-.483 6-1.343v-5.126C12 10.581 10.394 9 8.4 9z", fill: "var(--highlight-blue-foreground)" }, void 0)] }, void 0), src && (_jsx("img", { ref: forwardedRef, alt: "", src: src, ...otherProps }, void 0))] }, void 0));
10
7
  });
11
8
  Avatar.displayName = 'Avatar';
@@ -2,16 +2,51 @@ import { FC, MouseEvent } from 'react';
2
2
  import { IconNames } from '../icons/types';
3
3
  import { Polymorphic } from '../';
4
4
  export declare type ButtonProps = {
5
+ /**
6
+ * Set the style of the button.
7
+ * When disabled the style is overwritten.
8
+ */
5
9
  kind?: 'primary' | 'secondary' | 'flat';
10
+ /**
11
+ * Set the size of the button.
12
+ */
6
13
  dimension?: 'regular' | 'small' | 'big';
14
+ /**
15
+ * Make the button full width, filling the available space.
16
+ */
7
17
  fullWidth?: boolean;
18
+ /**
19
+ * Define the icon to use.
20
+ */
8
21
  icon?: IconNames;
22
+ /**
23
+ * Set the position of the icon. Used only when icon is defined.
24
+ */
9
25
  iconPosition?: 'left' | 'right';
26
+ /**
27
+ * Override the color of the icon. Used only when icon is defined.
28
+ */
10
29
  iconColor?: string;
30
+ /**
31
+ * Set disabled state. The button is not interactive and grayed out.
32
+ */
11
33
  disabled?: boolean;
34
+ /**
35
+ * Pass the HTML attribute `type` to the button.
36
+ * If not specified, the type is always 'button' when rendered as `<button>.
37
+ */
12
38
  type?: 'submit' | 'reset' | 'button';
39
+ /**
40
+ * Set the loading state and show a spinner.
41
+ */
13
42
  busy?: boolean;
43
+ /**
44
+ * Set the pressed state and add required aria attributes.
45
+ */
14
46
  pressed?: boolean;
47
+ /**
48
+ * Callback function to be called when the button is pressed.
49
+ */
15
50
  onClick?(event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>): void;
16
51
  };
17
52
  declare type PolymorphicButton = Polymorphic.ForwardRefComponent<'button', ButtonProps>;
package/button/button.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import clsx from 'clsx';
2
- import React, { Children, cloneElement, forwardRef, useCallback } from 'react';
3
+ import { Children, cloneElement, forwardRef, useCallback } from 'react';
3
4
  import { Icon, Spinner } from '../';
4
5
  import { Button as ButtonClass, SpinnerIndicator, ButtonsGroup as ButtonsGroupClass } from './button.module.css';
5
6
  export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', className, children, fullWidth, icon, disabled, iconPosition = 'left', iconColor, type = 'button', pressed, onClick, busy, as: Wrapper = 'button', ...otherProps }, forwardedRef) => {
@@ -14,13 +15,9 @@ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', cla
14
15
  regular: 16,
15
16
  small: 16
16
17
  };
17
- return (React.createElement(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(ButtonClass, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": busy ? 'polite' : undefined, onClick: handleClick(), ...otherProps },
18
- icon && (React.createElement(Icon, { name: icon, fill: iconColor, dimension: iconSize[dimension] })),
19
- (children && busy) ? React.createElement("span", null, children) : children,
20
- busy && (React.createElement("span", { className: SpinnerIndicator },
21
- React.createElement(Spinner, { dimension: dimension })))));
18
+ return (_jsxs(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(ButtonClass, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": busy ? 'polite' : undefined, onClick: handleClick(), ...otherProps, children: [icon && (_jsx(Icon, { name: icon, fill: iconColor, dimension: iconSize[dimension] }, void 0)), (children && busy) ? _jsx("span", { children: children }, void 0) : children, busy && (_jsx("span", { className: SpinnerIndicator, children: _jsx(Spinner, { dimension: dimension }, void 0) }, void 0))] }, void 0));
22
19
  });
23
- export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (React.createElement("div", { className: clsx(ButtonsGroupClass, className) }, Children.map(children, (child) => cloneElement(child, {
24
- kind,
25
- dimension
26
- }))));
20
+ export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (_jsx("div", { className: clsx(ButtonsGroupClass, className), children: Children.map(children, (child) => cloneElement(child, {
21
+ kind,
22
+ dimension
23
+ })) }, void 0));
@@ -1 +1 @@
1
- .Button{-webkit-touch-callout:none;grid-gap:.44rem;align-items:center;-webkit-appearance:none;appearance:none;background:none;border:0;border-radius:.22rem;box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:inherit;font-weight:600;justify-content:center;margin:0;min-inline-size:min-content;overflow:hidden;position:relative;text-decoration:none;-webkit-user-select:none;user-select:none;white-space:nowrap}.Button[data-button-dimension=big]{block-size:2.67rem;font-size:1rem;padding:.55rem 1.33rem .66rem}.Button[data-button-dimension=regular]{block-size:2.22rem;font-size:.89rem;padding:.33rem .89rem .44rem}.Button[data-button-dimension=small]{grid-gap:.22rem;block-size:1.33rem;font-size:.78rem;padding:0 .22rem .11rem}.Button[data-button-kind=primary]{background:var(--cta-default);color:var(--cta-foreground)}.Button[data-button-kind=primary]:not([aria-pressed=true],[aria-disabled=true]):is(:active){background:var(--cta-dark)}.Button[data-button-kind=primary]:where([aria-pressed=true]),.Button[data-button-kind=primary]:where([aria-pressed=true]:active){background:#9e0018;color:#fff}.Button[data-button-kind=secondary]{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background));color:var(--global-vibrancy-foreground)}.Button[data-button-kind=secondary]:not([aria-pressed=true],[aria-disabled=true]):is(:active){background:linear-gradient(to bottom,var(--global-vibrancy-background-hover),var(--global-vibrancy-background-hover));color:var(--global-vibrancy-foreground)}.Button[data-button-kind=secondary]:where([aria-pressed=true]),.Button[data-button-kind=secondary]:where([aria-pressed=true]:active){background:var(--dimmed-7);color:var(--dimmed-0)}.Button[data-button-kind=flat]{color:var(--global-vibrancy-foreground)}.Button[data-button-kind=flat]:not([aria-pressed=true],[aria-disabled=true]):is(:active){background:linear-gradient(to bottom,var(--global-vibrancy-background-hover),var(--global-vibrancy-background-hover))}.Button[data-button-kind=flat]:is(:hover,:focus){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background));color:var(--global-vibrancy-foreground)}.Button[data-button-kind=flat]:where([aria-pressed=true]),.Button[data-button-kind=flat]:where([aria-pressed=true]:is(:active,:focus)){background:var(--dimmed-7);color:var(--dimmed-0)}.Button[data-button-fullwidth=true]{inline-size:100%}.Button[data-button-icon-position=right]{flex-direction:row-reverse}.Button[aria-disabled=true],.Button[aria-disabled=true]:is(:hover,:focus,:active){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-disabled-background),var(--global-disabled-background));color:var(--global-disabled-foreground);cursor:not-allowed}.Button[aria-busy=true]>:not(.SpinnerIndicator){visibility:hidden}.SpinnerIndicator{align-content:center;bottom:0;display:grid;justify-content:center;left:0;place-content:center;position:absolute;right:0;top:0}.ButtonsGroup{display:inline-flex}.ButtonsGroup>:not(:first-child,:last-child,:only-of-type){border-radius:0}.ButtonsGroup>:first-child:not(:only-of-type){border-bottom-right-radius:0;border-top-right-radius:0;box-shadow:inset -1px 0 0 #6666661a}.ButtonsGroup>:last-child:not(:only-of-type){border-bottom-left-radius:0;border-top-left-radius:0;box-shadow:inset 1px 0 0 #6666661a}
1
+ .Button{-webkit-touch-callout:none;grid-gap:.44rem;align-items:center;-webkit-appearance:none;appearance:none;background:none;border:0;border-radius:.22rem;box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:inherit;font-weight:600;justify-content:center;margin:0;min-inline-size:min-content;overflow:hidden;position:relative;text-decoration:none;-webkit-user-select:none;user-select:none;white-space:nowrap}.Button[data-button-dimension=big]{block-size:2.67rem;font-size:1rem;padding:.55rem 1.33rem .66rem}.Button[data-button-dimension=regular]{block-size:2.22rem;font-size:.89rem;padding:.33rem .89rem .44rem}.Button[data-button-dimension=small]{grid-gap:.22rem;block-size:1.33rem;font-size:.78rem;padding:0 .22rem .11rem}.Button[data-button-kind=primary]{background:var(--cta-default);color:var(--cta-foreground)}.Button[data-button-kind=primary]:not([aria-pressed=true],[aria-disabled=true]):is(:active){background:var(--cta-dark)}.Button[data-button-kind=primary]:where([aria-pressed=true]),.Button[data-button-kind=primary]:where([aria-pressed=true]:active){background:#9e0018;color:#fff}.Button[data-button-kind=secondary]{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);color:var(--global-vibrancy-foreground)}.Button[data-button-kind=secondary]:not([aria-pressed=true],[aria-disabled=true]):is(:active){background-color:var(--global-vibrancy-background-hover);color:var(--global-vibrancy-foreground)}.Button[data-button-kind=secondary]:where([aria-pressed=true]),.Button[data-button-kind=secondary]:where([aria-pressed=true]:active){background:var(--dimmed-7);color:var(--dimmed-0)}.Button[data-button-kind=flat]{color:var(--global-vibrancy-foreground)}.Button[data-button-kind=flat]:not([aria-pressed=true],[aria-disabled=true]):is(:active){background-color:var(--global-vibrancy-background-hover)}.Button[data-button-kind=flat]:is(:hover,:focus){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background);color:var(--global-vibrancy-foreground)}.Button[data-button-kind=flat]:where([aria-pressed=true]),.Button[data-button-kind=flat]:where([aria-pressed=true]:is(:active,:focus)){background:var(--dimmed-7);color:var(--dimmed-0)}.Button[data-button-fullwidth=true]{inline-size:100%}.Button[data-button-icon-position=right]{flex-direction:row-reverse}.Button[aria-disabled=true],.Button[aria-disabled=true]:is(:hover,:focus,:active){background-color:var(--global-disabled-background);color:var(--global-disabled-foreground);cursor:not-allowed}.Button[aria-busy=true]>:not(.SpinnerIndicator){visibility:hidden}.SpinnerIndicator{align-content:center;bottom:0;display:grid;justify-content:center;left:0;place-content:center;position:absolute;right:0;top:0}.ButtonsGroup{display:inline-flex}.ButtonsGroup>:not(:first-child,:last-child,:only-of-type){border-radius:0}.ButtonsGroup>:first-child:not(:only-of-type){border-bottom-right-radius:0;border-top-right-radius:0;box-shadow:inset -1px 0 0 #6666661a}.ButtonsGroup>:last-child:not(:only-of-type){border-bottom-left-radius:0;border-top-left-radius:0;box-shadow:inset 1px 0 0 #6666661a}
package/card/card.d.ts CHANGED
@@ -2,13 +2,37 @@ import { ReactNode } from 'react';
2
2
  import { StackProps, Polymorphic } from '../';
3
3
  import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
4
4
  export declare type CardProps = Pick<StackProps, 'wrap' | 'columnGap' | 'rowGap' | 'verticalAlign' | 'horizontalAlign'> & {
5
+ /**
6
+ * Set the padding on each side of the card.
7
+ */
5
8
  padding?: false | TokensTypes['space'];
9
+ /**
10
+ * Content rendered inside the card on the left side, before children.
11
+ */
6
12
  left?: ReactNode;
13
+ /**
14
+ * Content rendered inside the card on the right side, after children.
15
+ */
7
16
  right?: ReactNode;
17
+ /**
18
+ * Add a border to the card to increase its visual weight and contrast.
19
+ */
8
20
  bordered?: boolean;
21
+ /**
22
+ * Define the edge radius of the card.
23
+ */
9
24
  radius?: false | TokensTypes['radius'];
25
+ /**
26
+ * Change the background color of the card.
27
+ */
10
28
  dimmed?: 1 | 2 | 3;
29
+ /**
30
+ * Make the card vibrant. Add tranlucent background.
31
+ */
11
32
  vibrant?: boolean;
33
+ /**
34
+ * Make the card vibrant. Add tranlucent background.
35
+ */
12
36
  highlightOnHover?: boolean;
13
37
  };
14
38
  declare type PolymorphicCard = Polymorphic.ForwardRefComponent<'div', CardProps>;
package/card/card.js CHANGED
@@ -1,4 +1,5 @@
1
- import React, { forwardRef } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
2
3
  import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
3
4
  import { Stack } from '../';
4
5
  import clsx from 'clsx';
@@ -8,9 +9,5 @@ export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padd
8
9
  '--padding': padding && tkns.space[padding],
9
10
  '--radius': radius && tkns.radius[radius]
10
11
  };
11
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(CardClass, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...otherProps },
12
- React.createElement(Stack, { direction: "row", fill: false, verticalAlign: verticalAlign, horizontalAlign: horizontalAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap },
13
- left && React.createElement("div", { className: Left }, left),
14
- children && (React.createElement("div", { className: Content }, children)),
15
- right && (React.createElement(Stack, { className: Right }, right)))));
12
+ return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(CardClass, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...otherProps, children: _jsxs(Stack, { direction: "row", fill: false, verticalAlign: verticalAlign, horizontalAlign: horizontalAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap, children: [left && _jsx("div", { className: Left, children: left }, void 0), children && (_jsx("div", { className: Content, children: children }, void 0)), right && (_jsx(Stack, { className: Right, children: right }, void 0))] }, void 0) }, void 0));
16
13
  });
@@ -1 +1 @@
1
- :where(.Card){background:var(--global-background);border-radius:var(--radius);padding:var(--padding);position:relative}:where(.Card)[data-card-dimmed="1"]{background:var(--dimmed-0)}:where(.Card)[data-card-dimmed="2"]{background:var(--dimmed-1)}:where(.Card)[data-card-dimmed="3"]{background:var(--dimmed-2)}:where(.Card)[data-card-vibrant=true]{-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background:linear-gradient(to bottom,var(--global-vibrancy-background),var(--global-vibrancy-background))}:where(.Card)[data-card-highlight-hover=true][data-card-vibrant=true].focus-visible,:where(.Card)[data-card-highlight-hover=true][data-card-vibrant=true]:hover{background:linear-gradient(to bottom,var(--global-vibrancy-background-hover),var(--global-vibrancy-background-hover))}:where(.Card)[data-card-highlight-hover=true][data-card-vibrant=true]:focus-visible,:where(.Card)[data-card-highlight-hover=true][data-card-vibrant=true]:hover{background:linear-gradient(to bottom,var(--global-vibrancy-background-hover),var(--global-vibrancy-background-hover))}:where(.Card)[data-card-bordered=true]{border:1px solid var(--dimmed-1)}:where(.Card)[data-card-vibrant=true][data-card-bordered=true]{border:1px solid var(--dimmed-2)}.Left{flex-shrink:0}.Content{flex-grow:1}.Right{flex-shrink:0}
1
+ :where(.Card){background:var(--global-background);border-radius:var(--radius);padding:var(--padding);position:relative}[data-card-dimmed="1"]:where(.Card){background:var(--dimmed-0)}[data-card-dimmed="2"]:where(.Card){background:var(--dimmed-1)}[data-card-dimmed="3"]:where(.Card){background:var(--dimmed-2)}[data-card-vibrant=true]:where(.Card){-webkit-backdrop-filter:saturate(180%) blur(62px);backdrop-filter:saturate(180%) blur(62px);background-color:var(--global-vibrancy-background)}[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card).focus-visible,[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card):hover{background-color:var(--global-vibrancy-background-hover)}[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card):focus-visible,[data-card-highlight-hover=true][data-card-vibrant=true]:where(.Card):hover{background-color:var(--global-vibrancy-background-hover)}[data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-1)}[data-card-vibrant=true][data-card-bordered=true]:where(.Card){border:1px solid var(--dimmed-2)}.Left{flex-shrink:0}.Content{flex-grow:1}.Right{flex-shrink:0}
package/chip/chip.d.ts CHANGED
@@ -1,15 +1,39 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  export declare type ChipProps = PropsWithChildren<PropsWithClass> & {
3
+ /**
4
+ * Set the dimension of the component.
5
+ */
3
6
  dimension?: 'small' | 'regular' | 'big';
7
+ /**
8
+ * Set a color from one of the provided values.
9
+ */
4
10
  color?: 'gray' | 'cyan' | 'green' | 'purple' | 'yellow' | 'red' | 'blue';
11
+ /**
12
+ * Make the chip dismissable. When `true` adds a close button on the side.
13
+ */
5
14
  interactive?: boolean;
15
+ /**
16
+ * Callback function to be called when the dismiss button is pressed.
17
+ */
6
18
  onDismissClick?(): void;
7
19
  };
8
- export declare const Chip: React.ForwardRefExoticComponent<PropsWithClass & {
9
- children?: React.ReactNode;
20
+ export declare const Chip: import("react").ForwardRefExoticComponent<PropsWithClass & {
21
+ children?: import("react").ReactNode;
10
22
  } & {
23
+ /**
24
+ * Set the dimension of the component.
25
+ */
11
26
  dimension?: "big" | "small" | "regular" | undefined;
27
+ /**
28
+ * Set a color from one of the provided values.
29
+ */
12
30
  color?: "gray" | "cyan" | "green" | "purple" | "yellow" | "red" | "blue" | undefined;
31
+ /**
32
+ * Make the chip dismissable. When `true` adds a close button on the side.
33
+ */
13
34
  interactive?: boolean | undefined;
35
+ /**
36
+ * Callback function to be called when the dismiss button is pressed.
37
+ */
14
38
  onDismissClick?(): void;
15
- } & React.RefAttributes<HTMLSpanElement>>;
39
+ } & import("react").RefAttributes<HTMLSpanElement>>;
package/chip/chip.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import clsx from 'clsx';
2
- import React, { forwardRef } from 'react';
3
+ import { forwardRef } from 'react';
3
4
  import { Icon, Stack } from '../';
4
5
  import { Chip as ChipClass, Action } from './chip.module.css';
5
6
  export const Chip = forwardRef(({ children, className, dimension = 'regular', color = 'gray', interactive, onDismissClick, ...otherProps }, forwardedRef) => {
@@ -14,9 +15,6 @@ export const Chip = forwardRef(({ children, className, dimension = 'regular', co
14
15
  iconSize: 16
15
16
  }
16
17
  };
17
- return (React.createElement(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...otherProps },
18
- React.createElement("b", null, children),
19
- interactive && (React.createElement("button", { onClick: interactive && onDismissClick, className: Action, type: "button" },
20
- React.createElement(Icon, { name: "xmark", dimension: properties[dimension].iconSize })))));
18
+ return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...otherProps, children: [_jsx("b", { children: children }, void 0), interactive && (_jsx("button", { onClick: interactive && onDismissClick, className: Action, type: "button", children: _jsx(Icon, { name: "xmark", dimension: properties[dimension].iconSize }, void 0) }, void 0))] }, void 0));
21
19
  });
22
20
  Chip.displayName = 'Chip';
@@ -1,13 +1,43 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export declare type CircularProgressProps = PropsWithClass & {
3
+ /**
4
+ * Set the current progress of the progress bar.
5
+ * This value should be between 0 and 'max'. The percentage is
6
+ * automatically computed.
7
+ */
3
8
  value: number;
9
+ /**
10
+ * Set the max value of the progress bar. This determines the
11
+ * computed percentage.
12
+ */
4
13
  max?: number;
14
+ /**
15
+ * Set the dimension of the progress bar.
16
+ */
5
17
  dimension?: 'small' | 'regular' | 'big';
18
+ /**
19
+ * Show or hide the progress value.
20
+ */
6
21
  showProgress?: boolean;
7
22
  };
8
- export declare const CircularProgress: React.ForwardRefExoticComponent<PropsWithClass & {
23
+ export declare const CircularProgress: import("react").ForwardRefExoticComponent<PropsWithClass & {
24
+ /**
25
+ * Set the current progress of the progress bar.
26
+ * This value should be between 0 and 'max'. The percentage is
27
+ * automatically computed.
28
+ */
9
29
  value: number;
30
+ /**
31
+ * Set the max value of the progress bar. This determines the
32
+ * computed percentage.
33
+ */
10
34
  max?: number | undefined;
35
+ /**
36
+ * Set the dimension of the progress bar.
37
+ */
11
38
  dimension?: "big" | "small" | "regular" | undefined;
39
+ /**
40
+ * Show or hide the progress value.
41
+ */
12
42
  showProgress?: boolean | undefined;
13
- } & React.RefAttributes<HTMLDivElement>>;
43
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,5 @@
1
- import React, { forwardRef, useCallback } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useCallback } from 'react';
2
3
  import clsx from 'clsx';
3
4
  import { CircularProgress as CircularProgressClass } from './circular-progress.module.css';
4
5
  export const CircularProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, style, ...otherProps }, forwardedRef) => {
@@ -7,6 +8,6 @@ export const CircularProgress = forwardRef(({ className, value, max = 100, dimen
7
8
  const dynamicStyle = {
8
9
  '--progress': `${getPercentage()}%`
9
10
  };
10
- return (React.createElement("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...otherProps }));
11
+ return (_jsx("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...otherProps }, void 0));
11
12
  });
12
13
  CircularProgress.displayName = 'CircularProgress';
@@ -1,7 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Polymorphic } from '../';
3
3
  export declare type ClampTextProps = {
4
+ /**
5
+ * The text content to be displayed and clamped
6
+ */
4
7
  children: ReactNode;
8
+ /**
9
+ * Define how many lines the text should be clamped to.
10
+ */
5
11
  rows?: number;
6
12
  };
7
13
  declare type PolymorphicClampText = Polymorphic.ForwardRefComponent<'span', ClampTextProps>;
@@ -1,9 +1,10 @@
1
- import React, { forwardRef } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
2
3
  import clsx from 'clsx';
3
4
  import { ClampText as ClampTextClass } from './clamp-text.module.css';
4
5
  export const ClampText = forwardRef(({ className, children, rows = 1, style, as: Wrapper = 'span', ...otherProps }, forwardedRef) => {
5
6
  const dynamicStyle = {
6
7
  '--r': rows
7
8
  };
8
- return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...otherProps }, children));
9
+ return (_jsx(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...otherProps, children: children }, void 0));
9
10
  });
@@ -1,6 +1,12 @@
1
1
  import { Polymorphic } from '../';
2
2
  export declare type ContainerProps = {
3
+ /**
4
+ * Set the horizontal max-width of the container.
5
+ */
3
6
  dimension?: 'full' | 'medium' | 'large';
7
+ /**
8
+ * Set or remove the container's predefined horizontal padding.
9
+ */
4
10
  padding?: boolean;
5
11
  };
6
12
  declare type PolymorphicContainer = Polymorphic.ForwardRefComponent<'div', ContainerProps>;
@@ -1,6 +1,7 @@
1
- import React, { forwardRef } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
2
3
  import { Container as ContainerClass } from './container.module.css';
3
4
  import clsx from 'clsx';
4
5
  export const Container = forwardRef(({ children, className, dimension = 'full', padding = true, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
5
- return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...otherProps }, children));
6
+ return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...otherProps, children: children }, void 0));
6
7
  });
@@ -1 +1 @@
1
- :where(p){font-size:1rem;line-height:1.5;min-block-size:.01vh}small{font-size:.7em}b,strong{font-weight:600}:where(a:any-link){background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:0 1px;color:var(--global-interactive-text);text-decoration:none;transition:background-size .2s cubic-bezier(0,0,.34,1);word-break:break-word}:where(a:any-link):focus,:where(a:any-link):hover{background-size:100% 1px}del{background-color:var(--highlight-red-background);box-shadow:0 0 0 2px var(--highlight-red-background);color:var(--highlight-red-foreground)}del,ins{border-radius:.22rem;padding:2px 4px}ins{background-color:var(--highlight-green-background);box-shadow:0 0 0 2px var(--highlight-green-background);color:var(--highlight-green-foreground);text-decoration:none}address{font-style:normal;line-height:inherit}dt{font-weight:600}dd{margin:0;padding:0}ol,ul{padding-left:1rem}ul li::marker{font-size:inherit;font-weight:600;min-inline-size:1.78rem;text-align:right}ol li::marker{font-feature-settings:"tnum";font-size:inherit;font-variant-numeric:tabular-nums;font-weight:600;min-inline-size:1.78rem;white-space:nowrap}kbd{border:1px solid var(--dimmed-1);border-radius:.22rem;box-shadow:0 2px 0 var(--dimmed-1);font-weight:600;padding:2px 4px}mark{background:var(--highlight-yellow-background);color:var(--highlight-yellow-foreground);padding:0 2px}abbr{text-decoration:underline dashed var(--cta-default)}label,legend{font-size:inherit}code{border-radius:.22rem;color:var(--highlight-red-foreground);font-family:monospace;font-size:1em;padding:2px 4px}
1
+ :where(p){font-size:.89rem;line-height:1.5;min-block-size:.01vh}small{font-size:.7em}b,strong{font-weight:600}:where(a:any-link){background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:0 1px;color:var(--global-interactive-text);text-decoration:none;transition:background-size .2s cubic-bezier(0,0,.34,1);word-break:break-word}:where(a:any-link):focus,:where(a:any-link):hover{background-size:100% 1px}del{background-color:var(--highlight-red-background);box-shadow:0 0 0 2px var(--highlight-red-background);color:var(--highlight-red-foreground)}del,ins{border-radius:.22rem;padding:2px 4px}ins{background-color:var(--highlight-green-background);box-shadow:0 0 0 2px var(--highlight-green-background);color:var(--highlight-green-foreground);text-decoration:none}address{font-style:normal;line-height:inherit}dt{font-weight:600}dd{margin:0;padding:0}ol,ul{padding-left:1rem}ul li::marker{font-size:inherit;font-weight:600;min-inline-size:1.78rem;text-align:right}ol li::marker{font-feature-settings:"tnum";font-size:inherit;font-variant-numeric:tabular-nums;font-weight:600;min-inline-size:1.78rem;white-space:nowrap}kbd{border:1px solid var(--dimmed-1);border-radius:.22rem;box-shadow:0 2px 0 var(--dimmed-1);font-weight:600;padding:2px 4px}mark{background:var(--highlight-yellow-background);color:var(--highlight-yellow-foreground);padding:0 2px}abbr{text-decoration:underline dashed var(--cta-default)}label,legend{font-size:inherit}code{background-color:var(--highlight-gray-background);border-radius:.22rem;font-family:monospace;font-size:1em;padding:0 4px 3px;vertical-align:top}
@@ -27,4 +27,22 @@
27
27
 
28
28
  /* Motion Media Queries */
29
29
 
30
- @custom-media --allow-motion (prefers-reduced-motion: no-preference);
30
+ @custom-media --motion (prefers-reduced-motion: no-preference);
31
+ @custom-media --reduced-motion (prefers-reduced-motion: reduce);
32
+
33
+ /* Opacity Media Queries */
34
+
35
+ @custom-media --opacity (prefers-reduced-transparency: no-preference);
36
+ @custom-media --reduce-opacity (prefers-reduced-transparency: reduce);
37
+
38
+ /* Contrast Media Queries */
39
+
40
+ @custom-media --high-contrast (prefers-contrast: high);
41
+ @custom-media --low-contrast (prefers-contrast: low);
42
+
43
+ /* Pointer Media Queries */
44
+
45
+ @custom-media --touch (hover: none) and (pointer: coarse);
46
+ @custom-media --stylus (hover: none) and (pointer: fine);
47
+ @custom-media --pointer (hover) and (pointer: coarse);
48
+ @custom-media --mouse (hover) and (pointer: fine);
@@ -1,27 +1,3 @@
1
1
  @define-mixin vibrancy {
2
2
  backdrop-filter: saturate(180%) blur(62px);
3
- background:
4
- linear-gradient(
5
- to bottom,
6
- var(--global-vibrancy-background),
7
- var(--global-vibrancy-background)
8
- );
9
- }
10
- @define-mixin vibrancy-hover {
11
- background:
12
- linear-gradient(
13
- to bottom,
14
- var(--global-vibrancy-background-hover),
15
- var(--global-vibrancy-background-hover)
16
- );
17
- }
18
- @define-mixin vibrancy-disabled {
19
- color: var(--global-disabled-foreground);
20
- backdrop-filter: saturate(180%) blur(62px);
21
- background:
22
- linear-gradient(
23
- to bottom,
24
- var(--global-disabled-background),
25
- var(--global-disabled-background)
26
- );
27
3
  }