@algolia/satellite 1.10.1 → 1.11.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 +27 -18
- package/dist/cjs/Actions/Button/Button.tailwind.js +27 -42
- package/dist/cjs/Actions/Button/PolymorphicIconButton.d.ts +34 -5
- package/dist/cjs/Actions/Button/types.d.ts +30 -9
- package/dist/cjs/Actions/Button/types.js +2 -0
- package/dist/cjs/Actions/ButtonGroup/ButtonGroup.d.ts +6 -1
- package/dist/cjs/Actions/Switch/Switch.d.ts +21 -1
- package/dist/cjs/Actions/Switch/SwitchOption.d.ts +9 -0
- package/dist/cjs/Actions/Switch/types.d.ts +2 -1
- package/dist/cjs/Actions/Switch/types.js +3 -1
- package/dist/cjs/Actions/ToggleButton/ToggleButton.d.ts +9 -0
- package/dist/cjs/Actions/ToggleButton/ToggleButtonBase.d.ts +33 -2
- package/dist/cjs/Actions/ToggleButton/ToggleButtonBase.js +1 -1
- package/dist/cjs/Actions/ToggleGroup/ToggleGroup.d.ts +18 -6
- package/dist/cjs/Avatars/ApplicationAvatar/ApplicationAvatar.d.ts +10 -3
- package/dist/cjs/Avatars/UserAvatar/UserAvatar.d.ts +13 -5
- package/dist/cjs/Avatars/types.d.ts +23 -1
- package/dist/cjs/Avatars/types.js +3 -1
- package/dist/cjs/Fields/AutoComplete/components/AutoCompleteEmptyState.d.ts +6 -2
- package/dist/cjs/Fields/AutoComplete/types.d.ts +144 -5
- package/dist/cjs/Fields/Checkbox/Checkbox.d.ts +5 -2
- package/dist/cjs/Fields/DateInput/DateInput.d.ts +47 -0
- package/dist/cjs/Fields/DateInput/DateInput.js +169 -0
- package/dist/cjs/Fields/DateInput/index.d.ts +1 -0
- package/dist/cjs/Fields/DateInput/index.js +16 -0
- package/dist/cjs/Fields/DatePicker/DatePicker/DatePicker.d.ts +42 -0
- package/dist/cjs/Fields/DatePicker/DatePicker/DatePicker.js +1 -0
- package/dist/cjs/Fields/DatePicker/DateRangePicker/DateRangePicker.d.ts +36 -0
- package/dist/cjs/Fields/DatePicker/DateRangePicker/DateRangePicker.js +1 -0
- package/dist/cjs/Fields/DatePicker/components/Popover.d.ts +1 -0
- package/dist/cjs/Fields/DatePicker/components/Popover.js +5 -1
- package/dist/cjs/Fields/DatePicker/types.d.ts +21 -0
- package/dist/cjs/Fields/Dropzone/Dropzone.d.ts +85 -6
- package/dist/cjs/Fields/Field/Field.d.ts +32 -9
- package/dist/cjs/Fields/Form/stories/Complex.js +22 -12
- package/dist/cjs/Fields/Input/Input.d.ts +18 -1
- package/dist/cjs/Fields/Input/Input.js +5 -3
- package/dist/cjs/Fields/RadioGroup/RadioButton.d.ts +68 -2
- package/dist/cjs/Fields/RadioGroup/RadioGroup.d.ts +27 -10
- package/dist/cjs/Fields/RadioGroup/RadioGroup.js +20 -77
- package/dist/cjs/Fields/RadioGroup/RadioGroupItem.d.ts +20 -0
- package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +71 -0
- package/dist/cjs/Fields/RadioGroup/index.d.ts +1 -0
- package/dist/cjs/Fields/RadioGroup/index.js +11 -0
- package/dist/cjs/Fields/RangeSlider/RangeSlider.d.ts +48 -3
- package/dist/cjs/Fields/Select/Select.d.ts +3 -0
- package/dist/cjs/Fields/TextArea/TextArea.d.ts +16 -0
- package/dist/cjs/Fields/Toggle/Toggle.d.ts +51 -3
- package/dist/cjs/Fields/index.d.ts +1 -0
- package/dist/cjs/Fields/index.js +11 -0
- package/dist/cjs/Helpers/ClickAwayContainer/ClickAwayContainer.d.ts +6 -4
- package/dist/cjs/Helpers/HelpUnderline/HelpUnderline.d.ts +9 -1
- package/dist/cjs/Helpers/Medallion/Medallion.d.ts +14 -1
- package/dist/cjs/Helpers/Medallion/Medallion.js +11 -10
- package/dist/cjs/Helpers/Medallion/Medallion.tailwind.js +1 -1
- package/dist/cjs/Helpers/Medallion/types.d.ts +1 -1
- package/dist/cjs/Helpers/Separator/Separator.d.ts +10 -0
- package/dist/cjs/Helpers/TextWrap/TextWrap.d.ts +8 -2
- package/dist/cjs/Helpers/TextWrap/TextWrap.js +1 -1
- package/dist/cjs/Helpers/UserContent/UserContent.d.ts +10 -1
- package/dist/cjs/Icons/index.d.ts +1 -1
- package/dist/cjs/Icons/index.js +6 -0
- package/dist/cjs/Indicators/Badge/Badge.d.ts +6 -2
- package/dist/cjs/Indicators/Tag/Tag.tailwind.js +13 -4
- package/dist/cjs/Navigation/Stepper/Step.js +28 -25
- package/dist/cjs/Overlay/MenuButton/components/CustomTrigger.d.ts +1 -1
- package/dist/cjs/Overlay/MenuButton/components/CustomTrigger.js +12 -4
- package/dist/cjs/Overlay/Popover/types.d.ts +4 -0
- package/dist/cjs/Overlay/Tooltip/types.d.ts +3 -0
- package/dist/cjs/Satellite/locale.d.ts +2 -1
- package/dist/esm/Actions/Accordion/Accordion.d.ts +27 -18
- package/dist/esm/Actions/Button/Button.tailwind.js +27 -44
- package/dist/esm/Actions/Button/PolymorphicIconButton.d.ts +34 -5
- package/dist/esm/Actions/Button/types.d.ts +30 -9
- package/dist/esm/Actions/Button/types.js +1 -0
- package/dist/esm/Actions/ButtonGroup/ButtonGroup.d.ts +6 -1
- package/dist/esm/Actions/Switch/Switch.d.ts +21 -1
- package/dist/esm/Actions/Switch/SwitchOption.d.ts +9 -0
- package/dist/esm/Actions/Switch/types.d.ts +2 -1
- package/dist/esm/Actions/Switch/types.js +1 -1
- package/dist/esm/Actions/ToggleButton/ToggleButton.d.ts +9 -0
- package/dist/esm/Actions/ToggleButton/ToggleButtonBase.d.ts +33 -2
- package/dist/esm/Actions/ToggleButton/ToggleButtonBase.js +1 -1
- package/dist/esm/Actions/ToggleGroup/ToggleGroup.d.ts +18 -6
- package/dist/esm/Avatars/ApplicationAvatar/ApplicationAvatar.d.ts +10 -3
- package/dist/esm/Avatars/UserAvatar/UserAvatar.d.ts +13 -5
- package/dist/esm/Avatars/types.d.ts +23 -1
- package/dist/esm/Avatars/types.js +1 -1
- package/dist/esm/Fields/AutoComplete/components/AutoCompleteEmptyState.d.ts +6 -2
- package/dist/esm/Fields/AutoComplete/types.d.ts +144 -5
- package/dist/esm/Fields/Checkbox/Checkbox.d.ts +5 -2
- package/dist/esm/Fields/DateInput/DateInput.d.ts +47 -0
- package/dist/esm/Fields/DateInput/DateInput.js +162 -0
- package/dist/esm/Fields/DateInput/index.d.ts +1 -0
- package/dist/esm/Fields/DateInput/index.js +1 -0
- package/dist/esm/Fields/DatePicker/DatePicker/DatePicker.d.ts +42 -0
- package/dist/esm/Fields/DatePicker/DatePicker/DatePicker.js +1 -0
- package/dist/esm/Fields/DatePicker/DateRangePicker/DateRangePicker.d.ts +36 -0
- package/dist/esm/Fields/DatePicker/DateRangePicker/DateRangePicker.js +1 -0
- package/dist/esm/Fields/DatePicker/components/Popover.d.ts +1 -0
- package/dist/esm/Fields/DatePicker/components/Popover.js +5 -1
- package/dist/esm/Fields/DatePicker/types.d.ts +21 -0
- package/dist/esm/Fields/Dropzone/Dropzone.d.ts +85 -6
- package/dist/esm/Fields/Field/Field.d.ts +32 -9
- package/dist/esm/Fields/Form/stories/Complex.js +23 -13
- package/dist/esm/Fields/Input/Input.d.ts +18 -1
- package/dist/esm/Fields/Input/Input.js +5 -3
- package/dist/esm/Fields/RadioGroup/RadioButton.d.ts +68 -2
- package/dist/esm/Fields/RadioGroup/RadioGroup.d.ts +27 -10
- package/dist/esm/Fields/RadioGroup/RadioGroup.js +20 -77
- package/dist/esm/Fields/RadioGroup/RadioGroupItem.d.ts +20 -0
- package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +64 -0
- package/dist/esm/Fields/RadioGroup/index.d.ts +1 -0
- package/dist/esm/Fields/RadioGroup/index.js +2 -1
- package/dist/esm/Fields/RangeSlider/RangeSlider.d.ts +48 -3
- package/dist/esm/Fields/Select/Select.d.ts +3 -0
- package/dist/esm/Fields/TextArea/TextArea.d.ts +16 -0
- package/dist/esm/Fields/Toggle/Toggle.d.ts +51 -3
- package/dist/esm/Fields/index.d.ts +1 -0
- package/dist/esm/Fields/index.js +1 -0
- package/dist/esm/Helpers/ClickAwayContainer/ClickAwayContainer.d.ts +6 -4
- package/dist/esm/Helpers/HelpUnderline/HelpUnderline.d.ts +9 -1
- package/dist/esm/Helpers/Medallion/Medallion.d.ts +14 -1
- package/dist/esm/Helpers/Medallion/Medallion.js +11 -10
- package/dist/esm/Helpers/Medallion/Medallion.tailwind.js +1 -1
- package/dist/esm/Helpers/Medallion/types.d.ts +1 -1
- package/dist/esm/Helpers/Separator/Separator.d.ts +10 -0
- package/dist/esm/Helpers/TextWrap/TextWrap.d.ts +8 -2
- package/dist/esm/Helpers/TextWrap/TextWrap.js +1 -1
- package/dist/esm/Helpers/UserContent/UserContent.d.ts +10 -1
- package/dist/esm/Icons/index.d.ts +1 -1
- package/dist/esm/Icons/index.js +1 -1
- package/dist/esm/Indicators/Badge/Badge.d.ts +6 -2
- package/dist/esm/Indicators/Tag/Tag.tailwind.js +13 -4
- package/dist/esm/Navigation/Stepper/Step.js +28 -25
- package/dist/esm/Overlay/MenuButton/components/CustomTrigger.d.ts +1 -1
- package/dist/esm/Overlay/MenuButton/components/CustomTrigger.js +12 -4
- package/dist/esm/Overlay/Popover/types.d.ts +4 -0
- package/dist/esm/Overlay/Tooltip/types.d.ts +3 -0
- package/dist/esm/Satellite/locale.d.ts +2 -1
- package/dist/satellite.min.css +1 -1
- package/package.json +3 -3
@@ -17,7 +17,7 @@ var _uniqueId = require("../../utils/uniqueId");
|
|
17
17
|
var _StepperContext = require("./StepperContext");
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
19
19
|
var _excluded = ["className", "index", "icon", "label", "name", "completed", "disabled"];
|
20
|
-
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;
|
20
|
+
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, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38;
|
21
21
|
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; }
|
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 BUTTON_SIZE_CLASSNAMES = {
|
@@ -25,15 +25,20 @@ var BUTTON_SIZE_CLASSNAMES = {
|
|
25
25
|
"default": (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["px-3 py-2.5"]))),
|
26
26
|
large: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["p-4"])))
|
27
27
|
};
|
28
|
-
var
|
29
|
-
small: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["
|
30
|
-
"default": (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["
|
31
|
-
large: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["
|
28
|
+
var CONNECTOR_VERTICAL_SIZE_CLASSNAMES = {
|
29
|
+
small: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["h-[34px]"]))),
|
30
|
+
"default": (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["h-[37px]"]))),
|
31
|
+
large: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["h-[41px]"])))
|
32
|
+
};
|
33
|
+
var CONNECTOR_HORIZONTAL_SIZE_CLASSNAMES = {
|
34
|
+
small: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["w-[124px]"]))),
|
35
|
+
"default": (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["w-[120px]"]))),
|
36
|
+
large: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["w-[112px]"])))
|
32
37
|
};
|
33
38
|
var ICON_SIZE_CLASSNAMES = {
|
34
|
-
small: (0, _satellitePrefixer["default"])(
|
35
|
-
"default": (0, _satellitePrefixer["default"])(
|
36
|
-
large: (0, _satellitePrefixer["default"])(
|
39
|
+
small: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["w-5 h-5"]))),
|
40
|
+
"default": (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["w-6 h-6"]))),
|
41
|
+
large: (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["w-8 h-8"])))
|
37
42
|
};
|
38
43
|
var ICON_SIZE = {
|
39
44
|
small: 12,
|
@@ -64,18 +69,16 @@ var Step = exports.Step = function Step(_ref) {
|
|
64
69
|
var completedLocale = typeof locale.completedStep === "function" ? locale.completedStep(stepName) : locale.completedStep;
|
65
70
|
var incompletedLocale = typeof locale.incompletedStep === "function" ? locale.incompletedStep(stepName) : locale.incompletedStep;
|
66
71
|
var isVertical = context.orientation === "vertical";
|
67
|
-
var
|
68
|
-
|
69
|
-
Icon = CheckIconInternal;
|
70
|
-
}
|
72
|
+
var isHorizontal = context.orientation === "horizontal";
|
73
|
+
var Icon = completed && !active ? CheckIconInternal : CustomIcon;
|
71
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", _objectSpread(_objectSpread({}, props), {}, {
|
72
|
-
className: (0, _clsx["default"])(className, (0, _satellitePrefixer["default"])(
|
75
|
+
className: (0, _clsx["default"])(className, (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["text-grey-600 group/step"])))),
|
73
76
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
74
77
|
type: "button",
|
75
78
|
id: buttonId,
|
76
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(
|
77
|
-
//
|
78
|
-
|
79
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["relative w-full flex items-center text-left gap-2 rounded group/button"]))), (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["focus-visible:outline-none"]))), (0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["before:absolute before:inset-0 before:z-20 before:rounded before:outline before:outline-2 before:-outline-offset-2 before:outline-transparent focus-visible:before:outline-accent-600"]))),
|
80
|
+
// Ensure focus outline is above the connector lines
|
81
|
+
isHorizontal && (0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["flex-col min-w-36"]))), disabled ? (0, _satellitePrefixer["default"])(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["cursor-not-allowed"]))) : (0, _satellitePrefixer["default"])(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2["default"])(["hover:bg-grey-100"]))), BUTTON_SIZE_CLASSNAMES[context.size]),
|
79
82
|
"aria-label": disabled ? disabledLocale : active ? activeLocale : completed ? completedLocale : incompletedLocale,
|
80
83
|
"aria-current": active ? "step" : undefined,
|
81
84
|
disabled: disabled,
|
@@ -96,21 +99,21 @@ var Step = exports.Step = function Step(_ref) {
|
|
96
99
|
}
|
97
100
|
}
|
98
101
|
},
|
99
|
-
children: [
|
100
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(
|
101
|
-
|
102
|
-
|
103
|
-
|
102
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
103
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2["default"])(["rounded-full flex items-center justify-center shrink-0 text-sm relative z-10"]))), !active && !completed && (0, _satellitePrefixer["default"])(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100"]))), !active && !completed && !disabled && (0, _satellitePrefixer["default"])(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2["default"])(["group-hover/button:bg-white"]))), active && (0, _satellitePrefixer["default"])(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-800 text-white"]))), completed && (0, _satellitePrefixer["default"])(_templateObject24 || (_templateObject24 = (0, _taggedTemplateLiteral2["default"])(["bg-green-600 text-white"]))), ICON_SIZE_CLASSNAMES[context.size]),
|
104
|
+
children: [context.connectors && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
105
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject25 || (_templateObject25 = (0, _taggedTemplateLiteral2["default"])(["group-last/step:hidden absolute"]))), isVertical && (0, _satellitePrefixer["default"])(_templateObject26 || (_templateObject26 = (0, _taggedTemplateLiteral2["default"])(["w-px bottom-0 translate-y-full"]))), isHorizontal && (0, _satellitePrefixer["default"])(_templateObject27 || (_templateObject27 = (0, _taggedTemplateLiteral2["default"])(["h-px right-0 translate-x-full"]))), isVertical && CONNECTOR_VERTICAL_SIZE_CLASSNAMES[context.size], isHorizontal && CONNECTOR_HORIZONTAL_SIZE_CLASSNAMES[context.size], completed ? (0, _satellitePrefixer["default"])(_templateObject28 || (_templateObject28 = (0, _taggedTemplateLiteral2["default"])(["bg-green-600"]))) : (0, _satellitePrefixer["default"])(_templateObject29 || (_templateObject29 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-200"]))))
|
106
|
+
}), Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
104
107
|
width: ICON_SIZE[context.size],
|
105
108
|
height: ICON_SIZE[context.size]
|
106
|
-
}) : index + 1
|
109
|
+
}) : index + 1]
|
107
110
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
108
|
-
className: (0, _clsx["default"])(disabled && (0, _satellitePrefixer["default"])(
|
111
|
+
className: (0, _clsx["default"])(disabled && (0, _satellitePrefixer["default"])(_templateObject30 || (_templateObject30 = (0, _taggedTemplateLiteral2["default"])(["text-grey-300"]))), isHorizontal && (0, _satellitePrefixer["default"])(_templateObject31 || (_templateObject31 = (0, _taggedTemplateLiteral2["default"])(["text-center"])))),
|
109
112
|
children: [!!label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
110
|
-
className: (0, _satellitePrefixer["default"])(
|
113
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject32 || (_templateObject32 = (0, _taggedTemplateLiteral2["default"])(["text-sm line-clamp-1"]))), isHorizontal && !disabled && (0, _satellitePrefixer["default"])(_templateObject33 || (_templateObject33 = (0, _taggedTemplateLiteral2["default"])(["group-hover/button:text-grey-900"]))), disabled && (0, _satellitePrefixer["default"])(_templateObject34 || (_templateObject34 = (0, _taggedTemplateLiteral2["default"])(["text-grey-300"])))),
|
111
114
|
children: label
|
112
115
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
113
|
-
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(
|
116
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject35 || (_templateObject35 = (0, _taggedTemplateLiteral2["default"])(["text-base line-clamp-2"]))), (completed || active) && (0, _satellitePrefixer["default"])(_templateObject36 || (_templateObject36 = (0, _taggedTemplateLiteral2["default"])(["text-grey-900"]))), isHorizontal && !disabled && (0, _satellitePrefixer["default"])(_templateObject37 || (_templateObject37 = (0, _taggedTemplateLiteral2["default"])(["group-hover/button:text-grey-900"]))), context.size === "small" && (0, _satellitePrefixer["default"])(_templateObject38 || (_templateObject38 = (0, _taggedTemplateLiteral2["default"])(["text-sm"])))),
|
114
117
|
children: name
|
115
118
|
})]
|
116
119
|
})]
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import type { DropdownMenuTriggerProps } from "@radix-ui/react-dropdown-menu";
|
2
|
-
import type
|
2
|
+
import { type FC } from "react";
|
3
3
|
export declare type CustomTriggerProps = Omit<DropdownMenuTriggerProps, "asChild">;
|
4
4
|
export declare const CustomTrigger: FC<CustomTriggerProps>;
|
@@ -7,17 +7,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports.CustomTrigger = void 0;
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
|
-
var
|
11
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
12
11
|
var DropdownMenu = _interopRequireWildcard(require("@radix-ui/react-dropdown-menu"));
|
12
|
+
var _react = require("react");
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
14
|
+
var _excluded = ["children"];
|
14
15
|
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); }
|
15
16
|
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; }
|
16
17
|
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; }
|
17
18
|
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; }
|
18
19
|
var CustomTrigger = exports.CustomTrigger = function CustomTrigger(_ref) {
|
19
|
-
var
|
20
|
+
var children = _ref.children,
|
21
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
22
|
+
var childElement = _react.Children.only(children);
|
23
|
+
if (process.env.NODE_ENV !== "production" && typeof props.disabled !== "undefined" && typeof childElement.props.disabled !== "undefined" && props.disabled !== childElement.props.disabled) {
|
24
|
+
console.warn("'disabled' prop is defined for both MenuButton.CustomTrigger and its child with different values. The disabled prop value from child element will take precedence.");
|
25
|
+
}
|
20
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DropdownMenu.Trigger, _objectSpread(_objectSpread({}, props), {}, {
|
21
|
-
|
27
|
+
disabled: childElement.props.disabled,
|
28
|
+
asChild: true,
|
29
|
+
children: children
|
22
30
|
}));
|
23
31
|
};
|
@@ -73,6 +73,10 @@ interface PopoverPropsBase extends Omit<HTMLAttributes<HTMLDivElement>, "title"
|
|
73
73
|
* Defines the locale of the `Popover`.
|
74
74
|
*/
|
75
75
|
locale?: PopoverLocale;
|
76
|
+
/**
|
77
|
+
* Used to force mounting when more control is needed.
|
78
|
+
*/
|
79
|
+
forceMount?: true | undefined;
|
76
80
|
}
|
77
81
|
declare type PopoverPropsWithTitle = {
|
78
82
|
/**
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { UserAvatarLocale } from "../Avatars";
|
2
|
-
import type { AutoCompleteLocale, DatePickerLocale, DropzoneLocale, ExperimentalFormLocale, InputPropsLocale } from "../Fields";
|
2
|
+
import type { AutoCompleteLocale, DateInputLocale, DatePickerLocale, DropzoneLocale, ExperimentalFormLocale, InputPropsLocale } from "../Fields";
|
3
3
|
import type { AnnouncementBadgeLocale, TagLocale, ToastLocale, ToastsLocale } from "../Indicators";
|
4
4
|
import type { DataTableLocale, SidebarLocale } from "../Layout";
|
5
5
|
import type { CompactPaginationLocale, DotPaginationLocale, PaginationLocale, StepperLocale } from "../Navigation";
|
@@ -8,6 +8,7 @@ export declare type ComponentsLocales = {
|
|
8
8
|
announcementBadge?: AnnouncementBadgeLocale;
|
9
9
|
autoComplete?: AutoCompleteLocale;
|
10
10
|
compactPagination?: CompactPaginationLocale;
|
11
|
+
dateInput?: DateInputLocale;
|
11
12
|
dataTable?: DataTableLocale;
|
12
13
|
datePicker?: DatePickerLocale;
|
13
14
|
dotPagination?: DotPaginationLocale;
|
@@ -2,34 +2,37 @@ import * as RadixAccordion from "@radix-ui/react-accordion";
|
|
2
2
|
import type { ReactNode, VFC } from "react";
|
3
3
|
import type { IconComponentType } from "../../Icons";
|
4
4
|
declare type AccordionSharedProps = {
|
5
|
+
/**
|
6
|
+
* The content of the `Accordion`.
|
7
|
+
*/
|
5
8
|
children: ReactNode;
|
6
9
|
/**
|
7
|
-
*
|
10
|
+
* The class name of the `Accordion`.
|
8
11
|
*/
|
9
12
|
className?: string;
|
10
13
|
/**
|
11
|
-
*
|
14
|
+
* Whether the `Accordion` is disabled, preventing the user from interacting with the accordion and all its items.
|
12
15
|
*/
|
13
16
|
disabled?: boolean;
|
14
17
|
};
|
15
18
|
declare type AccordionSingleProps = {
|
16
19
|
/**
|
17
|
-
*
|
20
|
+
* Whether a single or multiple items can be expanded at a time.
|
18
21
|
* @default false
|
19
22
|
*/
|
20
23
|
multiple?: false;
|
21
24
|
/**
|
22
|
-
*
|
25
|
+
* The controlled value of the item to expand when `multiple` is `false`.
|
23
26
|
* Must be used in conjunction with `onValueChange`.
|
24
27
|
*/
|
25
28
|
value?: RadixAccordion.AccordionSingleProps["value"];
|
26
29
|
/**
|
27
|
-
*
|
30
|
+
* The value of the item to expand when initially rendered and `multiple` is `false`.
|
28
31
|
* Use when you do not need to control the state of the items.
|
29
32
|
*/
|
30
33
|
defaultValue?: RadixAccordion.AccordionSingleProps["defaultValue"];
|
31
34
|
/**
|
32
|
-
*
|
35
|
+
* The event handler called when the expanded state of an item changes and `multiple` is `false`.
|
33
36
|
*/
|
34
37
|
onChange?: RadixAccordion.AccordionSingleProps["onValueChange"];
|
35
38
|
/**
|
@@ -40,22 +43,22 @@ declare type AccordionSingleProps = {
|
|
40
43
|
};
|
41
44
|
declare type AccordionMultipleProps = {
|
42
45
|
/**
|
43
|
-
*
|
46
|
+
* Whether a single or multiple items can be expanded at a time.
|
44
47
|
* @default false
|
45
48
|
*/
|
46
49
|
multiple: true;
|
47
50
|
/**
|
48
|
-
*
|
51
|
+
* The controlled value of the item to expand when `multiple` is `true`.
|
49
52
|
* Must be used in conjunction with `onValueChange`.
|
50
53
|
*/
|
51
54
|
value?: RadixAccordion.AccordionMultipleProps["value"];
|
52
55
|
/**
|
53
|
-
*
|
56
|
+
* The value of the item to expand when initially rendered when `multiple` is `true`.
|
54
57
|
* Use when you do not need to control the state of the items.
|
55
58
|
*/
|
56
59
|
defaultValue?: RadixAccordion.AccordionMultipleProps["defaultValue"];
|
57
60
|
/**
|
58
|
-
*
|
61
|
+
* The event handler called when the expanded state of an item changes and `multiple` is `true`.
|
59
62
|
*/
|
60
63
|
onChange?: RadixAccordion.AccordionMultipleProps["onValueChange"];
|
61
64
|
/**
|
@@ -65,27 +68,30 @@ declare type AccordionMultipleProps = {
|
|
65
68
|
};
|
66
69
|
export declare type AccordionProps = AccordionSharedProps & (AccordionSingleProps | AccordionMultipleProps);
|
67
70
|
export declare type AccordionItemProps = {
|
71
|
+
/**
|
72
|
+
* Defines the content of the `AccordionItem`.
|
73
|
+
*/
|
68
74
|
children: ReactNode;
|
69
75
|
/**
|
70
|
-
* Defines a class name for the
|
76
|
+
* Defines a class name for the `AccordionItem`.
|
71
77
|
*/
|
72
78
|
className?: string;
|
73
79
|
/**
|
74
|
-
* Defines a unique value for the
|
80
|
+
* Defines a unique value for the `AccordionItem`.
|
75
81
|
*/
|
76
82
|
value: string;
|
77
83
|
/**
|
78
|
-
* Defines whether the
|
84
|
+
* Defines whether the `AccordionItem` is disabled, preventing the user from interacting with it.
|
79
85
|
*/
|
80
86
|
disabled?: boolean;
|
81
87
|
};
|
82
88
|
export declare type AccordionHeaderProps = {
|
83
89
|
/**
|
84
|
-
* Defines the title of the
|
90
|
+
* Defines the title of the `AccordionHeader`.
|
85
91
|
*/
|
86
92
|
children: ReactNode;
|
87
93
|
/**
|
88
|
-
* Defines a class name for the
|
94
|
+
* Defines a class name for the `AccordionHeader`.
|
89
95
|
*/
|
90
96
|
className?: string;
|
91
97
|
/**
|
@@ -101,11 +107,11 @@ export declare type AccordionHeaderProps = {
|
|
101
107
|
*/
|
102
108
|
iconBgClassName?: string;
|
103
109
|
/**
|
104
|
-
* Defines a description for the
|
110
|
+
* Defines a description for the `AccordionHeader`.
|
105
111
|
*/
|
106
112
|
description?: ReactNode;
|
107
113
|
/**
|
108
|
-
* Defines a meta value for the
|
114
|
+
* Defines a meta value for the `AccordionHeader`.
|
109
115
|
*/
|
110
116
|
meta?: ReactNode;
|
111
117
|
/**
|
@@ -119,9 +125,12 @@ export declare type AccordionHeaderProps = {
|
|
119
125
|
triggerClassName?: string;
|
120
126
|
};
|
121
127
|
export declare type AccordionContentProps = {
|
128
|
+
/**
|
129
|
+
* Defines the content of the `AccordionContent`.
|
130
|
+
*/
|
122
131
|
children: ReactNode;
|
123
132
|
/**
|
124
|
-
* Defines a class name for the
|
133
|
+
* Defines a class name for the `AccordionContent`.
|
125
134
|
*/
|
126
135
|
className?: string;
|
127
136
|
};
|
@@ -1,10 +1,6 @@
|
|
1
|
-
import _rgba from "../../styles/rgba";
|
2
|
-
import _disabledColor from "../../styles/disabledColor";
|
3
1
|
import _plugin from "tailwindcss/plugin";
|
4
2
|
// @ts-check
|
5
3
|
var plugin = _plugin;
|
6
|
-
var disabledColor = _disabledColor;
|
7
|
-
var rgba = _rgba;
|
8
4
|
var buttonPlugin = plugin(function (_ref) {
|
9
5
|
var addComponents = _ref.addComponents,
|
10
6
|
theme = _ref.theme;
|
@@ -25,83 +21,58 @@ var buttonPlugin = plugin(function (_ref) {
|
|
25
21
|
".btn-subtle": {
|
26
22
|
color: theme("colors.accent.600"),
|
27
23
|
"&:hover": {
|
28
|
-
backgroundColor:
|
24
|
+
backgroundColor: theme("colors.grey.100")
|
29
25
|
},
|
30
26
|
"&:active, &.btn-active": {
|
31
|
-
|
32
|
-
backgroundColor: theme("colors.accent.100"),
|
33
|
-
boxShadow: "none"
|
27
|
+
backgroundColor: theme("colors.grey.200")
|
34
28
|
},
|
35
29
|
"&:disabled, &.btn-disabled": {
|
36
30
|
background: "none",
|
37
|
-
boxShadow: "none",
|
38
31
|
color: theme("colors.grey.300")
|
39
32
|
}
|
40
33
|
},
|
41
34
|
".btn-neutral": {
|
42
35
|
color: theme("colors.grey.900"),
|
43
36
|
backgroundColor: theme("colors.white"),
|
44
|
-
backgroundImage: "linear-gradient(-180deg, ".concat(theme("colors.white"), " 0%, ").concat(theme("colors.grey.50"), " 100%)"),
|
45
37
|
border: "1px solid ".concat(theme("colors.grey.200")),
|
46
|
-
boxShadow: "0 1px 0 0 ".concat(theme("colors.shadow.5")),
|
47
38
|
"&:hover": {
|
48
|
-
|
49
|
-
|
39
|
+
backgroundColor: theme("colors.grey.100")
|
40
|
+
},
|
41
|
+
"&:focus-visible": {
|
42
|
+
borderColor: "transparent"
|
50
43
|
},
|
51
44
|
"&:active, &.btn-active": {
|
52
|
-
|
53
|
-
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 ")
|
45
|
+
backgroundColor: theme("colors.grey.200")
|
54
46
|
},
|
55
47
|
"&:disabled, &.btn-disabled": {
|
56
|
-
|
57
|
-
|
58
|
-
color: theme("colors.grey.300"),
|
59
|
-
boxShadow: "none"
|
48
|
+
backgroundColor: theme("colors.grey.50"),
|
49
|
+
color: theme("colors.grey.300")
|
60
50
|
}
|
61
51
|
},
|
62
52
|
".btn-primary": {
|
63
53
|
color: theme("colors.white"),
|
64
54
|
backgroundColor: theme("colors.accent.600"),
|
65
|
-
backgroundImage: "linear-gradient(-180deg, ".concat(theme("colors.accent.600"), " 0%, ").concat(theme("colors.accent.700"), " 100%)"),
|
66
|
-
border: "1px solid ".concat(theme("colors.accent.700")),
|
67
|
-
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 "),
|
68
55
|
"&:hover": {
|
69
|
-
|
70
|
-
backgroundImage: "linear-gradient(0deg, ".concat(theme("colors.accent.800"), " 0%, ").concat(theme("colors.accent.700"), " 100%)"),
|
71
|
-
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 ")
|
56
|
+
backgroundColor: theme("colors.accent.700")
|
72
57
|
},
|
73
58
|
"&:active, &.btn-active": {
|
74
|
-
backgroundColor: theme("colors.accent.
|
75
|
-
borderColor: theme("colors.accent.800"),
|
76
|
-
boxShadow: "\n inset 0 1px 4px 0 ".concat(rgba(theme("colors.accent.900"), 0.4), ",\n inset 0 1px 1px 0 ").concat(rgba(theme("colors.accent.900"), 0.6), ",\n 0 1px 0 0 ").concat(theme("colors.shadow.5"), "\n ")
|
59
|
+
backgroundColor: theme("colors.accent.800")
|
77
60
|
},
|
78
61
|
"&:disabled, &.btn-disabled": {
|
79
|
-
backgroundColor:
|
80
|
-
backgroundImage: "\n linear-gradient(0deg, ".concat(disabledColor(theme("colors.accent.600")), " 0%,\n ").concat(disabledColor(theme("colors.accent.700")), " 100%)\n "),
|
81
|
-
borderColor: disabledColor(theme("colors.accent.700")),
|
82
|
-
boxShadow: "none"
|
62
|
+
backgroundColor: theme("colors.accent.200")
|
83
63
|
}
|
84
64
|
},
|
85
65
|
".btn-destructive": {
|
86
66
|
color: theme("colors.white"),
|
87
67
|
backgroundColor: theme("colors.red.600"),
|
88
|
-
backgroundImage: "linear-gradient(-180deg, ".concat(theme("colors.red.600"), " 0%, ").concat(theme("colors.red.700"), " 100%)"),
|
89
|
-
border: "1px solid ".concat(theme("colors.red.700")),
|
90
|
-
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 "),
|
91
68
|
"&:hover": {
|
92
|
-
|
93
|
-
borderColor: theme("colors.red.800"),
|
94
|
-
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 ")
|
69
|
+
backgroundColor: theme("colors.red.700")
|
95
70
|
},
|
96
71
|
"&:active, &.btn-active": {
|
97
|
-
|
98
|
-
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 ")
|
72
|
+
backgroundColor: theme("colors.red.800")
|
99
73
|
},
|
100
74
|
"&:disabled, &.btn-disabled": {
|
101
|
-
backgroundColor:
|
102
|
-
backgroundImage: "\n linear-gradient(0deg, ".concat(disabledColor(theme("colors.red.600")), " 0%,\n ").concat(disabledColor(theme("colors.red.700")), " 100%)\n "),
|
103
|
-
borderColor: disabledColor(theme("colors.red.700")),
|
104
|
-
boxShadow: "none"
|
75
|
+
backgroundColor: theme("colors.red.300")
|
105
76
|
}
|
106
77
|
}
|
107
78
|
});
|
@@ -114,6 +85,18 @@ var buttonPlugin = plugin(function (_ref) {
|
|
114
85
|
"& > .btn:not(:first-child):not(:last-child), & > :not(:first-child):not(:last-child) .btn": {
|
115
86
|
borderRadius: "0px"
|
116
87
|
},
|
88
|
+
"& > .btn-destructive:not(:first-child), & > :not(:first-child) .btn-destructive": {
|
89
|
+
borderLeft: "1px solid ".concat(theme("colors.red.700"))
|
90
|
+
},
|
91
|
+
"& > .btn-destructive:not(:last-child), & > :not(:last-child) .btn-destructive": {
|
92
|
+
borderRight: "1px solid ".concat(theme("colors.red.700"))
|
93
|
+
},
|
94
|
+
"& > .btn-primary:not(:first-child), & > :not(:first-child) .btn-primary": {
|
95
|
+
borderLeft: "1px solid ".concat(theme("colors.accent.700"))
|
96
|
+
},
|
97
|
+
"& > .btn-primary:not(:last-child), & > :not(:last-child) .btn-primary": {
|
98
|
+
borderRight: "1px solid ".concat(theme("colors.accent.700"))
|
99
|
+
},
|
117
100
|
"& > .btn:first-child, & > :first-child .btn": {
|
118
101
|
borderTopRightRadius: "0px",
|
119
102
|
borderBottomRightRadius: "0px"
|
@@ -3,19 +3,48 @@ import type { IconComponentType } from "../../Icons";
|
|
3
3
|
import type { TooltipWrapperBaseProps } from "../../Overlay/Tooltip/types";
|
4
4
|
import type { ButtonSize, ButtonVariant, PolymorphicComponentPropWithRef } from "./types";
|
5
5
|
export interface IconButtonBaseProps {
|
6
|
-
/**
|
6
|
+
/**
|
7
|
+
* The variant of the `IconButton`.
|
8
|
+
* @default neutral
|
9
|
+
*/
|
7
10
|
variant?: ButtonVariant;
|
8
|
-
/**
|
11
|
+
/**
|
12
|
+
* The size of the `IconButton`.
|
13
|
+
* @default medium
|
14
|
+
*/
|
9
15
|
size?: ButtonSize;
|
10
|
-
/**
|
16
|
+
/**
|
17
|
+
* Whether the `IconButton` is disabled.
|
18
|
+
* @default false
|
19
|
+
*/
|
11
20
|
disabled?: boolean;
|
21
|
+
/**
|
22
|
+
* The icon to display.
|
23
|
+
*/
|
12
24
|
icon: IconComponentType;
|
25
|
+
/**
|
26
|
+
* The title used for the tooltip.
|
27
|
+
*/
|
13
28
|
title: string;
|
29
|
+
/**
|
30
|
+
* Whether to show the tooltip.
|
31
|
+
* @default false
|
32
|
+
*/
|
14
33
|
showTooltip?: boolean;
|
15
|
-
/**
|
34
|
+
/**
|
35
|
+
* The side of the tooltip.
|
36
|
+
* @default top
|
37
|
+
*/
|
16
38
|
tooltipSide?: TooltipWrapperBaseProps["side"];
|
17
|
-
/**
|
39
|
+
/**
|
40
|
+
* Whether the `IconButton` is loading.
|
41
|
+
* @default false
|
42
|
+
*/
|
18
43
|
loading?: boolean;
|
44
|
+
/**
|
45
|
+
* The class name of the `IconButton`.
|
46
|
+
*/
|
47
|
+
className?: string;
|
19
48
|
}
|
20
49
|
export declare type PolymorphicIconButtonProps<C extends React.ElementType> = PolymorphicComponentPropWithRef<C, IconButtonBaseProps>;
|
21
50
|
declare type PolymorphicIconButtonComponent = (<C extends React.ElementType = "button">(props: PolymorphicIconButtonProps<C>) => React.ReactElement | null) & {
|
@@ -1,23 +1,44 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
import type { IconComponentType } from "../../Icons";
|
3
3
|
export declare type ButtonVariant = "subtle" | "neutral" | "primary" | "destructive";
|
4
|
-
export declare
|
4
|
+
export declare const buttonSizes: readonly ["small", "medium", "large"];
|
5
|
+
export declare type ButtonSize = (typeof buttonSizes)[number];
|
5
6
|
export interface ButtonBaseProps {
|
6
|
-
/**
|
7
|
+
/**
|
8
|
+
* The variant of the `Button`.
|
9
|
+
* @default neutral
|
10
|
+
*/
|
7
11
|
variant?: ButtonVariant;
|
8
|
-
/**
|
12
|
+
/**
|
13
|
+
* The size of the `Button`.
|
14
|
+
* @default medium
|
15
|
+
*/
|
9
16
|
size?: ButtonSize;
|
10
|
-
/**
|
17
|
+
/**
|
18
|
+
* The left aligned icon of the `Button`.
|
19
|
+
*/
|
11
20
|
startIcon?: IconComponentType;
|
12
|
-
/**
|
21
|
+
/**
|
22
|
+
* The right aligned icon of the `Button`.
|
23
|
+
*/
|
13
24
|
endIcon?: IconComponentType;
|
14
|
-
/**
|
25
|
+
/**
|
26
|
+
* The content of the `Button`.
|
27
|
+
*/
|
15
28
|
children: ReactNode;
|
16
|
-
/**
|
29
|
+
/**
|
30
|
+
* Whether the `Button` is loading.
|
31
|
+
* @default false
|
32
|
+
*/
|
17
33
|
loading?: boolean;
|
18
|
-
/**
|
34
|
+
/**
|
35
|
+
* Whether the `Button` is disabled.
|
36
|
+
* @default false
|
37
|
+
*/
|
19
38
|
disabled?: boolean;
|
20
|
-
/**
|
39
|
+
/**
|
40
|
+
* The class name of the `Button`.
|
41
|
+
*/
|
21
42
|
className?: string;
|
22
43
|
}
|
23
44
|
export declare function isButtonType(props: any): props is JSX.IntrinsicElements["button"];
|
@@ -5,8 +5,13 @@ export interface ButtonGroupProps {
|
|
5
5
|
* @default div
|
6
6
|
*/
|
7
7
|
as?: keyof JSX.IntrinsicElements;
|
8
|
-
/**
|
8
|
+
/**
|
9
|
+
* The class name of the `ButtonGroup`.
|
10
|
+
*/
|
9
11
|
className?: string;
|
12
|
+
/**
|
13
|
+
* The content of the `ButtonGroup`.
|
14
|
+
*/
|
10
15
|
children: ReactNode;
|
11
16
|
}
|
12
17
|
/**
|
@@ -1,13 +1,33 @@
|
|
1
1
|
import type { ReactNode, VFC } from "react";
|
2
2
|
import type { SwitchSize } from "./types";
|
3
3
|
export interface SwitchProps {
|
4
|
-
/**
|
4
|
+
/**
|
5
|
+
* The class name of the `Switch`.
|
6
|
+
*/
|
5
7
|
className?: string;
|
8
|
+
/**
|
9
|
+
* The currently selected value.
|
10
|
+
*/
|
6
11
|
value: string;
|
12
|
+
/**
|
13
|
+
* Whether the `Switch` is disabled.
|
14
|
+
*/
|
7
15
|
disabled?: boolean;
|
16
|
+
/**
|
17
|
+
* Callback function called when the selected value changes.
|
18
|
+
*/
|
8
19
|
onChange: (value: string) => void;
|
20
|
+
/**
|
21
|
+
* The content of the `Switch`.
|
22
|
+
*/
|
9
23
|
children: ReactNode;
|
24
|
+
/**
|
25
|
+
* The size of the `Switch`.
|
26
|
+
*/
|
10
27
|
size?: SwitchSize;
|
28
|
+
/**
|
29
|
+
* Optional name attribute for the radio inputs.
|
30
|
+
*/
|
11
31
|
name?: string;
|
12
32
|
}
|
13
33
|
/**
|