@algolia/satellite 2.3.0-rc.9 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Actions/Accordion/Accordion.d.ts +8 -0
- package/dist/cjs/Actions/Accordion/Accordion.js +104 -57
- package/dist/cjs/Actions/Accordion/Accordion.styles.d.ts +170 -0
- package/dist/cjs/Actions/Accordion/Accordion.styles.js +57 -0
- package/dist/cjs/Actions/Button/PolymorphicButton.js +5 -5
- package/dist/cjs/Actions/Button/PolymorphicIconButton.js +2 -2
- package/dist/cjs/Actions/Button/styles.d.ts +1 -0
- package/dist/cjs/Actions/Button/styles.js +15 -10
- package/dist/cjs/Actions/SegmentedControl/SegmentedControl.js +3 -2
- package/dist/cjs/Actions/SegmentedControl/SegmentedControlOption.js +6 -3
- package/dist/cjs/Actions/ToggleButton/ToggleButtonBase.js +3 -3
- package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.styles.d.ts +4 -4
- package/dist/cjs/Chat/ChatMessage/ChatMessage.d.ts +1 -1
- package/dist/cjs/Chat/ChatMessage/ChatMessage.styles.d.ts +1 -1
- package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +2 -2
- package/dist/cjs/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +2 -2
- package/dist/cjs/Fields/Field/Field.js +3 -3
- package/dist/cjs/Fields/Input/Input.js +10 -13
- package/dist/cjs/Fields/RadioGroup/RadioGroupContext.d.ts +2 -0
- package/dist/cjs/Fields/Switch/Switch.tailwind.js +9 -9
- package/dist/cjs/Fields/TextArea/TextArea.tailwind.js +3 -3
- package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.d.ts +22 -0
- package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.js +35 -0
- package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.tailwind.d.ts +5 -0
- package/dist/cjs/Helpers/MarkdownContent/MarkdownContent.tailwind.js +138 -0
- package/dist/cjs/Helpers/MarkdownContent/index.d.ts +1 -0
- package/dist/cjs/Helpers/MarkdownContent/index.js +16 -0
- package/dist/cjs/Helpers/UserContent/UserContent.tailwind.js +1 -3
- package/dist/cjs/Helpers/index.d.ts +1 -0
- package/dist/cjs/Helpers/index.js +11 -0
- package/dist/cjs/Icons/index.d.ts +1 -1
- package/dist/cjs/Icons/index.js +6 -0
- package/dist/cjs/Illustrations/index.d.ts +7 -0
- package/dist/cjs/Illustrations/index.js +1254 -0
- package/dist/cjs/Indicators/EmptyState/EmptyState.js +35 -2
- package/dist/cjs/Indicators/EmptyState/types.d.ts +4 -3
- package/dist/cjs/Overlay/MenuButton/MenuButton.d.ts +23 -7
- package/dist/cjs/Overlay/Modal/Modal.js +8 -8
- package/dist/cjs/Overlay/Modal/components/ModalFooter.js +2 -7
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/styles/helpers/prefixTailwindClassName.js +7 -1
- package/dist/cjs/styles/tailwind.config.js +1 -1
- package/dist/cjs/types.d.ts +7 -0
- package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/esm/Actions/Accordion/Accordion.d.ts +8 -0
- package/dist/esm/Actions/Accordion/Accordion.js +105 -58
- package/dist/esm/Actions/Accordion/Accordion.styles.d.ts +170 -0
- package/dist/esm/Actions/Accordion/Accordion.styles.js +50 -0
- package/dist/esm/Actions/Button/PolymorphicButton.js +6 -6
- package/dist/esm/Actions/Button/PolymorphicIconButton.js +2 -2
- package/dist/esm/Actions/Button/styles.d.ts +1 -0
- package/dist/esm/Actions/Button/styles.js +14 -9
- package/dist/esm/Actions/SegmentedControl/SegmentedControl.js +3 -2
- package/dist/esm/Actions/SegmentedControl/SegmentedControlOption.js +6 -3
- package/dist/esm/Actions/ToggleButton/ToggleButtonBase.js +4 -4
- package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.styles.d.ts +4 -4
- package/dist/esm/Chat/ChatMessage/ChatMessage.d.ts +1 -1
- package/dist/esm/Chat/ChatMessage/ChatMessage.styles.d.ts +1 -1
- package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +2 -2
- package/dist/esm/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +2 -2
- package/dist/esm/Fields/Field/Field.js +3 -3
- package/dist/esm/Fields/Input/Input.js +10 -13
- package/dist/esm/Fields/RadioGroup/RadioGroupContext.d.ts +2 -0
- package/dist/esm/Fields/Switch/Switch.tailwind.js +9 -9
- package/dist/esm/Fields/TextArea/TextArea.tailwind.js +3 -3
- package/dist/esm/Helpers/MarkdownContent/MarkdownContent.d.ts +22 -0
- package/dist/esm/Helpers/MarkdownContent/MarkdownContent.js +28 -0
- package/dist/esm/Helpers/MarkdownContent/MarkdownContent.tailwind.d.ts +5 -0
- package/dist/esm/Helpers/MarkdownContent/MarkdownContent.tailwind.js +138 -0
- package/dist/esm/Helpers/MarkdownContent/index.d.ts +1 -0
- package/dist/esm/Helpers/MarkdownContent/index.js +1 -0
- package/dist/esm/Helpers/UserContent/UserContent.tailwind.js +1 -3
- package/dist/esm/Helpers/index.d.ts +1 -0
- package/dist/esm/Helpers/index.js +2 -1
- package/dist/esm/Icons/index.d.ts +1 -1
- package/dist/esm/Icons/index.js +1 -1
- package/dist/esm/Illustrations/index.d.ts +7 -0
- package/dist/esm/Illustrations/index.js +1248 -0
- package/dist/esm/Indicators/EmptyState/EmptyState.js +35 -2
- package/dist/esm/Indicators/EmptyState/types.d.ts +4 -3
- package/dist/esm/Overlay/MenuButton/MenuButton.d.ts +23 -7
- package/dist/esm/Overlay/Modal/Modal.js +8 -8
- package/dist/esm/Overlay/Modal/components/ModalFooter.js +2 -7
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/styles/helpers/prefixTailwindClassName.js +7 -1
- package/dist/esm/styles/tailwind.config.js +1 -1
- package/dist/esm/types.d.ts +7 -0
- package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/satellite.min.css +1 -1
- package/package.json +4 -4
@@ -1,6 +1,9 @@
|
|
1
1
|
import * as RadixAccordion from "@radix-ui/react-accordion";
|
2
2
|
import type { FC, ReactNode } from "react";
|
3
|
+
import type { VariantProps } from "tailwind-variants";
|
4
|
+
import { accordionStyles } from "./Accordion.styles";
|
3
5
|
import type { IconComponentType } from "../../Icons";
|
6
|
+
declare type AccordionVariants = VariantProps<typeof accordionStyles>;
|
4
7
|
declare type AccordionSharedProps = {
|
5
8
|
/**
|
6
9
|
* The content of the `Accordion`.
|
@@ -14,6 +17,11 @@ declare type AccordionSharedProps = {
|
|
14
17
|
* Whether the `Accordion` is disabled, preventing the user from interacting with the accordion and all its items.
|
15
18
|
*/
|
16
19
|
disabled?: boolean;
|
20
|
+
/**
|
21
|
+
* Display the Accordion in normal or a more compact style (no meta or description, smaller paddings).
|
22
|
+
* @default normal
|
23
|
+
*/
|
24
|
+
variant?: AccordionVariants["variant"];
|
17
25
|
};
|
18
26
|
declare type AccordionSingleProps = {
|
19
27
|
/**
|
@@ -7,25 +7,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports.Accordion = void 0;
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
11
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
12
11
|
var RadixAccordion = _interopRequireWildcard(require("@radix-ui/react-accordion"));
|
13
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
14
13
|
var _react = require("react");
|
14
|
+
var _Accordion = require("./Accordion.styles");
|
15
15
|
var _Icons = require("./../../Icons");
|
16
|
-
var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/satellitePrefixer"));
|
17
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
18
|
-
var
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
var _excluded = ["children", "variant"],
|
18
|
+
_excluded2 = ["children", "className"],
|
19
|
+
_excluded3 = ["onChange", "multiple"],
|
20
|
+
_excluded4 = ["onChange", "multiple", "collapsible"];
|
22
21
|
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
22
|
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
23
|
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
24
|
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
|
27
|
-
|
28
|
-
|
25
|
+
var AccordionVariantContext = /*#__PURE__*/(0, _react.createContext)({
|
26
|
+
variant: "normal"
|
27
|
+
});
|
28
|
+
var useAccordionVariant = function useAccordionVariant() {
|
29
|
+
return (0, _react.useContext)(AccordionVariantContext);
|
30
|
+
};
|
29
31
|
/**
|
30
32
|
* The `Accordion` component is a compact section for revealing and hiding content, ideal for keeping interfaces clean.
|
31
33
|
*
|
@@ -33,15 +35,36 @@ var TRIGGER_ICON_SIZE = 20;
|
|
33
35
|
*/
|
34
36
|
var Accordion = exports.Accordion = function Accordion(_ref) {
|
35
37
|
var children = _ref.children,
|
36
|
-
|
38
|
+
_ref$variant = _ref.variant,
|
39
|
+
variant = _ref$variant === void 0 ? "normal" : _ref$variant,
|
37
40
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionVariantContext.Provider, {
|
42
|
+
value: {
|
43
|
+
variant: variant
|
44
|
+
},
|
45
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionRootInternal, _objectSpread(_objectSpread({}, props), {}, {
|
46
|
+
children: children
|
47
|
+
}))
|
48
|
+
});
|
49
|
+
};
|
50
|
+
var AccordionRootInternal = function AccordionRootInternal(_ref2) {
|
51
|
+
var children = _ref2.children,
|
52
|
+
className = _ref2.className,
|
53
|
+
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
54
|
+
var _useAccordionVariant = useAccordionVariant(),
|
55
|
+
variant = _useAccordionVariant.variant;
|
56
|
+
var styles = (0, _Accordion.accordionStyles)({
|
57
|
+
variant: variant
|
58
|
+
});
|
38
59
|
var sharedProps = {
|
39
|
-
className: (
|
60
|
+
className: styles.base({
|
61
|
+
className: className
|
62
|
+
})
|
40
63
|
};
|
41
64
|
if (props.multiple) {
|
42
65
|
var _onChange = props.onChange,
|
43
66
|
_multiple = props.multiple,
|
44
|
-
_rest = (0, _objectWithoutProperties2["default"])(props,
|
67
|
+
_rest = (0, _objectWithoutProperties2["default"])(props, _excluded3);
|
45
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Root, _objectSpread(_objectSpread(_objectSpread({}, _rest), sharedProps), {}, {
|
46
69
|
type: "multiple",
|
47
70
|
onValueChange: _onChange,
|
@@ -52,7 +75,7 @@ var Accordion = exports.Accordion = function Accordion(_ref) {
|
|
52
75
|
multiple = props.multiple,
|
53
76
|
_props$collapsible = props.collapsible,
|
54
77
|
collapsible = _props$collapsible === void 0 ? true : _props$collapsible,
|
55
|
-
rest = (0, _objectWithoutProperties2["default"])(props,
|
78
|
+
rest = (0, _objectWithoutProperties2["default"])(props, _excluded4);
|
56
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Root, _objectSpread(_objectSpread(_objectSpread({}, rest), sharedProps), {}, {
|
57
80
|
type: "single",
|
58
81
|
onValueChange: onChange,
|
@@ -61,71 +84,88 @@ var Accordion = exports.Accordion = function Accordion(_ref) {
|
|
61
84
|
}));
|
62
85
|
};
|
63
86
|
Accordion.displayName = "Accordion";
|
64
|
-
var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (
|
65
|
-
var value =
|
66
|
-
disabled =
|
67
|
-
children =
|
68
|
-
className =
|
87
|
+
var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
88
|
+
var value = _ref3.value,
|
89
|
+
disabled = _ref3.disabled,
|
90
|
+
children = _ref3.children,
|
91
|
+
className = _ref3.className;
|
92
|
+
var _useAccordionVariant2 = useAccordionVariant(),
|
93
|
+
variant = _useAccordionVariant2.variant;
|
94
|
+
var styles = (0, _Accordion.accordionStyles)({
|
95
|
+
variant: variant
|
96
|
+
});
|
69
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Item, {
|
70
98
|
value: value,
|
71
99
|
disabled: disabled,
|
72
100
|
ref: ref,
|
73
|
-
className: (
|
101
|
+
className: styles.item({
|
102
|
+
className: className
|
103
|
+
}),
|
74
104
|
children: children
|
75
105
|
});
|
76
106
|
});
|
77
107
|
AccordionItem.displayName = "AccordionItem";
|
78
|
-
var AccordionHeader = /*#__PURE__*/(0, _react.forwardRef)(function (
|
79
|
-
var children =
|
80
|
-
description =
|
81
|
-
Icon =
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
108
|
+
var AccordionHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref4, ref) {
|
109
|
+
var children = _ref4.children,
|
110
|
+
description = _ref4.description,
|
111
|
+
Icon = _ref4.icon,
|
112
|
+
iconClassName = _ref4.iconClassName,
|
113
|
+
iconBgClassName = _ref4.iconBgClassName,
|
114
|
+
meta = _ref4.meta,
|
115
|
+
triggerIcon = _ref4.triggerIcon,
|
116
|
+
triggerClassName = _ref4.triggerClassName,
|
117
|
+
className = _ref4.className,
|
118
|
+
titleWrapperClassName = _ref4.titleWrapperClassName,
|
119
|
+
titleClassName = _ref4.titleClassName;
|
120
|
+
var _useAccordionVariant3 = useAccordionVariant(),
|
121
|
+
variant = _useAccordionVariant3.variant;
|
122
|
+
var styles = (0, _Accordion.accordionStyles)({
|
123
|
+
variant: variant
|
124
|
+
});
|
125
|
+
var isCompact = variant === "compact";
|
92
126
|
var TriggerIcon = triggerIcon || _Icons.ChevronDownIcon;
|
93
127
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Header, {
|
94
|
-
className:
|
128
|
+
className: styles.header({
|
129
|
+
className: className
|
130
|
+
}),
|
95
131
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(RadixAccordion.Trigger, {
|
96
132
|
ref: ref,
|
97
|
-
className: (
|
133
|
+
className: styles.trigger({
|
134
|
+
className: triggerClassName
|
135
|
+
}),
|
98
136
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
99
|
-
className: (
|
137
|
+
className: styles.titleWrapper({
|
138
|
+
className: titleWrapperClassName
|
139
|
+
}),
|
100
140
|
children: [Icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
101
|
-
className: (
|
141
|
+
className: styles.iconBg({
|
142
|
+
className: iconBgClassName
|
143
|
+
}),
|
102
144
|
"aria-hidden": true,
|
103
145
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
104
|
-
className: (
|
105
|
-
|
106
|
-
|
146
|
+
className: styles.icon({
|
147
|
+
className: iconClassName
|
148
|
+
})
|
107
149
|
})
|
108
150
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
109
|
-
className: (
|
151
|
+
className: styles.titleCol(),
|
110
152
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
111
|
-
className: (
|
153
|
+
className: styles.title({
|
154
|
+
className: titleClassName
|
155
|
+
}),
|
112
156
|
children: children
|
113
|
-
}), typeof description !== "undefined" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
114
|
-
className: (
|
157
|
+
}), !isCompact && typeof description !== "undefined" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
158
|
+
className: styles.description(),
|
115
159
|
children: description
|
116
160
|
})]
|
117
161
|
})]
|
118
162
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
119
|
-
className: (
|
120
|
-
children: [typeof meta !== "undefined" && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
121
|
-
className: (
|
163
|
+
className: styles.metaWrapper(),
|
164
|
+
children: [typeof meta !== "undefined" && !isCompact && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
165
|
+
className: styles.meta(),
|
122
166
|
children: meta
|
123
167
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(TriggerIcon, {
|
124
|
-
className: (0, _clsx["default"])((
|
125
|
-
// Don't rotate the trigger icon if it's a custom one.
|
126
|
-
!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"])))),
|
127
|
-
width: TRIGGER_ICON_SIZE,
|
128
|
-
height: TRIGGER_ICON_SIZE,
|
168
|
+
className: (0, _clsx["default"])(styles.triggerIcon(), !triggerIcon && styles.triggerIconChevron()),
|
129
169
|
"aria-hidden": true
|
130
170
|
})]
|
131
171
|
})]
|
@@ -133,14 +173,21 @@ var AccordionHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref)
|
|
133
173
|
});
|
134
174
|
});
|
135
175
|
AccordionHeader.displayName = "AccordionHeader";
|
136
|
-
var AccordionContent = /*#__PURE__*/(0, _react.forwardRef)(function (
|
137
|
-
var children =
|
138
|
-
className =
|
176
|
+
var AccordionContent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref5, ref) {
|
177
|
+
var children = _ref5.children,
|
178
|
+
className = _ref5.className;
|
179
|
+
var _useAccordionVariant4 = useAccordionVariant(),
|
180
|
+
variant = _useAccordionVariant4.variant;
|
181
|
+
var styles = (0, _Accordion.accordionStyles)({
|
182
|
+
variant: variant
|
183
|
+
});
|
139
184
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RadixAccordion.Content, {
|
140
185
|
ref: ref,
|
141
|
-
className: (
|
186
|
+
className: styles.content({
|
187
|
+
className: className
|
188
|
+
}),
|
142
189
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
143
|
-
className: (
|
190
|
+
className: styles.contentInner(),
|
144
191
|
children: children
|
145
192
|
})
|
146
193
|
});
|
@@ -0,0 +1,170 @@
|
|
1
|
+
export declare const accordionStyles: import("tailwind-variants").TVReturnType<{
|
2
|
+
variant: {
|
3
|
+
normal: {
|
4
|
+
trigger: string;
|
5
|
+
titleWrapper: string;
|
6
|
+
iconBg: string;
|
7
|
+
triggerIcon: string;
|
8
|
+
contentInner: string;
|
9
|
+
};
|
10
|
+
compact: {
|
11
|
+
trigger: string;
|
12
|
+
titleWrapper: string;
|
13
|
+
iconBg: string;
|
14
|
+
title: string;
|
15
|
+
description: string;
|
16
|
+
metaWrapper: string;
|
17
|
+
meta: string;
|
18
|
+
triggerIcon: string;
|
19
|
+
content: string;
|
20
|
+
contentInner: string;
|
21
|
+
};
|
22
|
+
};
|
23
|
+
}, {
|
24
|
+
base: string;
|
25
|
+
item: string;
|
26
|
+
header: string;
|
27
|
+
trigger: string;
|
28
|
+
titleWrapper: string;
|
29
|
+
iconBg: string;
|
30
|
+
icon: string;
|
31
|
+
titleCol: string;
|
32
|
+
title: string;
|
33
|
+
description: string;
|
34
|
+
metaWrapper: string;
|
35
|
+
meta: string;
|
36
|
+
triggerIcon: string;
|
37
|
+
triggerIconChevron: string;
|
38
|
+
content: string;
|
39
|
+
contentInner: string;
|
40
|
+
}, undefined, {
|
41
|
+
responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
|
42
|
+
variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
43
|
+
} | undefined;
|
44
|
+
} & import("tailwind-variants/dist/config").TWMConfig & {
|
45
|
+
twMergeConfig: {
|
46
|
+
prefix: string;
|
47
|
+
};
|
48
|
+
}, {
|
49
|
+
variant: {
|
50
|
+
normal: {
|
51
|
+
trigger: string;
|
52
|
+
titleWrapper: string;
|
53
|
+
iconBg: string;
|
54
|
+
triggerIcon: string;
|
55
|
+
contentInner: string;
|
56
|
+
};
|
57
|
+
compact: {
|
58
|
+
trigger: string;
|
59
|
+
titleWrapper: string;
|
60
|
+
iconBg: string;
|
61
|
+
title: string;
|
62
|
+
description: string;
|
63
|
+
metaWrapper: string;
|
64
|
+
meta: string;
|
65
|
+
triggerIcon: string;
|
66
|
+
content: string;
|
67
|
+
contentInner: string;
|
68
|
+
};
|
69
|
+
};
|
70
|
+
}, {
|
71
|
+
base: string;
|
72
|
+
item: string;
|
73
|
+
header: string;
|
74
|
+
trigger: string;
|
75
|
+
titleWrapper: string;
|
76
|
+
iconBg: string;
|
77
|
+
icon: string;
|
78
|
+
titleCol: string;
|
79
|
+
title: string;
|
80
|
+
description: string;
|
81
|
+
metaWrapper: string;
|
82
|
+
meta: string;
|
83
|
+
triggerIcon: string;
|
84
|
+
triggerIconChevron: string;
|
85
|
+
content: string;
|
86
|
+
contentInner: string;
|
87
|
+
}, import("tailwind-variants").TVReturnType<{
|
88
|
+
variant: {
|
89
|
+
normal: {
|
90
|
+
trigger: string;
|
91
|
+
titleWrapper: string;
|
92
|
+
iconBg: string;
|
93
|
+
triggerIcon: string;
|
94
|
+
contentInner: string;
|
95
|
+
};
|
96
|
+
compact: {
|
97
|
+
trigger: string;
|
98
|
+
titleWrapper: string;
|
99
|
+
iconBg: string;
|
100
|
+
title: string;
|
101
|
+
description: string;
|
102
|
+
metaWrapper: string;
|
103
|
+
meta: string;
|
104
|
+
triggerIcon: string;
|
105
|
+
content: string;
|
106
|
+
contentInner: string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
}, {
|
110
|
+
base: string;
|
111
|
+
item: string;
|
112
|
+
header: string;
|
113
|
+
trigger: string;
|
114
|
+
titleWrapper: string;
|
115
|
+
iconBg: string;
|
116
|
+
icon: string;
|
117
|
+
titleCol: string;
|
118
|
+
title: string;
|
119
|
+
description: string;
|
120
|
+
metaWrapper: string;
|
121
|
+
meta: string;
|
122
|
+
triggerIcon: string;
|
123
|
+
triggerIconChevron: string;
|
124
|
+
content: string;
|
125
|
+
contentInner: string;
|
126
|
+
}, undefined, import("tailwind-variants/dist/config").TVConfig<{
|
127
|
+
variant: {
|
128
|
+
normal: {
|
129
|
+
trigger: string;
|
130
|
+
titleWrapper: string;
|
131
|
+
iconBg: string;
|
132
|
+
triggerIcon: string;
|
133
|
+
contentInner: string;
|
134
|
+
};
|
135
|
+
compact: {
|
136
|
+
trigger: string;
|
137
|
+
titleWrapper: string;
|
138
|
+
iconBg: string;
|
139
|
+
title: string;
|
140
|
+
description: string;
|
141
|
+
metaWrapper: string;
|
142
|
+
meta: string;
|
143
|
+
triggerIcon: string;
|
144
|
+
content: string;
|
145
|
+
contentInner: string;
|
146
|
+
};
|
147
|
+
};
|
148
|
+
}, {
|
149
|
+
variant: {
|
150
|
+
normal: {
|
151
|
+
trigger: string;
|
152
|
+
titleWrapper: string;
|
153
|
+
iconBg: string;
|
154
|
+
triggerIcon: string;
|
155
|
+
contentInner: string;
|
156
|
+
};
|
157
|
+
compact: {
|
158
|
+
trigger: string;
|
159
|
+
titleWrapper: string;
|
160
|
+
iconBg: string;
|
161
|
+
title: string;
|
162
|
+
description: string;
|
163
|
+
metaWrapper: string;
|
164
|
+
meta: string;
|
165
|
+
triggerIcon: string;
|
166
|
+
content: string;
|
167
|
+
contentInner: string;
|
168
|
+
};
|
169
|
+
};
|
170
|
+
}>, unknown, unknown, undefined>>;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.accordionStyles = void 0;
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
9
|
+
var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/satellitePrefixer"));
|
10
|
+
var _tv = require("./../../styles/helpers/tv");
|
11
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31;
|
12
|
+
var accordionStyles = exports.accordionStyles = (0, _tv.tv)({
|
13
|
+
slots: {
|
14
|
+
base: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["flex flex-col"]))),
|
15
|
+
item: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["group/accordion-item flex flex-col"]))),
|
16
|
+
header: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""]))),
|
17
|
+
trigger: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["group/accordion-trigger flex items-center justify-between"]))),
|
18
|
+
titleWrapper: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["flex items-center grow"]))),
|
19
|
+
iconBg: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["flex items-center justify-center shrink-0"]))),
|
20
|
+
icon: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["size-4 text-grey-600 group-disabled/accordion-trigger:text-grey-300"]))),
|
21
|
+
titleCol: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["flex flex-col gap-y-1 text-left grow"]))),
|
22
|
+
title: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["typo-display-heading line-clamp-2 group-disabled/accordion-trigger:text-grey-300"]))),
|
23
|
+
description: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["typo-display-body text-grey-600 line-clamp-3 group-disabled/accordion-trigger:text-grey-300"]))),
|
24
|
+
metaWrapper: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["flex items-center gap-x-2"]))),
|
25
|
+
meta: (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["typo-display-caption group-disabled/accordion-trigger:text-grey-300"]))),
|
26
|
+
triggerIcon: (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 text-grey-600 group-disabled/accordion-trigger:text-grey-300"]))),
|
27
|
+
triggerIconChevron: (0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["group-data-[state=open]/accordion-trigger:rotate-180 motion-safe:transition-transform motion-safe:duration-300 motion-safe:ease-out"]))),
|
28
|
+
content: (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["typo-display-body text-grey-600 overflow-hidden accordion-content"]))),
|
29
|
+
contentInner: (0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])([""])))
|
30
|
+
},
|
31
|
+
variants: {
|
32
|
+
variant: {
|
33
|
+
normal: {
|
34
|
+
trigger: (0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["w-full gap-x-3 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"]))),
|
35
|
+
titleWrapper: (0, _satellitePrefixer["default"])(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["gap-x-3"]))),
|
36
|
+
iconBg: (0, _satellitePrefixer["default"])(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2["default"])(["rounded-full w-8 h-8 bg-grey-100"]))),
|
37
|
+
triggerIcon: (0, _satellitePrefixer["default"])(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2["default"])(["size-5"]))),
|
38
|
+
contentInner: (0, _satellitePrefixer["default"])(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2["default"])(["px-4 pt-2 pb-4"])))
|
39
|
+
},
|
40
|
+
compact: {
|
41
|
+
trigger: (0, _satellitePrefixer["default"])(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2["default"])(["min-h-0 gap-x-2 bg-transparent border-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent-600"]))),
|
42
|
+
titleWrapper: (0, _satellitePrefixer["default"])(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2["default"])(["gap-x-1"]))),
|
43
|
+
iconBg: (0, _satellitePrefixer["default"])(_templateObject24 || (_templateObject24 = (0, _taggedTemplateLiteral2["default"])(["h-6 bg-transparent"]))),
|
44
|
+
title: (0, _satellitePrefixer["default"])(_templateObject25 || (_templateObject25 = (0, _taggedTemplateLiteral2["default"])(["typo-display-body"]))),
|
45
|
+
description: (0, _satellitePrefixer["default"])(_templateObject26 || (_templateObject26 = (0, _taggedTemplateLiteral2["default"])(["hidden"]))),
|
46
|
+
metaWrapper: (0, _satellitePrefixer["default"])(_templateObject27 || (_templateObject27 = (0, _taggedTemplateLiteral2["default"])([""]))),
|
47
|
+
meta: (0, _satellitePrefixer["default"])(_templateObject28 || (_templateObject28 = (0, _taggedTemplateLiteral2["default"])(["hidden"]))),
|
48
|
+
triggerIcon: (0, _satellitePrefixer["default"])(_templateObject29 || (_templateObject29 = (0, _taggedTemplateLiteral2["default"])(["size-4"]))),
|
49
|
+
content: (0, _satellitePrefixer["default"])(_templateObject30 || (_templateObject30 = (0, _taggedTemplateLiteral2["default"])(["py-0"]))),
|
50
|
+
contentInner: (0, _satellitePrefixer["default"])(_templateObject31 || (_templateObject31 = (0, _taggedTemplateLiteral2["default"])(["py-1"])))
|
51
|
+
}
|
52
|
+
}
|
53
|
+
},
|
54
|
+
defaultVariants: {
|
55
|
+
variant: "normal"
|
56
|
+
}
|
57
|
+
});
|
@@ -22,7 +22,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
22
22
|
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; }
|
23
23
|
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; }
|
24
24
|
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; }
|
25
|
-
var BASE_CLASSNAMES = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["btn inline-flex justify-center items-center
|
25
|
+
var BASE_CLASSNAMES = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["btn inline-flex justify-center items-center typo-display-body focusable-visible"])));
|
26
26
|
var ICON_SIZE = 16;
|
27
27
|
/**
|
28
28
|
* `PolymorphicButton` is intended for internal use.
|
@@ -46,7 +46,7 @@ var PolymorphicButton = exports.PolymorphicButton = /*#__PURE__*/(0, _react.forw
|
|
46
46
|
// @ts-expect-error disabled is not present in PolymorphicButtonProps
|
47
47
|
cleanedProps.disabled = true;
|
48
48
|
}
|
49
|
-
var buttonClassName = (0, _clsx["default"])(BASE_CLASSNAMES, _styles.BUTTON_SIZE_CLASSNAMES[size], _styles.BUTTON_VARIANT_CLASSNAMES[variant], cleanedProps.disabled && (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["btn-disabled"]))), className);
|
49
|
+
var buttonClassName = (0, _clsx["default"])(BASE_CLASSNAMES, _styles.BUTTON_SIZE_CLASSNAMES[size], _styles.BUTTON_PADDING_CLASSNAMES[size], _styles.BUTTON_VARIANT_CLASSNAMES[variant], cleanedProps.disabled && (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["btn-disabled"]))), className);
|
50
50
|
var loaderClassNames = (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["absolute ", ""])), (variant === "destructive" || variant === "primary") && "text-white");
|
51
51
|
var iconClassNames = (0, _clsx["default"])((0, _styles.getIconColorClassName)(props), loading && (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["invisible"]))));
|
52
52
|
var textClassNames = (0, _clsx["default"])(loading && (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["invisible"]))));
|
@@ -64,14 +64,14 @@ var PolymorphicButton = exports.PolymorphicButton = /*#__PURE__*/(0, _react.forw
|
|
64
64
|
}), StartIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(StartIcon, {
|
65
65
|
width: ICON_SIZE,
|
66
66
|
height: ICON_SIZE,
|
67
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["shrink-0"]))), iconClassNames)
|
67
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 mr-1"]))), iconClassNames)
|
68
68
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
69
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["whitespace-nowrap
|
69
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["whitespace-nowrap"]))), textClassNames),
|
70
70
|
children: children
|
71
71
|
}), EndIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(EndIcon, {
|
72
72
|
width: ICON_SIZE,
|
73
73
|
height: ICON_SIZE,
|
74
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["shrink-0"]))), iconClassNames)
|
74
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["shrink-0 ml-1"]))), iconClassNames)
|
75
75
|
})]
|
76
76
|
}));
|
77
77
|
});
|
@@ -22,9 +22,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
22
22
|
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; }
|
23
23
|
var BASE_CLASSNAMES = (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["btn inline-flex items-center justify-center focusable-visible"])));
|
24
24
|
var SIZE_CLASSNAMES = {
|
25
|
-
small: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["max-h-6 max-w-6 min-h-6 min-w-6 text-
|
25
|
+
small: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["max-h-6 max-w-6 min-h-6 min-w-6 text-md"]))),
|
26
26
|
medium: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["max-h-8 max-w-8 min-h-8 min-w-8 text-md"]))),
|
27
|
-
large: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["max-h-10 max-w-10 min-h-10 min-w-10 text-
|
27
|
+
large: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["max-h-10 max-w-10 min-h-10 min-w-10 text-md"])))
|
28
28
|
};
|
29
29
|
var VARIANT_CLASSNAMES = _objectSpread(_objectSpread({}, _styles.BUTTON_VARIANT_CLASSNAMES), {}, {
|
30
30
|
neutral: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["btn-neutral text-grey-600"]))),
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { ButtonBaseProps, ButtonSize, ButtonVariant } from "./types";
|
2
2
|
export declare const BUTTON_SIZE_CLASSNAMES: Record<ButtonSize, string>;
|
3
|
+
export declare const BUTTON_PADDING_CLASSNAMES: Record<ButtonSize, string>;
|
3
4
|
export declare const BUTTON_LOADER_ICON_SIZES: Record<ButtonSize, number>;
|
4
5
|
export declare const BUTTON_VARIANT_CLASSNAMES: Record<ButtonVariant, string>;
|
5
6
|
export declare const getIconColorClassName: ({ disabled, variant }: Pick<ButtonBaseProps, "disabled" | "variant">) => string | null;
|
@@ -4,34 +4,39 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.getIconColorClassName = exports.BUTTON_VARIANT_CLASSNAMES = exports.BUTTON_SIZE_CLASSNAMES = exports.BUTTON_LOADER_ICON_SIZES = void 0;
|
7
|
+
exports.getIconColorClassName = exports.BUTTON_VARIANT_CLASSNAMES = exports.BUTTON_SIZE_CLASSNAMES = exports.BUTTON_PADDING_CLASSNAMES = exports.BUTTON_LOADER_ICON_SIZES = void 0;
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
9
9
|
var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/satellitePrefixer"));
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
11
11
|
var BUTTON_SIZE_CLASSNAMES = exports.BUTTON_SIZE_CLASSNAMES = {
|
12
12
|
small: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["h-6"]))),
|
13
13
|
medium: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["h-8"]))),
|
14
14
|
large: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["h-10"])))
|
15
15
|
};
|
16
|
+
var BUTTON_PADDING_CLASSNAMES = exports.BUTTON_PADDING_CLASSNAMES = {
|
17
|
+
small: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["px-2"]))),
|
18
|
+
medium: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["px-4"]))),
|
19
|
+
large: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["px-4"])))
|
20
|
+
};
|
16
21
|
var BUTTON_LOADER_ICON_SIZES = exports.BUTTON_LOADER_ICON_SIZES = {
|
17
|
-
small:
|
22
|
+
small: 16,
|
18
23
|
medium: 16,
|
19
|
-
large:
|
24
|
+
large: 16
|
20
25
|
};
|
21
26
|
var BUTTON_VARIANT_CLASSNAMES = exports.BUTTON_VARIANT_CLASSNAMES = {
|
22
|
-
subtle: (0, _satellitePrefixer["default"])(
|
23
|
-
neutral: (0, _satellitePrefixer["default"])(
|
24
|
-
primary: (0, _satellitePrefixer["default"])(
|
25
|
-
destructive: (0, _satellitePrefixer["default"])(
|
27
|
+
subtle: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["btn-subtle"]))),
|
28
|
+
neutral: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["btn-neutral"]))),
|
29
|
+
primary: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["btn-primary"]))),
|
30
|
+
destructive: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["btn-destructive"])))
|
26
31
|
};
|
27
32
|
var getIconColorClassName = exports.getIconColorClassName = function getIconColorClassName(_ref) {
|
28
33
|
var disabled = _ref.disabled,
|
29
34
|
variant = _ref.variant;
|
30
35
|
if (variant === "destructive" || variant === "primary") {
|
31
|
-
return (0, _satellitePrefixer["default"])(
|
36
|
+
return (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["text-white"])));
|
32
37
|
}
|
33
38
|
if (variant === "subtle" && !disabled) {
|
34
39
|
return null;
|
35
40
|
}
|
36
|
-
return disabled ? (0, _satellitePrefixer["default"])(
|
41
|
+
return disabled ? (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["text-grey-300"]))) : (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["text-grey-600"])));
|
37
42
|
};
|
@@ -76,11 +76,12 @@ var SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forwar
|
|
76
76
|
value: value,
|
77
77
|
name: radioName,
|
78
78
|
onChange: onChange,
|
79
|
-
disabled: disabled
|
79
|
+
disabled: disabled,
|
80
|
+
size: size
|
80
81
|
},
|
81
82
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
82
83
|
ref: (0, _mergeRefs.mergeRefs)([ref, containerRef]),
|
83
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["segmented-control focusable-visible-within\n relative inline-flex typo-display-body rounded bg-grey-100\n ", "\n "])), size === "large" ? "segmented-control-large space-x-1" : "space-x-
|
84
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["segmented-control focusable-visible-within\n relative inline-flex typo-display-body rounded bg-grey-100\n ", "\n "])), size === "large" ? "segmented-control-large space-x-1" : "space-x-0.5"), _styles.BUTTON_SIZE_CLASSNAMES[size], className),
|
84
85
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
85
86
|
ref: valueIndicatorRef,
|
86
87
|
style: valueIndicatorStyle,
|