@algolia/satellite 2.3.0-rc.5 → 2.3.0-rc.8
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/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
- package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
- package/dist/{esm/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → cjs/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
- package/dist/{esm/Layout → cjs}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
- package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
- package/dist/{esm/Layout → cjs}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
- package/dist/cjs/Chat/ChatMessages/ChatMessages.d.ts +141 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +32 -20
- package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
- package/dist/cjs/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
- package/dist/cjs/Fields/Checkbox/Checkbox.d.ts +2 -2
- package/dist/cjs/Fields/Checkbox/Checkbox.js +2 -2
- package/dist/cjs/Fields/Dropzone/Dropzone.js +1 -1
- package/dist/cjs/Fields/Form/stories/Complex.js +123 -50
- package/dist/cjs/Fields/RadioGroup/RadioButton.js +9 -2
- package/dist/cjs/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
- package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/cjs/Fields/SelectableCard/SelectableCard.d.ts +35 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCard.js +105 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardContext.js +15 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.js +55 -0
- package/dist/cjs/Fields/SelectableCard/index.d.ts +2 -0
- package/dist/cjs/Fields/SelectableCard/index.js +27 -0
- package/dist/cjs/Fields/Switch/Switch.js +1 -1
- package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
- package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
- package/dist/cjs/Fields/index.d.ts +1 -0
- package/dist/cjs/Fields/index.js +11 -0
- package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
- package/dist/cjs/Layout/index.d.ts +0 -1
- package/dist/cjs/Layout/index.js +0 -11
- package/dist/cjs/Satellite/locale.d.ts +3 -3
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/styles/helpers/tv.d.ts +5 -1
- package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
- package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
- package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
- package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
- package/dist/{cjs/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → esm/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
- package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
- package/dist/{cjs/Layout → esm}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
- package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
- package/dist/{cjs/Layout → esm}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
- package/dist/esm/Chat/ChatMessages/ChatMessages.d.ts +141 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +33 -20
- package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
- package/dist/esm/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
- package/dist/esm/Fields/Checkbox/Checkbox.d.ts +2 -2
- package/dist/esm/Fields/Checkbox/Checkbox.js +2 -2
- package/dist/esm/Fields/Dropzone/Dropzone.js +1 -1
- package/dist/esm/Fields/Form/stories/Complex.js +123 -50
- package/dist/esm/Fields/RadioGroup/RadioButton.js +10 -3
- package/dist/esm/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
- package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/esm/Fields/SelectableCard/SelectableCard.d.ts +35 -0
- package/dist/esm/Fields/SelectableCard/SelectableCard.js +100 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardContext.js +9 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardGroup.js +48 -0
- package/dist/esm/Fields/SelectableCard/index.d.ts +2 -0
- package/dist/esm/Fields/SelectableCard/index.js +2 -0
- package/dist/esm/Fields/Switch/Switch.js +1 -1
- package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
- package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
- package/dist/esm/Fields/index.d.ts +1 -0
- package/dist/esm/Fields/index.js +1 -0
- package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
- package/dist/esm/Layout/index.d.ts +0 -1
- package/dist/esm/Layout/index.js +0 -1
- package/dist/esm/Satellite/locale.d.ts +3 -3
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/styles/helpers/tv.d.ts +5 -1
- package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/satellite.min.css +1 -1
- package/package.json +3 -3
- package/dist/cjs/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
- package/dist/cjs/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
- package/dist/cjs/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
- package/dist/cjs/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
- package/dist/cjs/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
- package/dist/esm/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
- package/dist/esm/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
- package/dist/esm/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
- package/dist/esm/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
- package/dist/esm/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
- /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/types.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/types.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/types.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/types.js +0 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.SelectableCard = void 0;
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
11
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
12
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
13
|
+
var _react = require("react");
|
14
|
+
var _ = require("..");
|
15
|
+
var _Layout = require("../../Layout");
|
16
|
+
var _satellitePrefixer = _interopRequireDefault(require("../../styles/helpers/satellitePrefixer"));
|
17
|
+
var _SelectableCardContext = require("./SelectableCardContext");
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
19
|
+
var _excluded = ["value", "selectedColor", "children", "id", "className"];
|
20
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18; // We need to omit the `elevation` prop because we handle it ourselves.
|
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
|
+
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
|
+
var SELECTED_COLOR_CLASSNAMES = {
|
24
|
+
grey: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["border-grey-600"]))),
|
25
|
+
pink: (0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["border-pink-600"]))),
|
26
|
+
accent: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["border-accent-600"]))),
|
27
|
+
blue: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["border-blue-600"]))),
|
28
|
+
green: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["border-green-600"]))),
|
29
|
+
orange: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["border-orange-600"]))),
|
30
|
+
red: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["border-red-600"]))),
|
31
|
+
xenon: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["border-xenon-600"])))
|
32
|
+
};
|
33
|
+
var SelectableCard = exports.SelectableCard = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
34
|
+
var value = _ref.value,
|
35
|
+
_ref$selectedColor = _ref.selectedColor,
|
36
|
+
selectedColor = _ref$selectedColor === void 0 ? "xenon" : _ref$selectedColor,
|
37
|
+
children = _ref.children,
|
38
|
+
id = _ref.id,
|
39
|
+
className = _ref.className,
|
40
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
41
|
+
var _useSelectableCardCon = (0, _SelectableCardContext.useSelectableCardContext)(),
|
42
|
+
name = _useSelectableCardCon.name,
|
43
|
+
isControlled = _useSelectableCardCon.isControlled,
|
44
|
+
setValue = _useSelectableCardCon.setValue,
|
45
|
+
onValueChange = _useSelectableCardCon.onValueChange,
|
46
|
+
type = _useSelectableCardCon.type,
|
47
|
+
valueContext = _useSelectableCardCon.value,
|
48
|
+
disabledContext = _useSelectableCardCon.disabled;
|
49
|
+
var disabled = props.disabled || disabledContext;
|
50
|
+
var selected = valueContext === null || valueContext === void 0 ? void 0 : valueContext.includes(value);
|
51
|
+
var _useField = (0, _.useField)(),
|
52
|
+
status = _useField.state.status;
|
53
|
+
var isInvalid = status === "invalid";
|
54
|
+
var handleCheckboxChange = function handleCheckboxChange(evt) {
|
55
|
+
var _valueContext$filter;
|
56
|
+
var newValue = selected ? (_valueContext$filter = valueContext === null || valueContext === void 0 ? void 0 : valueContext.filter(function (v) {
|
57
|
+
return v !== value;
|
58
|
+
})) !== null && _valueContext$filter !== void 0 ? _valueContext$filter : [] : [].concat((0, _toConsumableArray2["default"])(valueContext !== null && valueContext !== void 0 ? valueContext : []), [value]);
|
59
|
+
if (!isControlled && !evt.isDefaultPrevented()) {
|
60
|
+
setValue(newValue);
|
61
|
+
}
|
62
|
+
onValueChange === null || onValueChange === void 0 || onValueChange(newValue);
|
63
|
+
};
|
64
|
+
var handleRadioButtonChange = function handleRadioButtonChange(evt) {
|
65
|
+
var newValue = [evt.target.value];
|
66
|
+
if (!isControlled && !evt.isDefaultPrevented()) {
|
67
|
+
setValue(newValue);
|
68
|
+
}
|
69
|
+
onValueChange === null || onValueChange === void 0 || onValueChange(newValue);
|
70
|
+
};
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Card, _objectSpread(_objectSpread({
|
72
|
+
ref: ref,
|
73
|
+
fullBleed: true,
|
74
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["relative border transition-[shadow,border]"]))), !disabled && !selected && !isInvalid && (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["border-transparent"]))),
|
75
|
+
// Disabled
|
76
|
+
disabled && (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100 border-grey-200 text-grey-300 shadow-none cursor-not-allowed [&>*]:text-grey-300"]))),
|
77
|
+
// Selected
|
78
|
+
selected && (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["card-z200"]))), !disabled && selected && !isInvalid && SELECTED_COLOR_CLASSNAMES[selectedColor],
|
79
|
+
// Hovered
|
80
|
+
!disabled && !selected && !isInvalid && (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["hover:border-grey-200"]))), // Focused
|
81
|
+
(0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["focusable-visible-within"]))), !selected && (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["focus-within:border-grey-200"]))),
|
82
|
+
// Invalid
|
83
|
+
isInvalid && (0, _satellitePrefixer["default"])(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["border-red-700 shadow-none"]))),
|
84
|
+
// Custom
|
85
|
+
className)
|
86
|
+
}, props), {}, {
|
87
|
+
children: [type === "multiple" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Checkbox, {
|
88
|
+
id: id,
|
89
|
+
disabled: disabled,
|
90
|
+
checked: selected,
|
91
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["absolute right-4 top-4 z-10"])))),
|
92
|
+
onChange: handleCheckboxChange,
|
93
|
+
name: name
|
94
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_.RadioButton, {
|
95
|
+
id: id,
|
96
|
+
disabled: disabled,
|
97
|
+
checked: selected,
|
98
|
+
className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["absolute right-4 top-4 z-10"])))),
|
99
|
+
onChange: handleRadioButtonChange,
|
100
|
+
value: value,
|
101
|
+
name: name
|
102
|
+
}), children]
|
103
|
+
}));
|
104
|
+
});
|
105
|
+
SelectableCard.displayName = "SelectableCard";
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
2
|
+
import type { SelectionTypes } from "./SelectableCardGroup";
|
3
|
+
export interface SelectableCardContextInterface {
|
4
|
+
value?: string[];
|
5
|
+
name?: string;
|
6
|
+
type: SelectionTypes;
|
7
|
+
isControlled: boolean;
|
8
|
+
setValue: Dispatch<SetStateAction<string[]>>;
|
9
|
+
onValueChange?: (value: string[]) => void;
|
10
|
+
disabled?: boolean;
|
11
|
+
}
|
12
|
+
export declare const SelectableCardContext: import("react").Context<SelectableCardContextInterface | null>;
|
13
|
+
export declare const useSelectableCardContext: () => SelectableCardContextInterface;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useSelectableCardContext = exports.SelectableCardContext = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var SelectableCardContext = exports.SelectableCardContext = /*#__PURE__*/(0, _react.createContext)(null);
|
9
|
+
var useSelectableCardContext = exports.useSelectableCardContext = function useSelectableCardContext() {
|
10
|
+
var context = (0, _react.useContext)(SelectableCardContext);
|
11
|
+
if (!context) {
|
12
|
+
throw new Error("useSelectableCardContext used outside SelectableCardContext");
|
13
|
+
}
|
14
|
+
return context;
|
15
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { type FC, type PropsWithChildren } from "react";
|
2
|
+
export declare type SelectionTypes = "multiple" | "single";
|
3
|
+
export declare type SelectableCardGroupProps = {
|
4
|
+
disabled?: boolean;
|
5
|
+
name?: string;
|
6
|
+
value?: string[];
|
7
|
+
defaultValue?: string[];
|
8
|
+
type: SelectionTypes;
|
9
|
+
onValueChange?: (value: string[]) => void;
|
10
|
+
className?: string;
|
11
|
+
required?: boolean;
|
12
|
+
};
|
13
|
+
export declare const SelectableCardGroup: FC<PropsWithChildren<SelectableCardGroupProps>>;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.SelectableCardGroup = void 0;
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
|
+
var _react = require("react");
|
10
|
+
var _ = require("..");
|
11
|
+
var _SelectableCardContext = require("./SelectableCardContext");
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
13
|
+
var SelectableCardGroup = exports.SelectableCardGroup = function SelectableCardGroup(_ref) {
|
14
|
+
var _ref2;
|
15
|
+
var children = _ref.children,
|
16
|
+
disabled = _ref.disabled,
|
17
|
+
name = _ref.name,
|
18
|
+
controlledValue = _ref.value,
|
19
|
+
defaultValue = _ref.defaultValue,
|
20
|
+
type = _ref.type,
|
21
|
+
onValueChange = _ref.onValueChange,
|
22
|
+
className = _ref.className,
|
23
|
+
required = _ref.required;
|
24
|
+
var isControlled = controlledValue !== undefined;
|
25
|
+
var _useState = (0, _react.useState)((_ref2 = controlledValue !== null && controlledValue !== void 0 ? controlledValue : defaultValue) !== null && _ref2 !== void 0 ? _ref2 : []),
|
26
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
27
|
+
internalValue = _useState2[0],
|
28
|
+
setInternalValue = _useState2[1];
|
29
|
+
var value = isControlled ? controlledValue : internalValue;
|
30
|
+
var _useField = (0, _.useField)({
|
31
|
+
required: required
|
32
|
+
}),
|
33
|
+
status = _useField.state.status,
|
34
|
+
labelId = _useField.labelId,
|
35
|
+
descriptionId = _useField.descriptionId;
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectableCardContext.SelectableCardContext.Provider, {
|
37
|
+
value: {
|
38
|
+
value: value,
|
39
|
+
setValue: setInternalValue,
|
40
|
+
isControlled: isControlled,
|
41
|
+
name: name,
|
42
|
+
disabled: disabled,
|
43
|
+
onValueChange: onValueChange,
|
44
|
+
type: type
|
45
|
+
},
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
47
|
+
role: type === "single" ? "radiogroup" : "group",
|
48
|
+
"aria-invalid": status === "invalid",
|
49
|
+
"aria-labelledby": labelId,
|
50
|
+
"aria-describedby": descriptionId,
|
51
|
+
className: className,
|
52
|
+
children: children
|
53
|
+
})
|
54
|
+
});
|
55
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
var _SelectableCard = require("./SelectableCard");
|
7
|
+
Object.keys(_SelectableCard).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _SelectableCard[key]) return;
|
10
|
+
Object.defineProperty(exports, key, {
|
11
|
+
enumerable: true,
|
12
|
+
get: function get() {
|
13
|
+
return _SelectableCard[key];
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
17
|
+
var _SelectableCardGroup = require("./SelectableCardGroup");
|
18
|
+
Object.keys(_SelectableCardGroup).forEach(function (key) {
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
20
|
+
if (key in exports && exports[key] === _SelectableCardGroup[key]) return;
|
21
|
+
Object.defineProperty(exports, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function get() {
|
24
|
+
return _SelectableCardGroup[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
@@ -83,7 +83,7 @@ var Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
83
83
|
role: "switch",
|
84
84
|
ref: ref
|
85
85
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
86
|
-
className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["switch focusable-sibling"])))
|
86
|
+
className: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["switch focusable-visible-sibling"])))
|
87
87
|
})]
|
88
88
|
});
|
89
89
|
});
|
@@ -2,17 +2,25 @@
|
|
2
2
|
import type { TextAreaProps } from "../../Fields/TextArea";
|
3
3
|
export declare type TextAreaAutoSizeProps = TextAreaProps & {
|
4
4
|
/**
|
5
|
-
* The maximum number of rows the `
|
6
|
-
* If set to 0, the `
|
5
|
+
* The maximum number of rows the `TextAreaAutoSize` can expand to when `autoResize` is enabled.
|
6
|
+
* If set to 0, the `TextAreaAutoSize` will expand indefinitely.
|
7
7
|
* @default 0
|
8
8
|
*/
|
9
9
|
maxRows?: number;
|
10
|
+
/**
|
11
|
+
* The number of rows the `TextAreaAutoSize` should start with.
|
12
|
+
*/
|
13
|
+
rows?: number;
|
10
14
|
};
|
11
15
|
export declare const TextAreaAutoSize: import("react").ForwardRefExoticComponent<TextAreaProps & {
|
12
16
|
/**
|
13
|
-
* The maximum number of rows the `
|
14
|
-
* If set to 0, the `
|
17
|
+
* The maximum number of rows the `TextAreaAutoSize` can expand to when `autoResize` is enabled.
|
18
|
+
* If set to 0, the `TextAreaAutoSize` will expand indefinitely.
|
15
19
|
* @default 0
|
16
20
|
*/
|
17
21
|
maxRows?: number | undefined;
|
22
|
+
/**
|
23
|
+
* The number of rows the `TextAreaAutoSize` should start with.
|
24
|
+
*/
|
25
|
+
rows?: number | undefined;
|
18
26
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
@@ -13,6 +13,12 @@ export declare const textAreaAutoSizeStyles: import("tailwind-variants").TVRetur
|
|
13
13
|
} | {}, {
|
14
14
|
base: string;
|
15
15
|
}, undefined, {
|
16
|
+
responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {} | undefined;
|
17
|
+
} & import("tailwind-variants/dist/config").TWMConfig & {
|
18
|
+
twMergeConfig: {
|
19
|
+
prefix: string;
|
20
|
+
};
|
21
|
+
}, {
|
16
22
|
[key: string]: {
|
17
23
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
18
24
|
base?: import("tailwind-merge").ClassNameValue;
|
@@ -22,4 +28,10 @@ export declare const textAreaAutoSizeStyles: import("tailwind-variants").TVRetur
|
|
22
28
|
base: string;
|
23
29
|
}, import("tailwind-variants").TVReturnType<unknown, {
|
24
30
|
base: string;
|
25
|
-
}, undefined, unknown,
|
31
|
+
}, undefined, import("tailwind-variants/dist/config").TVConfig<unknown, {
|
32
|
+
[key: string]: {
|
33
|
+
[key: string]: import("tailwind-merge").ClassNameValue | {
|
34
|
+
base?: import("tailwind-merge").ClassNameValue;
|
35
|
+
};
|
36
|
+
};
|
37
|
+
} | {}>, unknown, unknown, undefined>>;
|
package/dist/cjs/Fields/index.js
CHANGED
@@ -146,6 +146,17 @@ Object.keys(_Select).forEach(function (key) {
|
|
146
146
|
}
|
147
147
|
});
|
148
148
|
});
|
149
|
+
var _SelectableCard = require("./SelectableCard");
|
150
|
+
Object.keys(_SelectableCard).forEach(function (key) {
|
151
|
+
if (key === "default" || key === "__esModule") return;
|
152
|
+
if (key in exports && exports[key] === _SelectableCard[key]) return;
|
153
|
+
Object.defineProperty(exports, key, {
|
154
|
+
enumerable: true,
|
155
|
+
get: function get() {
|
156
|
+
return _SelectableCard[key];
|
157
|
+
}
|
158
|
+
});
|
159
|
+
});
|
149
160
|
var _Switch = require("./Switch");
|
150
161
|
Object.keys(_Switch).forEach(function (key) {
|
151
162
|
if (key === "default" || key === "__esModule") return;
|
@@ -7,7 +7,7 @@ var plugin = require("tailwindcss/plugin");
|
|
7
7
|
module.exports = plugin(function (_ref) {
|
8
8
|
var addComponents = _ref.addComponents,
|
9
9
|
theme = _ref.theme;
|
10
|
-
addComponents((0, _defineProperty2["default"])({}, ".focusable:focus,\n .focusable-within:focus-within,\n .focusable-visible:focus-visible,\n .focusable-visible-within:has(:focus-visible),\n input:focus ~ .focusable-sibling,\n .focusable-visible-group:focus-visible .focusable-visible-group-item,\n .focusable-show", {
|
10
|
+
addComponents((0, _defineProperty2["default"])({}, ".focusable:focus,\n .focusable-within:focus-within,\n .focusable-visible:focus-visible,\n .focusable-visible-within:has(:focus-visible),\n input:focus ~ .focusable-sibling,\n input:focus-visible ~ .focusable-visible-sibling,\n .focusable-visible-group:focus-visible .focusable-visible-group-item,\n .focusable-show", {
|
11
11
|
outline: "2px solid ".concat(theme("colors.accent.600")),
|
12
12
|
outlineOffset: "1px"
|
13
13
|
}));
|
package/dist/cjs/Layout/index.js
CHANGED
@@ -14,17 +14,6 @@ Object.keys(_Card).forEach(function (key) {
|
|
14
14
|
}
|
15
15
|
});
|
16
16
|
});
|
17
|
-
var _Chat = require("./Chat");
|
18
|
-
Object.keys(_Chat).forEach(function (key) {
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
20
|
-
if (key in exports && exports[key] === _Chat[key]) return;
|
21
|
-
Object.defineProperty(exports, key, {
|
22
|
-
enumerable: true,
|
23
|
-
get: function get() {
|
24
|
-
return _Chat[key];
|
25
|
-
}
|
26
|
-
});
|
27
|
-
});
|
28
17
|
var _CollapsibleCard = require("./CollapsibleCard");
|
29
18
|
Object.keys(_CollapsibleCard).forEach(function (key) {
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import type { IconButtonWithFeedbackLocale } from "../Actions";
|
2
|
+
import type { ChatMessageErrorLocale } from "../Chat/ChatMessageError";
|
3
|
+
import type { ChatMessageLocale } from "../Chat/ChatMessages";
|
4
|
+
import type { ChatPromptLocale } from "../Chat/ChatPrompt";
|
2
5
|
import type { AutoCompleteLocale, DateInputLocale, DatePickerLocale, DropzoneLocale, ExperimentalDateRangeInputLocale, ExperimentalFormLocale, FilePickerLocale, InputPropsLocale } from "../Fields";
|
3
6
|
import type { AnnouncementBadgeLocale, TagLocale, ToastLocale, ToastsLocale } from "../Indicators";
|
4
7
|
import type { UserAvatarLocale } from "../Indicators/Avatars";
|
5
8
|
import type { DataTableLocale, SidebarLocale } from "../Layout";
|
6
|
-
import type { ChatMessageErrorLocale } from "../Layout/Chat/ChatMessageError";
|
7
|
-
import type { ChatMessageLocale } from "../Layout/Chat/ChatMessages";
|
8
|
-
import type { ChatPromptLocale } from "../Layout/Chat/ChatPrompt";
|
9
9
|
import type { CompactPaginationLocale, DotPaginationLocale, PaginationLocale, StepperLocale } from "../Navigation";
|
10
10
|
import type { ModalLocale, PopoverLocale } from "../Overlay";
|
11
11
|
export declare type ComponentsLocales = {
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
@@ -98,6 +98,18 @@ Object.keys(_Actions).forEach(function (key) {
|
|
98
98
|
}
|
99
99
|
});
|
100
100
|
});
|
101
|
+
var _Chat = require("./Chat");
|
102
|
+
Object.keys(_Chat).forEach(function (key) {
|
103
|
+
if (key === "default" || key === "__esModule") return;
|
104
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
105
|
+
if (key in exports && exports[key] === _Chat[key]) return;
|
106
|
+
Object.defineProperty(exports, key, {
|
107
|
+
enumerable: true,
|
108
|
+
get: function get() {
|
109
|
+
return _Chat[key];
|
110
|
+
}
|
111
|
+
});
|
112
|
+
});
|
101
113
|
var _Fields = require("./Fields");
|
102
114
|
Object.keys(_Fields).forEach(function (key) {
|
103
115
|
if (key === "default" || key === "__esModule") return;
|
@@ -1 +1 @@
|
|
1
|
-
export declare const isCssPropertySupported: <P extends number | typeof Symbol.iterator | "filter" | "fill" | "width" | "height" | "color" | "alignmentBaseline" | "baselineShift" | "clip" | "clipPath" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "offset" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "grid" | "marker" | "translate" | "content" | "item" | "all" | "border" | "left" | "right" | "columns" | "top" | "bottom" | "
|
1
|
+
export declare const isCssPropertySupported: <P extends number | typeof Symbol.iterator | "filter" | "fill" | "width" | "height" | "color" | "alignmentBaseline" | "baselineShift" | "clip" | "clipPath" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "cursor" | "direction" | "display" | "dominantBaseline" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "offset" | "opacity" | "order" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "textDecoration" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "wordSpacing" | "writingMode" | "grid" | "marker" | "translate" | "content" | "item" | "all" | "border" | "left" | "right" | "columns" | "top" | "bottom" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backfaceVisibility" | "background" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockSize" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRule" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "counterIncrement" | "counterReset" | "counterSet" | "cssFloat" | "cssText" | "emptyCells" | "flex" | "flexBasis" | "flexDirection" | "flexFlow" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "font" | "fontFeatureSettings" | "fontKerning" | "fontOpticalSizing" | "fontSynthesis" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "gap" | "gridArea" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumn" | "gridColumnEnd" | "gridColumnGap" | "gridColumnStart" | "gridGap" | "gridRow" | "gridRowEnd" | "gridRowGap" | "gridRowStart" | "gridTemplate" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hyphens" | "imageOrientation" | "inlineSize" | "inset" | "insetBlock" | "insetBlockEnd" | "insetBlockStart" | "insetInline" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "lineBreak" | "lineHeight" | "listStyle" | "listStyleImage" | "listStylePosition" | "listStyleType" | "margin" | "marginBlock" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInline" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetDistance" | "offsetPath" | "offsetRotate" | "orphans" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflowAnchor" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "padding" | "paddingBlock" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInline" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "perspective" | "perspectiveOrigin" | "placeContent" | "placeItems" | "placeSelf" | "position" | "printColorAdjust" | "quotes" | "resize" | "rowGap" | "rubyPosition" | "scrollBehavior" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInline" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInline" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollbarGutter" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasis" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textOrientation" | "textOverflow" | "textShadow" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transformBox" | "transformOrigin" | "transformStyle" | "transition" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "userSelect" | "verticalAlign" | "webkitAlignContent" | "webkitAlignItems" | "webkitAlignSelf" | "webkitAnimation" | "webkitAnimationDelay" | "webkitAnimationDirection" | "webkitAnimationDuration" | "webkitAnimationFillMode" | "webkitAnimationIterationCount" | "webkitAnimationName" | "webkitAnimationPlayState" | "webkitAnimationTimingFunction" | "webkitAppearance" | "webkitBackfaceVisibility" | "webkitBackgroundClip" | "webkitBackgroundOrigin" | "webkitBackgroundSize" | "webkitBorderBottomLeftRadius" | "webkitBorderBottomRightRadius" | "webkitBorderRadius" | "webkitBorderTopLeftRadius" | "webkitBorderTopRightRadius" | "webkitBoxAlign" | "webkitBoxFlex" | "webkitBoxOrdinalGroup" | "webkitBoxOrient" | "webkitBoxPack" | "webkitBoxShadow" | "webkitBoxSizing" | "webkitFilter" | "webkitFlex" | "webkitFlexBasis" | "webkitFlexDirection" | "webkitFlexFlow" | "webkitFlexGrow" | "webkitFlexShrink" | "webkitFlexWrap" | "webkitJustifyContent" | "webkitLineClamp" | "webkitMask" | "webkitMaskBoxImage" | "webkitMaskBoxImageOutset" | "webkitMaskBoxImageRepeat" | "webkitMaskBoxImageSlice" | "webkitMaskBoxImageSource" | "webkitMaskBoxImageWidth" | "webkitMaskClip" | "webkitMaskComposite" | "webkitMaskImage" | "webkitMaskOrigin" | "webkitMaskPosition" | "webkitMaskRepeat" | "webkitMaskSize" | "webkitOrder" | "webkitPerspective" | "webkitPerspectiveOrigin" | "webkitTextFillColor" | "webkitTextSizeAdjust" | "webkitTextStroke" | "webkitTextStrokeColor" | "webkitTextStrokeWidth" | "webkitTransform" | "webkitTransformOrigin" | "webkitTransformStyle" | "webkitTransition" | "webkitTransitionDelay" | "webkitTransitionDuration" | "webkitTransitionProperty" | "webkitTransitionTimingFunction" | "webkitUserSelect" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordWrap" | "zIndex" | "getPropertyPriority" | "getPropertyValue" | "removeProperty" | "setProperty">(prop: P, value: CSSStyleDeclaration[P]) => boolean;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
2
|
+
import type { AccordionProps } from "../../Actions";
|
3
|
+
import type { IconComponentType } from "../../Icons";
|
4
|
+
export declare type ChatContextAccordionProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & Omit<AccordionProps, "multiple" | "defaultValue" | "value" | "onChange"> & {
|
5
|
+
/**
|
6
|
+
* The header of the accordion.
|
7
|
+
*/
|
8
|
+
header: ReactNode;
|
9
|
+
/**
|
10
|
+
* The icon of the accordion.
|
11
|
+
*/
|
12
|
+
icon?: IconComponentType;
|
13
|
+
/**
|
14
|
+
* Whether the accordion is open by default.
|
15
|
+
*/
|
16
|
+
defaultOpen?: boolean;
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* The `ChatContextAccordion` component provides a context menu for the chat.
|
20
|
+
*
|
21
|
+
* See the [ChatContextAccordion documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-context-accordion) for more information.
|
22
|
+
*/
|
23
|
+
export declare const ChatContextAccordion: ({ header, icon, children, className, defaultOpen, ...props }: ChatContextAccordionProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,19 +1,26 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
-
var _excluded = ["header", "icon", "children", "className"];
|
3
|
+
var _excluded = ["header", "icon", "children", "className", "defaultOpen"];
|
4
4
|
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; }
|
5
5
|
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) { _defineProperty(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; }
|
6
6
|
import { chatContextAccordionStyles } from "./ChatContextAccordion.styles";
|
7
|
-
import { Accordion } from "
|
7
|
+
import { Accordion } from "./../../Actions";
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
/**
|
10
|
+
* The `ChatContextAccordion` component provides a context menu for the chat.
|
11
|
+
*
|
12
|
+
* See the [ChatContextAccordion documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-context-accordion) for more information.
|
13
|
+
*/
|
9
14
|
export var ChatContextAccordion = function ChatContextAccordion(_ref) {
|
10
15
|
var header = _ref.header,
|
11
16
|
icon = _ref.icon,
|
12
17
|
children = _ref.children,
|
13
18
|
className = _ref.className,
|
19
|
+
defaultOpen = _ref.defaultOpen,
|
14
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
15
21
|
var styles = chatContextAccordionStyles();
|
16
22
|
return /*#__PURE__*/_jsx(Accordion, _objectSpread(_objectSpread({}, props), {}, {
|
23
|
+
defaultValue: defaultOpen ? "default" : undefined,
|
17
24
|
className: styles.base({
|
18
25
|
className: className
|
19
26
|
}),
|
@@ -6,8 +6,8 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
|
|
6
6
|
title?: import("tailwind-merge").ClassNameValue;
|
7
7
|
content?: import("tailwind-merge").ClassNameValue;
|
8
8
|
item?: import("tailwind-merge").ClassNameValue;
|
9
|
-
iconBg?: import("tailwind-merge").ClassNameValue;
|
10
9
|
trigger?: import("tailwind-merge").ClassNameValue;
|
10
|
+
iconBg?: import("tailwind-merge").ClassNameValue;
|
11
11
|
titleWrapper?: import("tailwind-merge").ClassNameValue;
|
12
12
|
};
|
13
13
|
};
|
@@ -19,8 +19,8 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
|
|
19
19
|
title?: import("tailwind-merge").ClassNameValue;
|
20
20
|
content?: import("tailwind-merge").ClassNameValue;
|
21
21
|
item?: import("tailwind-merge").ClassNameValue;
|
22
|
-
iconBg?: import("tailwind-merge").ClassNameValue;
|
23
22
|
trigger?: import("tailwind-merge").ClassNameValue;
|
23
|
+
iconBg?: import("tailwind-merge").ClassNameValue;
|
24
24
|
titleWrapper?: import("tailwind-merge").ClassNameValue;
|
25
25
|
};
|
26
26
|
};
|
@@ -34,6 +34,12 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
|
|
34
34
|
title: string;
|
35
35
|
content: string;
|
36
36
|
}, undefined, {
|
37
|
+
responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {} | undefined;
|
38
|
+
} & import("tailwind-variants/dist/config").TWMConfig & {
|
39
|
+
twMergeConfig: {
|
40
|
+
prefix: string;
|
41
|
+
};
|
42
|
+
}, {
|
37
43
|
[key: string]: {
|
38
44
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
39
45
|
base?: import("tailwind-merge").ClassNameValue;
|
@@ -41,8 +47,8 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
|
|
41
47
|
title?: import("tailwind-merge").ClassNameValue;
|
42
48
|
content?: import("tailwind-merge").ClassNameValue;
|
43
49
|
item?: import("tailwind-merge").ClassNameValue;
|
44
|
-
iconBg?: import("tailwind-merge").ClassNameValue;
|
45
50
|
trigger?: import("tailwind-merge").ClassNameValue;
|
51
|
+
iconBg?: import("tailwind-merge").ClassNameValue;
|
46
52
|
titleWrapper?: import("tailwind-merge").ClassNameValue;
|
47
53
|
};
|
48
54
|
};
|
@@ -64,4 +70,17 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
|
|
64
70
|
titleWrapper: string;
|
65
71
|
title: string;
|
66
72
|
content: string;
|
67
|
-
}, undefined, unknown,
|
73
|
+
}, undefined, import("tailwind-variants/dist/config").TVConfig<unknown, {
|
74
|
+
[key: string]: {
|
75
|
+
[key: string]: import("tailwind-merge").ClassNameValue | {
|
76
|
+
base?: import("tailwind-merge").ClassNameValue;
|
77
|
+
header?: import("tailwind-merge").ClassNameValue;
|
78
|
+
title?: import("tailwind-merge").ClassNameValue;
|
79
|
+
content?: import("tailwind-merge").ClassNameValue;
|
80
|
+
item?: import("tailwind-merge").ClassNameValue;
|
81
|
+
trigger?: import("tailwind-merge").ClassNameValue;
|
82
|
+
iconBg?: import("tailwind-merge").ClassNameValue;
|
83
|
+
titleWrapper?: import("tailwind-merge").ClassNameValue;
|
84
|
+
};
|
85
|
+
};
|
86
|
+
} | {}>, unknown, unknown, undefined>>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
3
|
-
import stl from "
|
4
|
-
import { tv } from "
|
3
|
+
import stl from "./../../styles/helpers/satellitePrefixer";
|
4
|
+
import { tv } from "./../../styles/helpers/tv";
|
5
5
|
export var chatContextAccordionStyles = tv({
|
6
6
|
slots: {
|
7
7
|
base: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["w-full"]))),
|
@@ -11,6 +11,6 @@ export var chatContextAccordionStyles = tv({
|
|
11
11
|
trigger: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["!px-2 !py-0.5"]))),
|
12
12
|
titleWrapper: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["gap-x-1"]))),
|
13
13
|
title: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["typo-subdued typo-display-caption"]))),
|
14
|
-
content: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["bg-grey-100 [&>div]:px-3 [&>div]:py-2 overflow-y-auto max-h-36"])))
|
14
|
+
content: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["bg-grey-100 [&>div]:px-3 [&>div]:py-2 overflow-y-auto max-h-36 data-[state=closed]:overflow-y-hidden"])))
|
15
15
|
}
|
16
16
|
});
|