@algolia/satellite 1.5.0 → 1.7.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 (96) hide show
  1. package/dist/cjs/Actions/Accordion/Accordion.d.ts +142 -0
  2. package/dist/cjs/Actions/Accordion/Accordion.js +149 -0
  3. package/dist/cjs/Actions/Accordion/Accordion.tailwind.d.ts +5 -0
  4. package/dist/cjs/Actions/Accordion/Accordion.tailwind.js +44 -0
  5. package/dist/cjs/Actions/Button/Button.tailwind.js +0 -12
  6. package/dist/cjs/Actions/ToggleGroup/ToggleGroup.d.ts +2 -2
  7. package/dist/cjs/Actions/index.d.ts +2 -0
  8. package/dist/cjs/Actions/index.js +18 -0
  9. package/dist/cjs/Fields/Field/Field.js +2 -2
  10. package/dist/cjs/Fields/Form/Form.d.ts +12 -10
  11. package/dist/cjs/Fields/Form/Form.js +50 -38
  12. package/dist/cjs/Fields/Form/FormContext.d.ts +6 -6
  13. package/dist/cjs/Fields/Form/FormContext.js +2 -2
  14. package/dist/cjs/Fields/Form/index.d.ts +4 -3
  15. package/dist/cjs/Fields/Form/index.js +31 -21
  16. package/dist/cjs/Fields/Form/stories/AsynchronousValidation.js +142 -127
  17. package/dist/cjs/Fields/Form/stories/Complex.js +648 -642
  18. package/dist/cjs/Fields/Form/stories/DependentFieldsValidation.js +127 -121
  19. package/dist/cjs/Fields/Form/stories/DirtyFields.js +195 -189
  20. package/dist/cjs/Fields/Form/stories/DynamicFieldsValidation.js +251 -245
  21. package/dist/cjs/Fields/Form/stories/ExtraErrors.js +289 -0
  22. package/dist/cjs/Fields/Form/stories/FieldArrays.js +180 -174
  23. package/dist/cjs/Fields/Form/stories/JSONForms.js +59 -56
  24. package/dist/cjs/Fields/Form/stories/MultiStep.js +706 -0
  25. package/dist/cjs/Fields/Form/stories/ValidationStrategies.js +243 -237
  26. package/dist/cjs/Fields/Form/useForm.d.ts +1 -1
  27. package/dist/cjs/Fields/Form/useForm.js +3 -3
  28. package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
  29. package/dist/cjs/Icons/index.d.ts +1 -1
  30. package/dist/cjs/Icons/index.js +6 -0
  31. package/dist/cjs/Indicators/Skeleton/Skeleton.d.ts +7 -0
  32. package/dist/cjs/Indicators/Skeleton/Skeleton.js +12 -5
  33. package/dist/cjs/Indicators/index.d.ts +1 -0
  34. package/dist/cjs/Indicators/index.js +11 -0
  35. package/dist/cjs/Layout/Sidebar/SidebarButtonLink.js +1 -1
  36. package/dist/cjs/Layout/Sidebar/SidebarLink.js +2 -2
  37. package/dist/cjs/Layout/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +1 -1
  38. package/dist/cjs/Layout/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +4 -5
  39. package/dist/cjs/Layout/Tables/DataTable/DataTable.d.ts +3 -1
  40. package/dist/cjs/Layout/Tables/DataTable/DataTable.js +3 -0
  41. package/dist/cjs/Layout/Tables/Table/Table.d.ts +2 -0
  42. package/dist/cjs/Layout/Tables/Table/Table.js +4 -2
  43. package/dist/cjs/Layout/Tables/Table/Table.tailwind.js +6 -1
  44. package/dist/cjs/Overlay/MenuButton/components/items/LinkItem.d.ts +1 -1
  45. package/dist/cjs/Overlay/MenuButton/components/items/ToggleItem.d.ts +1 -1
  46. package/dist/cjs/styles/tailwind.config.js +1 -1
  47. package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
  48. package/dist/esm/Actions/Accordion/Accordion.d.ts +142 -0
  49. package/dist/esm/Actions/Accordion/Accordion.js +139 -0
  50. package/dist/esm/Actions/Accordion/Accordion.tailwind.d.ts +5 -0
  51. package/dist/esm/Actions/Accordion/Accordion.tailwind.js +43 -0
  52. package/dist/esm/Actions/Button/Button.tailwind.js +0 -12
  53. package/dist/esm/Actions/ToggleGroup/ToggleGroup.d.ts +2 -2
  54. package/dist/esm/Actions/index.d.ts +2 -0
  55. package/dist/esm/Actions/index.js +2 -2
  56. package/dist/esm/Fields/Field/Field.js +3 -3
  57. package/dist/esm/Fields/Form/Form.d.ts +12 -10
  58. package/dist/esm/Fields/Form/Form.js +52 -40
  59. package/dist/esm/Fields/Form/FormContext.d.ts +6 -6
  60. package/dist/esm/Fields/Form/FormContext.js +1 -1
  61. package/dist/esm/Fields/Form/index.d.ts +4 -3
  62. package/dist/esm/Fields/Form/index.js +2 -3
  63. package/dist/esm/Fields/Form/stories/AsynchronousValidation.js +143 -128
  64. package/dist/esm/Fields/Form/stories/Complex.js +649 -643
  65. package/dist/esm/Fields/Form/stories/DependentFieldsValidation.js +128 -122
  66. package/dist/esm/Fields/Form/stories/DirtyFields.js +196 -190
  67. package/dist/esm/Fields/Form/stories/DynamicFieldsValidation.js +252 -246
  68. package/dist/esm/Fields/Form/stories/ExtraErrors.js +279 -0
  69. package/dist/esm/Fields/Form/stories/FieldArrays.js +181 -175
  70. package/dist/esm/Fields/Form/stories/JSONForms.js +60 -57
  71. package/dist/esm/Fields/Form/stories/MultiStep.js +697 -0
  72. package/dist/esm/Fields/Form/stories/ValidationStrategies.js +244 -238
  73. package/dist/esm/Fields/Form/useForm.d.ts +1 -1
  74. package/dist/esm/Fields/Form/useForm.js +3 -3
  75. package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
  76. package/dist/esm/Icons/index.d.ts +1 -1
  77. package/dist/esm/Icons/index.js +1 -1
  78. package/dist/esm/Indicators/Skeleton/Skeleton.d.ts +7 -0
  79. package/dist/esm/Indicators/Skeleton/Skeleton.js +12 -5
  80. package/dist/esm/Indicators/index.d.ts +1 -0
  81. package/dist/esm/Indicators/index.js +2 -1
  82. package/dist/esm/Layout/Sidebar/SidebarButtonLink.js +1 -1
  83. package/dist/esm/Layout/Sidebar/SidebarLink.js +2 -2
  84. package/dist/esm/Layout/Sidebar/SidebarLinksGroup/SidebarGroupLink.js +1 -1
  85. package/dist/esm/Layout/Sidebar/SidebarLinksGroup/SidebarLinksGroup.js +4 -5
  86. package/dist/esm/Layout/Tables/DataTable/DataTable.d.ts +3 -1
  87. package/dist/esm/Layout/Tables/DataTable/DataTable.js +3 -0
  88. package/dist/esm/Layout/Tables/Table/Table.d.ts +2 -0
  89. package/dist/esm/Layout/Tables/Table/Table.js +4 -2
  90. package/dist/esm/Layout/Tables/Table/Table.tailwind.js +6 -1
  91. package/dist/esm/Overlay/MenuButton/components/items/LinkItem.d.ts +1 -1
  92. package/dist/esm/Overlay/MenuButton/components/items/ToggleItem.d.ts +1 -1
  93. package/dist/esm/styles/tailwind.config.js +1 -1
  94. package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
  95. package/dist/satellite.min.css +1 -1
  96. package/package.json +7 -1
@@ -0,0 +1,142 @@
1
+ import * as RadixAccordion from "@radix-ui/react-accordion";
2
+ import type { ReactNode, VFC } from "react";
3
+ import type { IconComponentType } from "../../Icons";
4
+ declare type AccordionSharedProps = {
5
+ children: ReactNode;
6
+ /**
7
+ * Defines a class name for the `Accordion`.
8
+ */
9
+ className?: string;
10
+ /**
11
+ * Defines whether the `Accordion` is disabled, preventing the user from interacting with the accordion and all its items.
12
+ */
13
+ disabled?: boolean;
14
+ };
15
+ declare type AccordionSingleProps = {
16
+ /**
17
+ * Defines whether a single or multiple items can be expanded at a time.
18
+ * @default false
19
+ */
20
+ multiple?: false;
21
+ /**
22
+ * Defines the controlled value of the item to expand when `multiple` is `false`.
23
+ * Must be used in conjunction with `onValueChange`.
24
+ */
25
+ value?: RadixAccordion.AccordionSingleProps["value"];
26
+ /**
27
+ * Defines the value of the item to expand when initially rendered and `multiple` is `false`.
28
+ * Use when you do not need to control the state of the items.
29
+ */
30
+ defaultValue?: RadixAccordion.AccordionSingleProps["defaultValue"];
31
+ /**
32
+ * Defines the event handler called when the expanded state of an item changes and `multiple` is `false`.
33
+ */
34
+ onChange?: RadixAccordion.AccordionSingleProps["onValueChange"];
35
+ /**
36
+ * Allows closing content when clicking trigger for an open item when `multiple` is `false`.
37
+ * @default true
38
+ */
39
+ collapsible?: boolean;
40
+ };
41
+ declare type AccordionMultipleProps = {
42
+ /**
43
+ * Defines whether a single or multiple items can be expanded at a time.
44
+ * @default false
45
+ */
46
+ multiple: true;
47
+ /**
48
+ * Defines the controlled value of the item to expand when `multiple` is `true`.
49
+ * Must be used in conjunction with `onValueChange`.
50
+ */
51
+ value?: RadixAccordion.AccordionMultipleProps["value"];
52
+ /**
53
+ * Defines the value of the item to expand when initially rendered when `multiple` is `true`.
54
+ * Use when you do not need to control the state of the items.
55
+ */
56
+ defaultValue?: RadixAccordion.AccordionMultipleProps["defaultValue"];
57
+ /**
58
+ * Defines the event handler called when the expanded state of an item changes and `multiple` is `true`.
59
+ */
60
+ onChange?: RadixAccordion.AccordionMultipleProps["onValueChange"];
61
+ /**
62
+ * Only available when `multiple` is `false`.
63
+ */
64
+ collapsible?: never;
65
+ };
66
+ export declare type AccordionProps = AccordionSharedProps & (AccordionSingleProps | AccordionMultipleProps);
67
+ export declare type AccordionItemProps = {
68
+ children: ReactNode;
69
+ /**
70
+ * Defines a class name for the item.
71
+ */
72
+ className?: string;
73
+ /**
74
+ * Defines a unique value for the item.
75
+ */
76
+ value: string;
77
+ /**
78
+ * Defines whether the item is disabled, preventing the user from interacting with the item.
79
+ */
80
+ disabled?: boolean;
81
+ };
82
+ export declare type AccordionHeaderProps = {
83
+ /**
84
+ * Defines the title of the header.
85
+ */
86
+ children: ReactNode;
87
+ /**
88
+ * Defines a class name for the header.
89
+ */
90
+ className?: string;
91
+ /**
92
+ * Defines an icon to display next to the title and description.
93
+ */
94
+ icon?: IconComponentType;
95
+ /**
96
+ * Defines a class name for the icon.
97
+ */
98
+ iconClassName?: string;
99
+ /**
100
+ * Defines a class name for the icon background.
101
+ */
102
+ iconBgClassName?: string;
103
+ /**
104
+ * Defines a description for the header.
105
+ */
106
+ description?: ReactNode;
107
+ /**
108
+ * Defines a meta value for the header.
109
+ */
110
+ meta?: ReactNode;
111
+ /**
112
+ * Defines an icon to display as the trigger.
113
+ * Defaults to a chevron icon.
114
+ */
115
+ triggerIcon?: IconComponentType;
116
+ /**
117
+ * Defines a class name for the trigger.
118
+ */
119
+ triggerClassName?: string;
120
+ };
121
+ export declare type AccordionContentProps = {
122
+ children: ReactNode;
123
+ /**
124
+ * Defines a class name for the content.
125
+ */
126
+ className?: string;
127
+ };
128
+ declare type AccordionComponent = VFC<AccordionProps> & {
129
+ Item: typeof AccordionItem;
130
+ Header: typeof AccordionHeader;
131
+ Content: typeof AccordionContent;
132
+ };
133
+ /**
134
+ * The `Accordion` component is a compact section for revealing and hiding content, ideal for keeping interfaces clean.
135
+ *
136
+ * See the [Accordion documentation page](https://satellite.algolia.com/components/actions/accordion) for more information.
137
+ */
138
+ export declare const Accordion: AccordionComponent;
139
+ declare const AccordionItem: import("react").ForwardRefExoticComponent<AccordionItemProps & import("react").RefAttributes<HTMLDivElement>>;
140
+ declare const AccordionHeader: import("react").ForwardRefExoticComponent<AccordionHeaderProps & import("react").RefAttributes<HTMLButtonElement>>;
141
+ declare const AccordionContent: import("react").ForwardRefExoticComponent<AccordionContentProps & import("react").RefAttributes<HTMLDivElement>>;
142
+ export {};
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Accordion = void 0;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var RadixAccordion = _interopRequireWildcard(require("@radix-ui/react-accordion"));
13
+ var _clsx = _interopRequireDefault(require("clsx"));
14
+ var _react = require("react");
15
+ var _Icons = require("../../Icons");
16
+ var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
19
+ var _excluded = ["children", "className"],
20
+ _excluded2 = ["onChange", "multiple"],
21
+ _excluded3 = ["onChange", "multiple", "collapsible"];
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
24
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
+ var ICON_SIZE = 16;
27
+ var TRIGGER_ICON_SIZE = 20;
28
+
29
+ /**
30
+ * The `Accordion` component is a compact section for revealing and hiding content, ideal for keeping interfaces clean.
31
+ *
32
+ * See the [Accordion documentation page](https://satellite.algolia.com/components/actions/accordion) for more information.
33
+ */
34
+ var Accordion = exports.Accordion = function Accordion(_ref) {
35
+ var children = _ref.children,
36
+ className = _ref.className,
37
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
38
+ var sharedProps = {
39
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex flex-col"]))), className)
40
+ };
41
+ if (props.multiple) {
42
+ var _onChange = props.onChange,
43
+ _multiple = props.multiple,
44
+ _rest = (0, _objectWithoutProperties2["default"])(props, _excluded2);
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Root, _objectSpread(_objectSpread(_objectSpread({}, _rest), sharedProps), {}, {
46
+ type: "multiple",
47
+ onValueChange: _onChange,
48
+ children: children
49
+ }));
50
+ }
51
+ var onChange = props.onChange,
52
+ multiple = props.multiple,
53
+ _props$collapsible = props.collapsible,
54
+ collapsible = _props$collapsible === void 0 ? true : _props$collapsible,
55
+ rest = (0, _objectWithoutProperties2["default"])(props, _excluded3);
56
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Root, _objectSpread(_objectSpread(_objectSpread({}, rest), sharedProps), {}, {
57
+ type: "single",
58
+ onValueChange: onChange,
59
+ collapsible: collapsible,
60
+ children: children
61
+ }));
62
+ };
63
+ Accordion.displayName = "Accordion";
64
+ var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
65
+ var value = _ref2.value,
66
+ disabled = _ref2.disabled,
67
+ children = _ref2.children,
68
+ className = _ref2.className;
69
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Item, {
70
+ value: value,
71
+ disabled: disabled,
72
+ ref: ref,
73
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["group/accordion-item flex flex-col"]))), className),
74
+ children: children
75
+ });
76
+ });
77
+ AccordionItem.displayName = "AccordionItem";
78
+ var AccordionHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
79
+ var children = _ref3.children,
80
+ description = _ref3.description,
81
+ Icon = _ref3.icon,
82
+ _ref3$iconClassName = _ref3.iconClassName,
83
+ iconClassName = _ref3$iconClassName === void 0 ? (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["typo-subdued"]))) : _ref3$iconClassName,
84
+ _ref3$iconBgClassName = _ref3.iconBgClassName,
85
+ iconBgClassName = _ref3$iconBgClassName === void 0 ? (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100"]))) : _ref3$iconBgClassName,
86
+ meta = _ref3.meta,
87
+ triggerIcon = _ref3.triggerIcon,
88
+ triggerClassName = _ref3.triggerClassName,
89
+ className = _ref3.className;
90
+ var TriggerIcon = triggerIcon || _Icons.ChevronDownIcon;
91
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Header, {
92
+ className: className,
93
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(RadixAccordion.Trigger, {
94
+ ref: ref,
95
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["group/accordion-trigger flex gap-x-3 items-center w-full justify-between px-3.5 py-2.5 group-first/accordion-item:rounded-t group-last/accordion-item:rounded-b bg-white border-2 border-transparent focus-visible:outline-none focus-visible:border-accent-600 enabled:hover:bg-grey-50 motion-safe:transition-colors"]))), triggerClassName),
96
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
97
+ className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["flex items-center gap-x-3 grow"]))),
98
+ children: [Icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
99
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["rounded-full w-8 h-8 flex items-center justify-center shrink-0"]))), iconBgClassName),
100
+ "aria-hidden": true,
101
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
102
+ className: (0, _clsx["default"])(iconClassName, (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["group-disabled/accordion-trigger:text-grey-300"])))),
103
+ width: ICON_SIZE,
104
+ height: ICON_SIZE
105
+ })
106
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
107
+ className: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["flex flex-col gap-y-1 text-left grow"]))),
108
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
109
+ className: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["typo-display-heading line-clamp-2 group-disabled/accordion-trigger:text-grey-300"]))),
110
+ children: children
111
+ }), typeof description !== "undefined" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
112
+ className: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["typo-display-body typo-subdued line-clamp-3 group-disabled/accordion-trigger:text-grey-300"]))),
113
+ children: description
114
+ })]
115
+ })]
116
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
117
+ className: (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["flex items-center gap-x-2"]))),
118
+ children: [typeof meta !== "undefined" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
119
+ className: (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["typo-display-caption group-disabled/accordion-trigger:text-grey-300"]))),
120
+ children: meta
121
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(TriggerIcon, {
122
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 typo-subdued group-disabled/accordion-trigger:text-grey-300"]))),
123
+ // Don't rotate the trigger icon if it's a custom one.
124
+ !triggerIcon && (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])([" group-data-[state=open]/accordion-trigger:rotate-180 motion-safe:transition-transform motion-safe:duration-300 motion-safe:ease-out"])))),
125
+ width: TRIGGER_ICON_SIZE,
126
+ height: TRIGGER_ICON_SIZE,
127
+ "aria-hidden": true
128
+ })]
129
+ })]
130
+ })
131
+ });
132
+ });
133
+ AccordionHeader.displayName = "AccordionHeader";
134
+ var AccordionContent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref4, ref) {
135
+ var children = _ref4.children,
136
+ className = _ref4.className;
137
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Content, {
138
+ ref: ref,
139
+ className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["typo-display-body typo-subdued overflow-hidden accordion-content"]))), className),
140
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
141
+ className: (0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["px-4 pt-2 pb-4"]))),
142
+ children: children
143
+ })
144
+ });
145
+ });
146
+ AccordionContent.displayName = "AccordionContent";
147
+ Accordion.Item = AccordionItem;
148
+ Accordion.Header = AccordionHeader;
149
+ Accordion.Content = AccordionContent;
@@ -0,0 +1,5 @@
1
+ export = accordionPlugin;
2
+ declare const accordionPlugin: {
3
+ handler: import("tailwindcss/types/config").PluginCreator;
4
+ config?: Partial<import("tailwindcss/types/config").Config> | undefined;
5
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ // @ts-check
4
+ var plugin = require("tailwindcss/plugin");
5
+ var accordionPlugin = plugin(function (_ref) {
6
+ var addComponents = _ref.addComponents;
7
+ var animationDuration = "300ms";
8
+ var animationEasing = "ease-out";
9
+ addComponents({
10
+ /* eslint-disable @algolia/stl/prefer-stl-helper */
11
+ "@media (prefers-reduced-motion: no-preference)": {
12
+ ".accordion-content": {
13
+ "&[data-state='open']": {
14
+ animation: "stl-accordion-content-slide-down ".concat(animationDuration, " ").concat(animationEasing)
15
+ },
16
+ "&[data-state='closed']": {
17
+ animation: "stl-accordion-content-slide-up ".concat(animationDuration, " ").concat(animationEasing)
18
+ }
19
+ }
20
+ },
21
+ "@keyframes stl-accordion-content-slide-down": {
22
+ from: {
23
+ height: "0",
24
+ opacity: "0"
25
+ },
26
+ to: {
27
+ height: "var(--radix-accordion-content-height)",
28
+ opacity: "1"
29
+ }
30
+ },
31
+ "@keyframes stl-accordion-content-slide-up": {
32
+ from: {
33
+ height: "var(--radix-accordion-content-height)",
34
+ opacity: "1"
35
+ },
36
+ to: {
37
+ height: "0",
38
+ opacity: "0"
39
+ }
40
+ }
41
+ /* eslint-enable @algolia/stl/prefer-stl-helper */
42
+ });
43
+ });
44
+ module.exports = accordionPlugin;
@@ -47,10 +47,6 @@ var buttonPlugin = plugin(function (_ref) {
47
47
  backgroundImage: "linear-gradient(-180deg, ".concat(theme("colors.white"), " 0%, ").concat(theme("colors.grey.100"), " 100%)"),
48
48
  borderColor: theme("colors.grey.200")
49
49
  },
50
- "&:focus": {
51
- backgroundImage: "linear-gradient(-180deg, ".concat(theme("colors.white"), " 0%, ").concat(theme("colors.grey.100"), " 100%)"),
52
- boxShadow: "0 2px 0 1px ".concat(theme("colors.shadow.5"))
53
- },
54
50
  "&:active, &.btn-active": {
55
51
  borderColor: theme("colors.grey.200"),
56
52
  boxShadow: "\n inset 0 1px 4px 0 ".concat(rgba(theme("colors.grey.500"), 0.4), ",\n inset 0 1px 1px 0 ").concat(rgba(theme("colors.grey.500"), 0.4), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
@@ -73,10 +69,6 @@ var buttonPlugin = plugin(function (_ref) {
73
69
  backgroundImage: "linear-gradient(0deg, ".concat(theme("colors.accent.800"), " 0%, ").concat(theme("colors.accent.700"), " 100%)"),
74
70
  boxShadow: "\n inset 0 1px 0 0 ".concat(rgba(theme("colors.white"), 0.06), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.10"), "\n ")
75
71
  },
76
- "&:focus": {
77
- backgroundImage: "linear-gradient(0deg, ".concat(theme("colors.accent.600"), " 0%, ").concat(theme("colors.accent.700"), " 100%)"),
78
- boxShadow: "\n inset 0 1px 0 0 ".concat(rgba(theme("colors.white"), 0.06), ",\n 0 2px 0 1px ").concat(theme("colors.shadow.10"), "\n ")
79
- },
80
72
  "&:active, &.btn-active": {
81
73
  backgroundColor: theme("colors.accent.700"),
82
74
  borderColor: theme("colors.accent.800"),
@@ -100,10 +92,6 @@ var buttonPlugin = plugin(function (_ref) {
100
92
  borderColor: theme("colors.red.800"),
101
93
  boxShadow: "\n inset 0 1px 0 0 ".concat(rgba(theme("colors.white"), 0.06), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.10"), "\n ")
102
94
  },
103
- "&:focus": {
104
- backgroundImage: "linear-gradient(0deg, ".concat(theme("colors.red.600"), " 0%, ").concat(theme("colors.red.700"), " 100%)"),
105
- boxShadow: "\n inset 0 1px 0 0 ".concat(rgba(theme("colors.white"), 0.06), ",\n 0 2px 0 1px ").concat(theme("colors.shadow.10"), "\n ")
106
- },
107
95
  "&:active, &.btn-active": {
108
96
  borderColor: theme("colors.red.800"),
109
97
  boxShadow: "\n inset 0 1px 4px 0 ".concat(rgba(theme("colors.red.900"), 0.4), ",\n inset 0 1px 1px 0 ").concat(rgba(theme("colors.red.900"), 0.6), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
@@ -15,7 +15,7 @@ declare type ToggleGroupSingleProps = {
15
15
  type: "single";
16
16
  /**
17
17
  * Defines the controlled value of the pressed item.
18
- * Must be used in conjunction with `onValueChange`.
18
+ * Must be used in conjunction with `onChange`.
19
19
  */
20
20
  value?: RadixToggleGroupSingleProps["value"];
21
21
  /**
@@ -31,7 +31,7 @@ declare type ToggleGroupMultipleProps = {
31
31
  type: "multiple";
32
32
  /**
33
33
  * Defines the controlled value of the pressed items.
34
- * Must be used in conjunction with `onValueChange`.
34
+ * Must be used in conjunction with `onChange`.
35
35
  */
36
36
  value?: RadixToggleGroupMultipleProps["value"];
37
37
  /**
@@ -1,3 +1,5 @@
1
+ export type { AccordionProps as ExperimentalAccordionProps, AccordionContentProps as ExperimentalAccordionContentProps, AccordionHeaderProps as ExperimentalAccordionHeaderProps, AccordionItemProps as ExperimentalAccordionItemProps, } from "./Accordion/Accordion";
2
+ export { Accordion as ExperimentalAccordion } from "./Accordion/Accordion";
1
3
  export * from "./Button/Button";
2
4
  export * from "./ButtonGroup/ButtonGroup";
3
5
  export * from "./ButtonLink/ButtonLink";
@@ -3,9 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ ExperimentalAccordion: true
8
+ };
9
+ Object.defineProperty(exports, "ExperimentalAccordion", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _Accordion.Accordion;
13
+ }
14
+ });
15
+ var _Accordion = require("./Accordion/Accordion");
6
16
  var _Button = require("./Button/Button");
7
17
  Object.keys(_Button).forEach(function (key) {
8
18
  if (key === "default" || key === "__esModule") return;
19
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
9
20
  if (key in exports && exports[key] === _Button[key]) return;
10
21
  Object.defineProperty(exports, key, {
11
22
  enumerable: true,
@@ -17,6 +28,7 @@ Object.keys(_Button).forEach(function (key) {
17
28
  var _ButtonGroup = require("./ButtonGroup/ButtonGroup");
18
29
  Object.keys(_ButtonGroup).forEach(function (key) {
19
30
  if (key === "default" || key === "__esModule") return;
31
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
32
  if (key in exports && exports[key] === _ButtonGroup[key]) return;
21
33
  Object.defineProperty(exports, key, {
22
34
  enumerable: true,
@@ -28,6 +40,7 @@ Object.keys(_ButtonGroup).forEach(function (key) {
28
40
  var _ButtonLink = require("./ButtonLink/ButtonLink");
29
41
  Object.keys(_ButtonLink).forEach(function (key) {
30
42
  if (key === "default" || key === "__esModule") return;
43
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31
44
  if (key in exports && exports[key] === _ButtonLink[key]) return;
32
45
  Object.defineProperty(exports, key, {
33
46
  enumerable: true,
@@ -39,6 +52,7 @@ Object.keys(_ButtonLink).forEach(function (key) {
39
52
  var _IconButton = require("./IconButton/IconButton");
40
53
  Object.keys(_IconButton).forEach(function (key) {
41
54
  if (key === "default" || key === "__esModule") return;
55
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
42
56
  if (key in exports && exports[key] === _IconButton[key]) return;
43
57
  Object.defineProperty(exports, key, {
44
58
  enumerable: true,
@@ -50,6 +64,7 @@ Object.keys(_IconButton).forEach(function (key) {
50
64
  var _IconButtonLink = require("./IconButtonLink/IconButtonLink");
51
65
  Object.keys(_IconButtonLink).forEach(function (key) {
52
66
  if (key === "default" || key === "__esModule") return;
67
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
53
68
  if (key in exports && exports[key] === _IconButtonLink[key]) return;
54
69
  Object.defineProperty(exports, key, {
55
70
  enumerable: true,
@@ -61,6 +76,7 @@ Object.keys(_IconButtonLink).forEach(function (key) {
61
76
  var _Switch = require("./Switch");
62
77
  Object.keys(_Switch).forEach(function (key) {
63
78
  if (key === "default" || key === "__esModule") return;
79
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
64
80
  if (key in exports && exports[key] === _Switch[key]) return;
65
81
  Object.defineProperty(exports, key, {
66
82
  enumerable: true,
@@ -72,6 +88,7 @@ Object.keys(_Switch).forEach(function (key) {
72
88
  var _ToggleButton = require("./ToggleButton/ToggleButton");
73
89
  Object.keys(_ToggleButton).forEach(function (key) {
74
90
  if (key === "default" || key === "__esModule") return;
91
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
75
92
  if (key in exports && exports[key] === _ToggleButton[key]) return;
76
93
  Object.defineProperty(exports, key, {
77
94
  enumerable: true,
@@ -83,6 +100,7 @@ Object.keys(_ToggleButton).forEach(function (key) {
83
100
  var _ToggleGroup = require("./ToggleGroup/ToggleGroup");
84
101
  Object.keys(_ToggleGroup).forEach(function (key) {
85
102
  if (key === "default" || key === "__esModule") return;
103
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
86
104
  if (key in exports && exports[key] === _ToggleGroup[key]) return;
87
105
  Object.defineProperty(exports, key, {
88
106
  enumerable: true,
@@ -62,7 +62,7 @@ var Field = exports.Field = function Field(_ref) {
62
62
  console.warn("The `required` prop is set to different values on both the Field (`required=".concat(requiredProp, "`) and the underlying input component (`required=").concat(requiredContext, "`)."));
63
63
  }
64
64
  }
65
- var form = (0, _useForm.useExperimentalForm)();
65
+ var form = (0, _useForm.useForm)();
66
66
  var addField = form === null || form === void 0 ? void 0 : form.addField;
67
67
  var removeField = form === null || form === void 0 ? void 0 : form.removeField;
68
68
  (0, _react.useEffect)(function () {
@@ -96,7 +96,7 @@ var Field = exports.Field = function Field(_ref) {
96
96
  id: labelId,
97
97
  className: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["truncate ", ""])), inline ? "mr-2" : "mb-1"),
98
98
  children: [label, !hideRequiredIndicator && (requiredProp || requiredContext) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
99
- className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["text-red-700 ml-0.5"]))),
99
+ className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["text-red-700 ml-0.5 align-top"]))),
100
100
  "aria-hidden": true,
101
101
  children: "*"
102
102
  })]
@@ -1,16 +1,18 @@
1
1
  import type { FC, HTMLAttributes, ReactNode, VFC } from "react";
2
2
  import type { ButtonProps } from "../../Actions";
3
3
  import type { AlertProps } from "../../Indicators";
4
- import type { ExperimentalFormContextField } from "./FormContext";
5
- export interface ExperimentalFormProps extends HTMLAttributes<HTMLFormElement> {
4
+ import type { FormContextField } from "./FormContext";
5
+ export interface FormProps extends HTMLAttributes<HTMLFormElement> {
6
6
  }
7
- export declare type ExperimentalFormLocale = {
8
- errorText?: (invalidFields: ExperimentalFormContextField[]) => ReactNode;
7
+ export declare type FormLocale = {
8
+ errorTitle?: (invalidFields: FormContextField[], extraErrors?: string[]) => ReactNode;
9
+ errorText?: (invalidFields: FormContextField[], extraErrors?: string[]) => ReactNode;
9
10
  };
10
- export interface ExperimentalFormErrorMessageProps extends Omit<AlertProps, "children"> {
11
- locale?: ExperimentalFormLocale;
11
+ export interface FormErrorMessageProps extends Omit<AlertProps, "children"> {
12
+ locale?: FormLocale;
13
+ extraErrors?: string[];
12
14
  }
13
- export declare const ExperimentalFormErrorMessage: VFC<ExperimentalFormErrorMessageProps>;
14
- export declare const ExperimentalForm: FC<ExperimentalFormProps>;
15
- export declare const ExperimentalFormSubmit: FC<ButtonProps>;
16
- export declare const ExperimentalFormReset: FC<ButtonProps>;
15
+ export declare const FormErrorMessage: VFC<FormErrorMessageProps>;
16
+ export declare const Form: FC<FormProps>;
17
+ export declare const FormSubmit: FC<ButtonProps>;
18
+ export declare const FormReset: FC<ButtonProps>;