@seeqdev/qomponents 0.0.183 → 0.0.185
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/README.md +5 -19
- package/dist/example/.eslintrc.cjs +2 -6
- package/dist/example/README.md +0 -3
- package/dist/example/src/Example.tsx +7 -7
- package/dist/example/tsconfig.json +2 -8
- package/dist/example/tsconfig.node.json +1 -3
- package/dist/example/vite.config.ts +1 -1
- package/dist/index.esm.js +784 -523
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +781 -520
- package/dist/index.js.map +1 -1
- package/dist/src/Accordion/Accordion.js +8 -0
- package/dist/src/Accordion/Accordion.stories.js +96 -0
- package/dist/src/Accordion/Accordion.test.js +54 -0
- package/dist/src/Accordion/Accordion.types.js +1 -0
- package/dist/src/Accordion/index.js +1 -0
- package/dist/src/Alert/Alert.js +33 -0
- package/dist/src/Alert/Alert.stories.d.ts +13 -5
- package/dist/src/Alert/Alert.stories.js +72 -0
- package/dist/src/Alert/Alert.test.js +49 -0
- package/dist/src/Alert/Alert.types.js +1 -0
- package/dist/src/Alert/index.js +1 -0
- package/dist/src/Button/Button.js +107 -0
- package/dist/src/Button/Button.stories.js +74 -0
- package/dist/src/Button/Button.test.js +65 -0
- package/dist/src/Button/Button.types.d.ts +4 -4
- package/dist/src/Button/Button.types.js +4 -0
- package/dist/src/Button/index.d.ts +1 -1
- package/dist/src/Button/index.js +1 -0
- package/dist/src/ButtonGroup/ButtonGroup.js +34 -0
- package/dist/src/ButtonGroup/ButtonGroup.stories.js +328 -0
- package/dist/src/ButtonGroup/ButtonGroup.test.js +65 -0
- package/dist/src/ButtonGroup/ButtonGroup.types.js +1 -0
- package/dist/src/ButtonGroup/index.js +1 -0
- package/dist/src/ButtonWithDropdown/ButtonWithDropdown.js +46 -0
- package/dist/src/ButtonWithDropdown/ButtonWithDropdown.stories.js +119 -0
- package/dist/src/ButtonWithDropdown/ButtonWithDropdown.test.js +92 -0
- package/dist/src/ButtonWithDropdown/ButtonWithDropdown.types.js +1 -0
- package/dist/src/ButtonWithDropdown/index.js +1 -0
- package/dist/src/ButtonWithPopover/ButtonWithPopover.js +54 -0
- package/dist/src/ButtonWithPopover/ButtonWithPopover.stories.js +51 -0
- package/dist/src/ButtonWithPopover/ButtonWithPopover.test.js +80 -0
- package/dist/src/ButtonWithPopover/ButtonWithPopover.types.js +1 -0
- package/dist/src/ButtonWithPopover/index.js +1 -0
- package/dist/src/Carousel/Carousel.js +80 -0
- package/dist/src/Carousel/Carousel.stories.js +100 -0
- package/dist/src/Carousel/Carousel.test.js +47 -0
- package/dist/src/Carousel/Carousel.types.js +1 -0
- package/dist/src/Carousel/index.js +1 -0
- package/dist/src/Checkbox/Checkbox.js +24 -0
- package/dist/src/Checkbox/Checkbox.stories.js +21 -0
- package/dist/src/Checkbox/Checkbox.test.js +93 -0
- package/dist/src/Checkbox/Checkbox.types.js +1 -0
- package/dist/src/Checkbox/index.js +1 -0
- package/dist/src/Collapse/Collapse.js +16 -0
- package/dist/src/Collapse/Collapse.stories.js +28 -0
- package/dist/src/Collapse/Collapse.test.js +16 -0
- package/dist/src/Collapse/Collapse.types.js +1 -0
- package/dist/src/Collapse/index.js +1 -0
- package/dist/src/Icon/Icon.js +55 -0
- package/dist/src/Icon/Icon.stories.js +31 -0
- package/dist/src/Icon/Icon.test.js +54 -0
- package/dist/src/Icon/Icon.types.d.ts +1 -1
- package/dist/src/Icon/Icon.types.js +15 -0
- package/dist/src/Icon/index.js +1 -0
- package/dist/src/InputGroup/InputGroup.js +33 -0
- package/dist/src/InputGroup/InputGroup.stories.js +144 -0
- package/dist/src/InputGroup/InputGroup.test.js +41 -0
- package/dist/src/InputGroup/InputGroup.types.js +1 -0
- package/dist/src/InputGroup/index.js +1 -0
- package/dist/src/Modal/Modal.js +86 -0
- package/dist/src/Modal/Modal.stories.js +79 -0
- package/dist/src/Modal/Modal.test.js +107 -0
- package/dist/src/Modal/Modal.types.js +1 -0
- package/dist/src/Modal/index.js +1 -0
- package/dist/src/ProgressBar/ProgressBar.js +71 -0
- package/dist/src/ProgressBar/ProgressBar.stories.js +46 -0
- package/dist/src/ProgressBar/ProgressBar.test.js +42 -0
- package/dist/src/ProgressBar/ProgressBar.types.js +1 -0
- package/dist/src/ProgressBar/index.js +1 -0
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.js +41 -0
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.stories.js +73 -0
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.test.js +72 -0
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.types.d.ts +0 -5
- package/dist/src/SeeqActionDropdown/SeeqActionDropdown.types.js +1 -0
- package/dist/src/SeeqActionDropdown/index.js +1 -0
- package/dist/src/SeeqActionDropdown/variants.js +34 -0
- package/dist/src/Select/Select.js +171 -0
- package/dist/src/Select/Select.stories.js +50 -0
- package/dist/src/Select/Select.test.js +176 -0
- package/dist/src/Select/Select.types.js +1 -0
- package/dist/src/Select/index.js +2 -0
- package/dist/src/Slider/Slider.js +11 -0
- package/dist/src/Slider/Slider.stories.js +37 -0
- package/dist/src/Slider/Slider.test.js +31 -0
- package/dist/src/Slider/Slider.types.js +1 -0
- package/dist/src/Slider/index.js +1 -0
- package/dist/src/SvgIcon/SvgIcon.js +27 -0
- package/dist/src/SvgIcon/SvgIcon.stories.js +26 -0
- package/dist/src/SvgIcon/SvgIcon.test.js +40 -0
- package/dist/src/SvgIcon/SvgIcon.types.d.ts +1 -1
- package/dist/src/SvgIcon/SvgIcon.types.js +2 -0
- package/dist/src/SvgIcon/index.js +1 -0
- package/dist/src/Tabs/Tabs.js +18 -0
- package/dist/src/Tabs/Tabs.stories.js +83 -0
- package/dist/src/Tabs/Tabs.test.js +91 -0
- package/dist/src/Tabs/Tabs.types.js +1 -0
- package/dist/src/Tabs/index.js +1 -0
- package/dist/src/TextArea/TextArea.js +54 -0
- package/dist/src/TextArea/TextArea.stories.js +21 -0
- package/dist/src/TextArea/TextArea.test.js +129 -0
- package/dist/src/TextArea/TextArea.types.js +1 -0
- package/dist/src/TextArea/index.js +1 -0
- package/dist/src/TextField/TextField.js +85 -0
- package/dist/src/TextField/TextField.stories.js +30 -0
- package/dist/src/TextField/TextField.test.js +40 -0
- package/dist/src/TextField/TextField.types.js +1 -0
- package/dist/src/TextField/index.js +1 -0
- package/dist/src/ToolbarButton/ToolbarButton.js +58 -0
- package/dist/src/ToolbarButton/ToolbarButton.stories.js +63 -0
- package/dist/src/ToolbarButton/ToolbarButton.test.js +89 -0
- package/dist/src/ToolbarButton/ToolbarButton.types.d.ts +1 -1
- package/dist/src/ToolbarButton/ToolbarButton.types.js +1 -0
- package/dist/src/ToolbarButton/index.js +1 -0
- package/dist/src/Tooltip/QTip.stories.js +22 -0
- package/dist/src/Tooltip/QTip.types.js +1 -0
- package/dist/src/Tooltip/QTipPerformance.stories.js +27 -0
- package/dist/src/Tooltip/Qtip.js +168 -0
- package/dist/src/Tooltip/Tooltip.js +34 -0
- package/dist/src/Tooltip/Tooltip.stories.js +20 -0
- package/dist/src/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/src/Tooltip/Tooltip.types.js +2 -0
- package/dist/src/Tooltip/TooltipPerformance.stories.js +25 -0
- package/dist/src/Tooltip/index.js +2 -0
- package/dist/src/Tooltip/qTip.utilities.js +10 -0
- package/dist/src/index.js +47 -0
- package/dist/src/setupTests.js +5 -0
- package/dist/src/types.js +25 -0
- package/dist/src/utils/browserId.d.ts +3 -3
- package/dist/src/utils/browserId.js +28 -0
- package/dist/src/utils/svg.js +19 -0
- package/dist/src/utils/validateStyleDimension.js +13 -0
- package/dist/src/utils/validateStyleDimension.test.js +19 -0
- package/dist/styles.css +3410 -2791
- package/package.json +22 -17
package/dist/index.js
CHANGED
|
@@ -66,34 +66,34 @@ const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId,
|
|
|
66
66
|
: undefined;
|
|
67
67
|
|
|
68
68
|
const colorClassesThemeLight = {
|
|
69
|
-
'theme': 'tw
|
|
70
|
-
'white': 'tw
|
|
71
|
-
'dark-gray': 'tw
|
|
72
|
-
'warning': 'tw
|
|
73
|
-
'darkish-gray': 'tw
|
|
74
|
-
'gray': 'tw
|
|
69
|
+
'theme': 'tw-text-sq-color-dark',
|
|
70
|
+
'white': 'tw-text-white',
|
|
71
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
72
|
+
'warning': 'tw-text-sq-warning-color',
|
|
73
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
74
|
+
'gray': 'tw-text-sq-disabled-gray',
|
|
75
75
|
'color': '',
|
|
76
|
-
'info': 'tw
|
|
77
|
-
'text': 'tw
|
|
76
|
+
'info': 'tw-text-sq-link',
|
|
77
|
+
'text': 'tw-text-sq-text-color',
|
|
78
78
|
'inherit': '',
|
|
79
|
-
'danger': 'tw
|
|
80
|
-
'theme-light': 'tw
|
|
81
|
-
'success': 'tw
|
|
79
|
+
'danger': 'tw-text-sq-danger-color',
|
|
80
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
81
|
+
'success': 'tw-text-sq-success-color',
|
|
82
82
|
};
|
|
83
83
|
const colorClassesThemeDark = {
|
|
84
|
-
'theme': '
|
|
84
|
+
'theme': 'dark:tw-text-sq-color-dark-dark',
|
|
85
85
|
'white': '',
|
|
86
|
-
'dark-gray': 'tw
|
|
86
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
87
87
|
'warning': '',
|
|
88
|
-
'darkish-gray': 'tw
|
|
89
|
-
'gray': '
|
|
88
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
89
|
+
'gray': 'dark:tw-text-sq-dark-disabled-gray',
|
|
90
90
|
'color': '',
|
|
91
|
-
'info': '
|
|
92
|
-
'text': '
|
|
91
|
+
'info': 'dark:tw-text-sq-link-dark',
|
|
92
|
+
'text': 'dark:tw-text-sq-dark-text',
|
|
93
93
|
'inherit': '',
|
|
94
|
-
'danger': 'tw
|
|
95
|
-
'theme-light': 'tw
|
|
96
|
-
'success': 'tw
|
|
94
|
+
'danger': 'tw-text-sq-danger-color',
|
|
95
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
96
|
+
'success': 'tw-text-sq-success-color',
|
|
97
97
|
};
|
|
98
98
|
/**
|
|
99
99
|
* Icon:
|
|
@@ -105,14 +105,14 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
105
105
|
const errorMessage = color === undefined || color === ''
|
|
106
106
|
? 'Icon with type="color" must have prop color specified.'
|
|
107
107
|
: 'Icon with prop color must have type="color".';
|
|
108
|
-
return jsxRuntime.jsx("div", { className: "tw
|
|
108
|
+
return jsxRuntime.jsx("div", { className: "tw-text-sq-danger-color", children: errorMessage });
|
|
109
109
|
}
|
|
110
110
|
const fontAwesomePrefix = iconPrefix ? iconPrefix : 'fa-sharp fa-regular';
|
|
111
111
|
const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
|
|
112
112
|
const style = type === 'color' && color ? { color } : {};
|
|
113
113
|
const sizeClass = size ? `fa-${size}` : small ? 'fa-sm' : large ? 'fa-lg' : '';
|
|
114
114
|
const appliedClassNames = `${iconPrefixString} ${icon} ${sizeClass}
|
|
115
|
-
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'tw
|
|
115
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'tw-cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none tw-outline-none`;
|
|
116
116
|
const tooltipData = getQTipData(tooltipProps);
|
|
117
117
|
return (jsxRuntime.jsx("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
|
|
118
118
|
};
|
|
@@ -123,71 +123,71 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
123
123
|
* - include tooltips and/or icons
|
|
124
124
|
*/
|
|
125
125
|
const Button = ({ onClick, label, variant = 'outline', type = 'button', size = 'sm', disabled, extraClassNames, id, testId, stopPropagation = true, tooltip, tooltipOptions, iconStyle = 'text', icon, iconColor, iconPosition = 'left', iconPrefix = undefined, preventBlur = false, isHtmlTooltip = false, tooltipTestId, }) => {
|
|
126
|
-
const baseClasses = 'tw
|
|
126
|
+
const baseClasses = 'tw-px-2.5 tw-rounded-md focus:tw-ring-0 focus-visible:tw-outline-none aria-disabled:tw-cursor-not-allowed disabled:tw-pointer-events-none';
|
|
127
127
|
const baseClassesByVariant = {
|
|
128
|
-
'outline': '
|
|
129
|
-
'theme': '
|
|
130
|
-
'danger': 'tw
|
|
131
|
-
'tw
|
|
132
|
-
'theme-light': '
|
|
133
|
-
'no-border': '
|
|
134
|
-
'warning': 'tw
|
|
135
|
-
'
|
|
128
|
+
'outline': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
129
|
+
'theme': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
130
|
+
'danger': 'tw-bg-sq-danger-color disabled:tw-opacity-50 aria-disabled:tw-opacity-50 ' +
|
|
131
|
+
'tw-border-solid tw-border tw-border-sq-danger-color',
|
|
132
|
+
'theme-light': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
133
|
+
'no-border': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50',
|
|
134
|
+
'warning': 'tw-bg-sq-warning-color tw-border-solid tw-border tw-border-sq-warning-color ' +
|
|
135
|
+
'disabled:tw-opacity-50 aria-disabled:tw-opacity-50',
|
|
136
136
|
};
|
|
137
137
|
const textClassesByVariantLightTheme = {
|
|
138
|
-
'outline': 'tw
|
|
139
|
-
'theme': 'tw
|
|
140
|
-
'theme-light': 'tw
|
|
141
|
-
'danger': 'tw
|
|
142
|
-
'no-border': 'tw
|
|
143
|
-
'warning': 'tw
|
|
138
|
+
'outline': 'tw-text-sq-text-color',
|
|
139
|
+
'theme': 'tw-text-white',
|
|
140
|
+
'theme-light': 'tw-text-white',
|
|
141
|
+
'danger': 'tw-text-white',
|
|
142
|
+
'no-border': 'tw-text-sq-text-color',
|
|
143
|
+
'warning': 'tw-text-white',
|
|
144
144
|
};
|
|
145
145
|
const textClassesByVariantDarkTheme = {
|
|
146
|
-
'outline': '
|
|
147
|
-
'theme': '
|
|
148
|
-
'theme-light': '
|
|
149
|
-
'danger': '
|
|
150
|
-
'no-border': '
|
|
151
|
-
'warning': '
|
|
146
|
+
'outline': 'dark:tw-text-sq-dark-text',
|
|
147
|
+
'theme': 'dark:tw-text-white',
|
|
148
|
+
'theme-light': 'dark:tw-text-white',
|
|
149
|
+
'danger': 'dark:tw-text-white',
|
|
150
|
+
'no-border': 'dark:tw-text-sq-dark-text',
|
|
151
|
+
'warning': 'dark:tw-text-white',
|
|
152
152
|
};
|
|
153
153
|
const classesByVariantLightTheme = {
|
|
154
|
-
'outline': 'tw
|
|
155
|
-
'theme': 'tw
|
|
154
|
+
'outline': 'tw-bg-white tw-border-sq-disabled-gray',
|
|
155
|
+
'theme': 'tw-bg-sq-color-dark tw-border-sq-color-dark',
|
|
156
156
|
'danger': '',
|
|
157
|
-
'theme-light': 'tw
|
|
157
|
+
'theme-light': 'tw-bg-sq-icon',
|
|
158
158
|
'no-border': '',
|
|
159
159
|
'warning': '',
|
|
160
160
|
};
|
|
161
161
|
const classesByVariantDarkTheme = {
|
|
162
|
-
'outline': '
|
|
163
|
-
'theme': '
|
|
162
|
+
'outline': 'dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-disabled-gray',
|
|
163
|
+
'theme': 'dark:tw-bg-sq-color-dark dark:tw-border-sq-color-dark',
|
|
164
164
|
'danger': '',
|
|
165
|
-
'theme-light': '
|
|
165
|
+
'theme-light': 'dark:tw-bg-sq-icon-dark dark:tw-border-sq-icon-dark',
|
|
166
166
|
'no-border': '',
|
|
167
167
|
'warning': '',
|
|
168
168
|
};
|
|
169
169
|
const activeClassesByVariantLightTheme = {
|
|
170
|
-
'outline': '
|
|
171
|
-
'
|
|
172
|
-
'theme': '
|
|
173
|
-
'danger': '
|
|
174
|
-
'theme-light': '
|
|
170
|
+
'outline': 'hover:tw-bg-sq-light-gray focus:tw-bg-sq-dark-gray active:tw-bg-sq-dark-gray focus:tw-border-sq-color-dark' +
|
|
171
|
+
' active:tw-border-sq-color-dark',
|
|
172
|
+
'theme': 'hover:tw-bg-sq-color-highlight hover:tw-border-sq-color-highlight',
|
|
173
|
+
'danger': 'hover:tw-bg-sq-danger-color-hover hover:tw-border-sq-danger-color-hover',
|
|
174
|
+
'theme-light': 'hover:tw-bg-sq-link hover:tw-border-sq-link',
|
|
175
175
|
'no-border': '',
|
|
176
176
|
'warning': '',
|
|
177
177
|
};
|
|
178
178
|
const activeClassesByVariantDarkTheme = {
|
|
179
|
-
'outline': '
|
|
180
|
-
'
|
|
181
|
-
'theme': '
|
|
182
|
-
'danger': '
|
|
183
|
-
'theme-light': '
|
|
179
|
+
'outline': 'dark:hover:tw-bg-sq-highlight-color-dark dark:focus:tw-bg-sq-multi-gray-dark' +
|
|
180
|
+
' dark:active:tw-bg-sq-multi-gray-dark dark:focus:tw-border-sq-color-dark dark:active:tw-border-sq-color-dark',
|
|
181
|
+
'theme': 'dark:hover:tw-bg-sq-color-highlight dark:hover:tw-border-sq-color-highlight',
|
|
182
|
+
'danger': 'dark:hover:tw-bg-sq-danger-color-hover dark:hover:tw-border-sq-danger-color-hover',
|
|
183
|
+
'theme-light': 'dark:hover:tw-bg-sq-link-dark dark:hover:tw-border-sq-link-dark',
|
|
184
184
|
'no-border': '',
|
|
185
185
|
'warning': '',
|
|
186
186
|
};
|
|
187
187
|
const sizeClasses = {
|
|
188
|
-
xs: 'tw
|
|
189
|
-
sm: 'tw
|
|
190
|
-
lg: 'tw
|
|
188
|
+
xs: 'tw-text-xs tw-py-0.5',
|
|
189
|
+
sm: 'tw-text-sm tw-py-1',
|
|
190
|
+
lg: 'tw-text-xl tw-py-1',
|
|
191
191
|
};
|
|
192
192
|
let tooltipData = undefined;
|
|
193
193
|
let appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;
|
|
@@ -203,7 +203,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
203
203
|
'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
|
-
const iconClass = iconPosition === 'left' ? 'tw
|
|
206
|
+
const iconClass = iconPosition === 'left' ? 'tw-mr-1' : 'tw-ml-1';
|
|
207
207
|
const iconElement = icon && (jsxRuntime.jsx(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label
|
|
208
208
|
? `${iconClass} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}`
|
|
209
209
|
: '', testId: `${id}_spinner` }));
|
|
@@ -219,7 +219,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
219
219
|
}, className: appliedClasses, children: [iconPosition === 'left' && iconElement, label, iconPosition === 'right' && iconElement] }));
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
//
|
|
222
|
+
// src/primitive.tsx
|
|
223
223
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
224
224
|
return function handleEvent(event) {
|
|
225
225
|
originalEventHandler?.(event);
|
|
@@ -229,7 +229,7 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
// packages/react/compose-refs/src/
|
|
232
|
+
// packages/react/compose-refs/src/compose-refs.tsx
|
|
233
233
|
function setRef$1(ref, value) {
|
|
234
234
|
if (typeof ref === "function") {
|
|
235
235
|
return ref(value);
|
|
@@ -265,7 +265,7 @@ function useComposedRefs$1(...refs) {
|
|
|
265
265
|
return React__namespace.useCallback(composeRefs$1(...refs), refs);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
// packages/react/context/src/
|
|
268
|
+
// packages/react/context/src/create-context.tsx
|
|
269
269
|
function createContext2(rootComponentName, defaultContext) {
|
|
270
270
|
const Context = React__namespace.createContext(defaultContext);
|
|
271
271
|
const Provider = (props) => {
|
|
@@ -282,7 +282,7 @@ function createContext2(rootComponentName, defaultContext) {
|
|
|
282
282
|
}
|
|
283
283
|
return [Provider, useContext2];
|
|
284
284
|
}
|
|
285
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
285
|
+
function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
286
286
|
let defaultContexts = [];
|
|
287
287
|
function createContext3(rootComponentName, defaultContext) {
|
|
288
288
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -317,9 +317,9 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
317
317
|
};
|
|
318
318
|
};
|
|
319
319
|
createScope.scopeName = scopeName;
|
|
320
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
320
|
+
return [createContext3, composeContextScopes$1(createScope, ...createContextScopeDeps)];
|
|
321
321
|
}
|
|
322
|
-
function composeContextScopes(...scopes) {
|
|
322
|
+
function composeContextScopes$1(...scopes) {
|
|
323
323
|
const baseScope = scopes[0];
|
|
324
324
|
if (scopes.length === 1) return baseScope;
|
|
325
325
|
const createScope = () => {
|
|
@@ -340,46 +340,53 @@ function composeContextScopes(...scopes) {
|
|
|
340
340
|
return createScope;
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
//
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
343
|
+
// src/slot.tsx
|
|
344
|
+
// @__NO_SIDE_EFFECTS__
|
|
345
|
+
function createSlot$1(ownerName) {
|
|
346
|
+
const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
|
|
347
|
+
const Slot2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
348
|
+
const { children, ...slotProps } = props;
|
|
349
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
350
|
+
const slottable = childrenArray.find(isSlottable$1);
|
|
351
|
+
if (slottable) {
|
|
352
|
+
const newElement = slottable.props.children;
|
|
353
|
+
const newChildren = childrenArray.map((child) => {
|
|
354
|
+
if (child === slottable) {
|
|
355
|
+
if (React__namespace.Children.count(newElement) > 1) return React__namespace.Children.only(null);
|
|
356
|
+
return React__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
357
|
+
} else {
|
|
358
|
+
return child;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
362
|
+
}
|
|
363
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
364
|
+
});
|
|
365
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
366
|
+
return Slot2;
|
|
367
|
+
}
|
|
368
|
+
// @__NO_SIDE_EFFECTS__
|
|
369
|
+
function createSlotClone$1(ownerName) {
|
|
370
|
+
const SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
|
371
|
+
const { children, ...slotProps } = props;
|
|
372
|
+
if (React__namespace.isValidElement(children)) {
|
|
373
|
+
const childrenRef = getElementRef$2(children);
|
|
374
|
+
const props2 = mergeProps$1(slotProps, children.props);
|
|
375
|
+
if (children.type !== React__namespace.Fragment) {
|
|
376
|
+
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
356
377
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
var SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
|
364
|
-
const { children, ...slotProps } = props;
|
|
365
|
-
if (React__namespace.isValidElement(children)) {
|
|
366
|
-
const childrenRef = getElementRef$1(children);
|
|
367
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
368
|
-
if (children.type !== React__namespace.Fragment) {
|
|
369
|
-
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
370
|
-
}
|
|
371
|
-
return React__namespace.cloneElement(children, props2);
|
|
372
|
-
}
|
|
373
|
-
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
|
374
|
-
});
|
|
375
|
-
SlotClone.displayName = "SlotClone";
|
|
376
|
-
var Slottable = ({ children }) => {
|
|
377
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
378
|
-
};
|
|
379
|
-
function isSlottable(child) {
|
|
380
|
-
return React__namespace.isValidElement(child) && child.type === Slottable;
|
|
378
|
+
return React__namespace.cloneElement(children, props2);
|
|
379
|
+
}
|
|
380
|
+
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
|
381
|
+
});
|
|
382
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
383
|
+
return SlotClone;
|
|
381
384
|
}
|
|
382
|
-
|
|
385
|
+
var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
|
|
386
|
+
function isSlottable$1(child) {
|
|
387
|
+
return React__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
|
|
388
|
+
}
|
|
389
|
+
function mergeProps$1(slotProps, childProps) {
|
|
383
390
|
const overrideProps = { ...childProps };
|
|
384
391
|
for (const propName in childProps) {
|
|
385
392
|
const slotPropValue = slotProps[propName];
|
|
@@ -388,8 +395,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
388
395
|
if (isHandler) {
|
|
389
396
|
if (slotPropValue && childPropValue) {
|
|
390
397
|
overrideProps[propName] = (...args) => {
|
|
391
|
-
childPropValue(...args);
|
|
398
|
+
const result = childPropValue(...args);
|
|
392
399
|
slotPropValue(...args);
|
|
400
|
+
return result;
|
|
393
401
|
};
|
|
394
402
|
} else if (slotPropValue) {
|
|
395
403
|
overrideProps[propName] = slotPropValue;
|
|
@@ -402,7 +410,7 @@ function mergeProps(slotProps, childProps) {
|
|
|
402
410
|
}
|
|
403
411
|
return { ...slotProps, ...overrideProps };
|
|
404
412
|
}
|
|
405
|
-
function getElementRef$
|
|
413
|
+
function getElementRef$2(element) {
|
|
406
414
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
407
415
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
408
416
|
if (mayWarn) {
|
|
@@ -416,8 +424,8 @@ function getElementRef$1(element) {
|
|
|
416
424
|
return element.props.ref || element.ref;
|
|
417
425
|
}
|
|
418
426
|
|
|
419
|
-
//
|
|
420
|
-
var NODES = [
|
|
427
|
+
// src/primitive.tsx
|
|
428
|
+
var NODES$1 = [
|
|
421
429
|
"a",
|
|
422
430
|
"button",
|
|
423
431
|
"div",
|
|
@@ -431,11 +439,13 @@ var NODES = [
|
|
|
431
439
|
"nav",
|
|
432
440
|
"ol",
|
|
433
441
|
"p",
|
|
442
|
+
"select",
|
|
434
443
|
"span",
|
|
435
444
|
"svg",
|
|
436
445
|
"ul"
|
|
437
446
|
];
|
|
438
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
447
|
+
var Primitive$1 = NODES$1.reduce((primitive, node) => {
|
|
448
|
+
const Slot = createSlot$1(`Primitive.${node}`);
|
|
439
449
|
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
440
450
|
const { asChild, ...primitiveProps } = props;
|
|
441
451
|
const Comp = asChild ? Slot : node;
|
|
@@ -451,7 +461,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
451
461
|
if (target) ReactDOM__namespace.flushSync(() => target.dispatchEvent(event));
|
|
452
462
|
}
|
|
453
463
|
|
|
454
|
-
// packages/react/use-callback-ref/src/
|
|
464
|
+
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
|
455
465
|
function useCallbackRef$1(callback) {
|
|
456
466
|
const callbackRef = React__namespace.useRef(callback);
|
|
457
467
|
React__namespace.useEffect(() => {
|
|
@@ -460,7 +470,7 @@ function useCallbackRef$1(callback) {
|
|
|
460
470
|
return React__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
461
471
|
}
|
|
462
472
|
|
|
463
|
-
// packages/react/use-escape-keydown/src/
|
|
473
|
+
// packages/react/use-escape-keydown/src/use-escape-keydown.tsx
|
|
464
474
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
465
475
|
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
466
476
|
React__namespace.useEffect(() => {
|
|
@@ -562,7 +572,7 @@ var DismissableLayer = React__namespace.forwardRef(
|
|
|
562
572
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
563
573
|
}, []);
|
|
564
574
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
565
|
-
Primitive.div,
|
|
575
|
+
Primitive$1.div,
|
|
566
576
|
{
|
|
567
577
|
...layerProps,
|
|
568
578
|
ref: composedRefs,
|
|
@@ -595,7 +605,7 @@ var DismissableLayerBranch = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
595
605
|
};
|
|
596
606
|
}
|
|
597
607
|
}, [context.branches]);
|
|
598
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
608
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...props, ref: composedRefs });
|
|
599
609
|
});
|
|
600
610
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
601
611
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
@@ -819,7 +829,7 @@ var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
819
829
|
},
|
|
820
830
|
[loop, trapped, focusScope.paused]
|
|
821
831
|
);
|
|
822
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
832
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
823
833
|
});
|
|
824
834
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
825
835
|
function focusFirst$2(candidates, { select = false } = {}) {
|
|
@@ -902,12 +912,12 @@ function removeLinks(items) {
|
|
|
902
912
|
return items.filter((item) => item.tagName !== "A");
|
|
903
913
|
}
|
|
904
914
|
|
|
905
|
-
// packages/react/use-layout-effect/src/
|
|
906
|
-
var useLayoutEffect2 =
|
|
915
|
+
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
|
916
|
+
var useLayoutEffect2 = globalThis?.document ? React__namespace.useLayoutEffect : () => {
|
|
907
917
|
};
|
|
908
918
|
|
|
909
919
|
// packages/react/id/src/id.tsx
|
|
910
|
-
var useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
920
|
+
var useReactId = React__namespace[" useId ".trim().toString()] || (() => void 0);
|
|
911
921
|
var count = 0;
|
|
912
922
|
function useId(deterministicId) {
|
|
913
923
|
const [id, setId] = React__namespace.useState(useReactId());
|
|
@@ -3113,12 +3123,12 @@ const arrow$2 = (options, deps) => ({
|
|
|
3113
3123
|
options: [options, deps]
|
|
3114
3124
|
});
|
|
3115
3125
|
|
|
3116
|
-
//
|
|
3126
|
+
// src/arrow.tsx
|
|
3117
3127
|
var NAME = "Arrow";
|
|
3118
3128
|
var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
3119
3129
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
3120
3130
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3121
|
-
Primitive.svg,
|
|
3131
|
+
Primitive$1.svg,
|
|
3122
3132
|
{
|
|
3123
3133
|
...arrowProps,
|
|
3124
3134
|
ref: forwardedRef,
|
|
@@ -3133,7 +3143,7 @@ var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
3133
3143
|
Arrow$1.displayName = NAME;
|
|
3134
3144
|
var Root$5 = Arrow$1;
|
|
3135
3145
|
|
|
3136
|
-
// packages/react/use-size/src/
|
|
3146
|
+
// packages/react/use-size/src/use-size.tsx
|
|
3137
3147
|
function useSize(element) {
|
|
3138
3148
|
const [size, setSize] = React__namespace.useState(void 0);
|
|
3139
3149
|
useLayoutEffect2(() => {
|
|
@@ -3170,7 +3180,7 @@ function useSize(element) {
|
|
|
3170
3180
|
}
|
|
3171
3181
|
|
|
3172
3182
|
var POPPER_NAME = "Popper";
|
|
3173
|
-
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
3183
|
+
var [createPopperContext, createPopperScope] = createContextScope$1(POPPER_NAME);
|
|
3174
3184
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
3175
3185
|
var Popper = (props) => {
|
|
3176
3186
|
const { __scopePopper, children } = props;
|
|
@@ -3185,10 +3195,15 @@ var PopperAnchor = React__namespace.forwardRef(
|
|
|
3185
3195
|
const context = usePopperContext(ANCHOR_NAME$2, __scopePopper);
|
|
3186
3196
|
const ref = React__namespace.useRef(null);
|
|
3187
3197
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
3198
|
+
const anchorRef = React__namespace.useRef(null);
|
|
3188
3199
|
React__namespace.useEffect(() => {
|
|
3189
|
-
|
|
3200
|
+
const previousAnchor = anchorRef.current;
|
|
3201
|
+
anchorRef.current = virtualRef?.current || ref.current;
|
|
3202
|
+
if (previousAnchor !== anchorRef.current) {
|
|
3203
|
+
context.onAnchorChange(anchorRef.current);
|
|
3204
|
+
}
|
|
3190
3205
|
});
|
|
3191
|
-
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
3206
|
+
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...anchorProps, ref: composedRefs });
|
|
3192
3207
|
}
|
|
3193
3208
|
);
|
|
3194
3209
|
PopperAnchor.displayName = ANCHOR_NAME$2;
|
|
@@ -3315,7 +3330,7 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
3315
3330
|
arrowY,
|
|
3316
3331
|
shouldHideArrow: cannotCenterArrow,
|
|
3317
3332
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3318
|
-
Primitive.div,
|
|
3333
|
+
Primitive$1.div,
|
|
3319
3334
|
{
|
|
3320
3335
|
"data-side": placedSide,
|
|
3321
3336
|
"data-align": placedAlign,
|
|
@@ -3440,7 +3455,7 @@ var Portal$3 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
3440
3455
|
const [mounted, setMounted] = React__namespace.useState(false);
|
|
3441
3456
|
useLayoutEffect2(() => setMounted(true), []);
|
|
3442
3457
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
3443
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
3458
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
3444
3459
|
});
|
|
3445
3460
|
Portal$3.displayName = PORTAL_NAME$4;
|
|
3446
3461
|
|
|
@@ -3451,19 +3466,19 @@ function useStateMachine(initialState, machine) {
|
|
|
3451
3466
|
}, initialState);
|
|
3452
3467
|
}
|
|
3453
3468
|
|
|
3454
|
-
//
|
|
3469
|
+
// src/presence.tsx
|
|
3455
3470
|
var Presence = (props) => {
|
|
3456
3471
|
const { present, children } = props;
|
|
3457
3472
|
const presence = usePresence$1(present);
|
|
3458
3473
|
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React__namespace.Children.only(children);
|
|
3459
|
-
const ref = useComposedRefs$1(presence.ref, getElementRef(child));
|
|
3474
|
+
const ref = useComposedRefs$1(presence.ref, getElementRef$1(child));
|
|
3460
3475
|
const forceMount = typeof children === "function";
|
|
3461
3476
|
return forceMount || presence.isPresent ? React__namespace.cloneElement(child, { ref }) : null;
|
|
3462
3477
|
};
|
|
3463
3478
|
Presence.displayName = "Presence";
|
|
3464
3479
|
function usePresence$1(present) {
|
|
3465
3480
|
const [node, setNode] = React__namespace.useState();
|
|
3466
|
-
const stylesRef = React__namespace.useRef(
|
|
3481
|
+
const stylesRef = React__namespace.useRef(null);
|
|
3467
3482
|
const prevPresentRef = React__namespace.useRef(present);
|
|
3468
3483
|
const prevAnimationNameRef = React__namespace.useRef("none");
|
|
3469
3484
|
const initialState = present ? "mounted" : "unmounted";
|
|
@@ -3512,7 +3527,7 @@ function usePresence$1(present) {
|
|
|
3512
3527
|
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
3513
3528
|
const handleAnimationEnd = (event) => {
|
|
3514
3529
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
3515
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
3530
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
3516
3531
|
if (event.target === node && isCurrentAnimation) {
|
|
3517
3532
|
send("ANIMATION_END");
|
|
3518
3533
|
if (!prevPresentRef.current) {
|
|
@@ -3547,7 +3562,7 @@ function usePresence$1(present) {
|
|
|
3547
3562
|
return {
|
|
3548
3563
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
3549
3564
|
ref: React__namespace.useCallback((node2) => {
|
|
3550
|
-
|
|
3565
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
3551
3566
|
setNode(node2);
|
|
3552
3567
|
}, [])
|
|
3553
3568
|
};
|
|
@@ -3555,7 +3570,7 @@ function usePresence$1(present) {
|
|
|
3555
3570
|
function getAnimationName(styles) {
|
|
3556
3571
|
return styles?.animationName || "none";
|
|
3557
3572
|
}
|
|
3558
|
-
function getElementRef(element) {
|
|
3573
|
+
function getElementRef$1(element) {
|
|
3559
3574
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
3560
3575
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3561
3576
|
if (mayWarn) {
|
|
@@ -3569,28 +3584,47 @@ function getElementRef(element) {
|
|
|
3569
3584
|
return element.props.ref || element.ref;
|
|
3570
3585
|
}
|
|
3571
3586
|
|
|
3572
|
-
//
|
|
3587
|
+
// src/use-controllable-state.tsx
|
|
3588
|
+
var useInsertionEffect$1 = React__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3573
3589
|
function useControllableState({
|
|
3574
3590
|
prop,
|
|
3575
3591
|
defaultProp,
|
|
3576
3592
|
onChange = () => {
|
|
3577
|
-
}
|
|
3593
|
+
},
|
|
3594
|
+
caller
|
|
3578
3595
|
}) {
|
|
3579
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
3596
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
3597
|
+
defaultProp,
|
|
3598
|
+
onChange
|
|
3599
|
+
});
|
|
3580
3600
|
const isControlled = prop !== void 0;
|
|
3581
3601
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3582
|
-
|
|
3602
|
+
{
|
|
3603
|
+
const isControlledRef = React__namespace.useRef(prop !== void 0);
|
|
3604
|
+
React__namespace.useEffect(() => {
|
|
3605
|
+
const wasControlled = isControlledRef.current;
|
|
3606
|
+
if (wasControlled !== isControlled) {
|
|
3607
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
3608
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
3609
|
+
console.warn(
|
|
3610
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
3611
|
+
);
|
|
3612
|
+
}
|
|
3613
|
+
isControlledRef.current = isControlled;
|
|
3614
|
+
}, [isControlled, caller]);
|
|
3615
|
+
}
|
|
3583
3616
|
const setValue = React__namespace.useCallback(
|
|
3584
3617
|
(nextValue) => {
|
|
3585
3618
|
if (isControlled) {
|
|
3586
|
-
const
|
|
3587
|
-
|
|
3588
|
-
|
|
3619
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
3620
|
+
if (value2 !== prop) {
|
|
3621
|
+
onChangeRef.current?.(value2);
|
|
3622
|
+
}
|
|
3589
3623
|
} else {
|
|
3590
3624
|
setUncontrolledProp(nextValue);
|
|
3591
3625
|
}
|
|
3592
3626
|
},
|
|
3593
|
-
[isControlled, prop, setUncontrolledProp,
|
|
3627
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
3594
3628
|
);
|
|
3595
3629
|
return [value, setValue];
|
|
3596
3630
|
}
|
|
@@ -3598,17 +3632,22 @@ function useUncontrolledState({
|
|
|
3598
3632
|
defaultProp,
|
|
3599
3633
|
onChange
|
|
3600
3634
|
}) {
|
|
3601
|
-
const
|
|
3602
|
-
const [value] = uncontrolledState;
|
|
3635
|
+
const [value, setValue] = React__namespace.useState(defaultProp);
|
|
3603
3636
|
const prevValueRef = React__namespace.useRef(value);
|
|
3604
|
-
const
|
|
3637
|
+
const onChangeRef = React__namespace.useRef(onChange);
|
|
3638
|
+
useInsertionEffect$1(() => {
|
|
3639
|
+
onChangeRef.current = onChange;
|
|
3640
|
+
}, [onChange]);
|
|
3605
3641
|
React__namespace.useEffect(() => {
|
|
3606
3642
|
if (prevValueRef.current !== value) {
|
|
3607
|
-
|
|
3643
|
+
onChangeRef.current?.(value);
|
|
3608
3644
|
prevValueRef.current = value;
|
|
3609
3645
|
}
|
|
3610
|
-
}, [value, prevValueRef
|
|
3611
|
-
return
|
|
3646
|
+
}, [value, prevValueRef]);
|
|
3647
|
+
return [value, setValue, onChangeRef];
|
|
3648
|
+
}
|
|
3649
|
+
function isFunction(value) {
|
|
3650
|
+
return typeof value === "function";
|
|
3612
3651
|
}
|
|
3613
3652
|
|
|
3614
3653
|
var getDefaultParent = function (originalTarget) {
|
|
@@ -4499,7 +4538,7 @@ var ReactRemoveScroll = React__namespace.forwardRef(function (props, ref) { retu
|
|
|
4499
4538
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4500
4539
|
|
|
4501
4540
|
var POPOVER_NAME = "Popover";
|
|
4502
|
-
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
4541
|
+
var [createPopoverContext, createPopoverScope] = createContextScope$1(POPOVER_NAME, [
|
|
4503
4542
|
createPopperScope
|
|
4504
4543
|
]);
|
|
4505
4544
|
var usePopperScope$1 = createPopperScope();
|
|
@@ -4516,10 +4555,11 @@ var Popover = (props) => {
|
|
|
4516
4555
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
4517
4556
|
const triggerRef = React__namespace.useRef(null);
|
|
4518
4557
|
const [hasCustomAnchor, setHasCustomAnchor] = React__namespace.useState(false);
|
|
4519
|
-
const [open
|
|
4558
|
+
const [open, setOpen] = useControllableState({
|
|
4520
4559
|
prop: openProp,
|
|
4521
|
-
defaultProp: defaultOpen,
|
|
4522
|
-
onChange: onOpenChange
|
|
4560
|
+
defaultProp: defaultOpen ?? false,
|
|
4561
|
+
onChange: onOpenChange,
|
|
4562
|
+
caller: POPOVER_NAME
|
|
4523
4563
|
});
|
|
4524
4564
|
return /* @__PURE__ */ jsxRuntime.jsx(Root2$4, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4525
4565
|
PopoverProvider,
|
|
@@ -4562,7 +4602,7 @@ var PopoverTrigger = React__namespace.forwardRef(
|
|
|
4562
4602
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
4563
4603
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
4564
4604
|
const trigger = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4565
|
-
Primitive.button,
|
|
4605
|
+
Primitive$1.button,
|
|
4566
4606
|
{
|
|
4567
4607
|
type: "button",
|
|
4568
4608
|
"aria-haspopup": "dialog",
|
|
@@ -4598,6 +4638,7 @@ var PopoverContent$1 = React__namespace.forwardRef(
|
|
|
4598
4638
|
}
|
|
4599
4639
|
);
|
|
4600
4640
|
PopoverContent$1.displayName = CONTENT_NAME$6;
|
|
4641
|
+
var Slot$2 = createSlot$1("PopoverContent.RemoveScroll");
|
|
4601
4642
|
var PopoverContentModal = React__namespace.forwardRef(
|
|
4602
4643
|
(props, forwardedRef) => {
|
|
4603
4644
|
const context = usePopoverContext(CONTENT_NAME$6, props.__scopePopover);
|
|
@@ -4608,7 +4649,7 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
4608
4649
|
const content = contentRef.current;
|
|
4609
4650
|
if (content) return hideOthers(content);
|
|
4610
4651
|
}, []);
|
|
4611
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4652
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4612
4653
|
PopoverContentImpl,
|
|
4613
4654
|
{
|
|
4614
4655
|
...props,
|
|
@@ -4747,7 +4788,7 @@ var PopoverClose = React__namespace.forwardRef(
|
|
|
4747
4788
|
const { __scopePopover, ...closeProps } = props;
|
|
4748
4789
|
const context = usePopoverContext(CLOSE_NAME$1, __scopePopover);
|
|
4749
4790
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4750
|
-
Primitive.button,
|
|
4791
|
+
Primitive$1.button,
|
|
4751
4792
|
{
|
|
4752
4793
|
type: "button",
|
|
4753
4794
|
...closeProps,
|
|
@@ -4797,30 +4838,31 @@ function getSvgIconPath(icon) {
|
|
|
4797
4838
|
}
|
|
4798
4839
|
|
|
4799
4840
|
const popoverBorderStyles = [
|
|
4800
|
-
'tw
|
|
4801
|
-
'tw
|
|
4802
|
-
'tw
|
|
4803
|
-
'tw
|
|
4804
|
-
'
|
|
4841
|
+
'tw-border-solid',
|
|
4842
|
+
'tw-border',
|
|
4843
|
+
'tw-rounded-md',
|
|
4844
|
+
'tw-border-sq-disabled-gray',
|
|
4845
|
+
'dark:tw-border-gray-500',
|
|
4805
4846
|
].join(' ');
|
|
4806
4847
|
const triggerBackgroundStyles = [
|
|
4807
|
-
'tw
|
|
4808
|
-
'
|
|
4809
|
-
'
|
|
4810
|
-
'
|
|
4811
|
-
'
|
|
4812
|
-
'
|
|
4848
|
+
'tw-bg-transparent',
|
|
4849
|
+
'hover:tw-bg-sq-worksheetspanel-gray',
|
|
4850
|
+
'active:tw-bg-sq-worksheetspanel-gray',
|
|
4851
|
+
'dark:tw-bg-transparent',
|
|
4852
|
+
'dark:hover:tw-bg-sq-field-disabled-gray',
|
|
4853
|
+
'dark:active:tw-bg-sq-field-disabled-gray',
|
|
4813
4854
|
].join(' ');
|
|
4814
4855
|
const activeBackgroundStyles = [
|
|
4815
4856
|
'active',
|
|
4816
|
-
'tw
|
|
4817
|
-
'tw
|
|
4818
|
-
'tw
|
|
4819
|
-
'
|
|
4820
|
-
'
|
|
4857
|
+
'tw-bg-sq-overlay-gray',
|
|
4858
|
+
'hover:tw-bg-sq-overlay-gray',
|
|
4859
|
+
'active:tw-bg-sq-overlay-gray',
|
|
4860
|
+
'dark:tw-bg-sq-dark-disabled-gray',
|
|
4861
|
+
'dark:hover:tw-border-sq-dark-disabled-gray',
|
|
4862
|
+
'dark:active:tw-bg-sq-dark-disabled-gray',
|
|
4821
4863
|
].join(' ');
|
|
4822
|
-
const bgStyles$3 = ['tw
|
|
4823
|
-
const disabledClasses$4 = ['tw
|
|
4864
|
+
const bgStyles$3 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
4865
|
+
const disabledClasses$4 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
4824
4866
|
const PopoverContent = React__namespace.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (jsxRuntime.jsx(Content2$3, { ref: ref, align: align, sideOffset: sideOffset, ...props, asChild: true })));
|
|
4825
4867
|
const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIcon = false, tooltipText, id, popoverContent, extraClassNames, testId, tooltipTestId, tooltipOptions, isActive = false, isHtmlTooltip = false, hasArrow = false, disabled = false, isPrimaryAnSvg = false, primaryIconExtraClassNames = false, iconHeight = 24, iconWidth = 24, primaryIconViewbox = '0 0 24 24', onClick, onHide, }) => {
|
|
4826
4868
|
let tooltipData = undefined;
|
|
@@ -4838,12 +4880,12 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4838
4880
|
onHide && onHide();
|
|
4839
4881
|
}
|
|
4840
4882
|
};
|
|
4841
|
-
return (jsxRuntime.jsxs(Root2$3, { defaultOpen: false, onOpenChange: onOpenChange, children: [jsxRuntime.jsx(Trigger$3, { id: id, className: `tw
|
|
4883
|
+
return (jsxRuntime.jsxs(Root2$3, { defaultOpen: false, onOpenChange: onOpenChange, children: [jsxRuntime.jsx(Trigger$3, { id: id, className: `tw-border-none tw-mx-[1.5px] first:tw-ml-0 last:tw-mr-0 ${isActive ? 'active' : ''}`, disabled: disabled, "data-testid": testId, onClick: (e) => {
|
|
4842
4884
|
onClick && onClick(e);
|
|
4843
|
-
}, children: jsxRuntime.jsxs("div", { ...tooltipData, className: `tw
|
|
4844
|
-
' tw
|
|
4845
|
-
'
|
|
4846
|
-
popoverBorderStyles, children: [hasArrow && (jsxRuntime.jsx(Arrow2$2, { asChild: true, children: jsxRuntime.jsx("div", { className: " tw
|
|
4885
|
+
}, children: jsxRuntime.jsxs("div", { ...tooltipData, className: `tw-flex tw-flex-col tw-items-center tw-rounded-md ${isSmall ? 'tw-py-[1px] tw-px-1' : 'tw-px-2 tw-py-[5px]'} ${disabled ? disabledClasses$4 : isActive ? activeBackgroundStyles : triggerBackgroundStyles} ${extraClassNames || ''}`, children: [jsxRuntime.jsxs("span", { className: "tw-nowrap", children: [isPrimaryAnSvg ? (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw-text-sq-text-color dark:tw-text-sq-dark-text ${primaryIconExtraClassNames || ''}`, viewBox: primaryIconViewbox, height: `${iconHeight}px`, width: `${iconWidth}px`, fill: "currentColor", "data-testid": testId, children: jsxRuntime.jsx("path", { d: getSvgIconPath(icon) }) })) : (jsxRuntime.jsx(Icon, { icon: icon, testId: "firstIcon", type: "text", large: !isSmall && !label && !secondIcon && !forceSmallIcon, extraClassNames: `tw-text-sq-text-color dark:tw-text-sq-dark-text` })), secondIcon && jsxRuntime.jsx(Icon, { icon: secondIcon, type: "text", testId: "secondIcon" }), popoverContent ? (jsxRuntime.jsx(Icon, { icon: "fc-arrow-dropdown", extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-ml-[3px] tw-text-[0.5rem]", type: "text" })) : undefined] }), !isSmall && (jsxRuntime.jsx("small", { className: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-text-[0.625rem]", children: label }))] }) }), !!popoverContent ? (jsxRuntime.jsx(PopoverContent, { sideOffset: 2, align: "start", children: jsxRuntime.jsxs("div", { className: bgStyles$3 +
|
|
4886
|
+
' tw-relative tw-z-[1000] tw-min-w-6 tw-p-[0.5rem] focus-visible:tw-outline-none tw-outline-none data-[state=open]:animate-in data-[state=closed]:animate-out' +
|
|
4887
|
+
' data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2' +
|
|
4888
|
+
popoverBorderStyles, children: [hasArrow && (jsxRuntime.jsx(Arrow2$2, { asChild: true, children: jsxRuntime.jsx("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }) })), popoverContent] }) })) : undefined] }));
|
|
4847
4889
|
};
|
|
4848
4890
|
|
|
4849
4891
|
const setValidInputDimension = (width, height) => {
|
|
@@ -4860,24 +4902,24 @@ const setValidInputDimension = (width, height) => {
|
|
|
4860
4902
|
return inputStyle;
|
|
4861
4903
|
};
|
|
4862
4904
|
|
|
4863
|
-
const errorClasses$4 = 'tw
|
|
4905
|
+
const errorClasses$4 = 'tw-border-sq-danger-color';
|
|
4864
4906
|
const borderColorClasses$4 = [
|
|
4865
|
-
'tw
|
|
4866
|
-
'
|
|
4867
|
-
'
|
|
4868
|
-
'
|
|
4869
|
-
'
|
|
4870
|
-
'
|
|
4907
|
+
'tw-border-sq-disabled-gray',
|
|
4908
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
4909
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4910
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
4911
|
+
'focus:tw-border-sq-color-dark',
|
|
4912
|
+
'active:tw-border-sq-color-dark',
|
|
4871
4913
|
].join(' ');
|
|
4872
|
-
const baseClasses$6 = 'tw
|
|
4873
|
-
'
|
|
4874
|
-
'
|
|
4875
|
-
'
|
|
4876
|
-
const darkTheme$3 = '
|
|
4877
|
-
const lightTheme$3 = 'tw
|
|
4914
|
+
const baseClasses$6 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
|
|
4915
|
+
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4916
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
|
|
4917
|
+
' dark:tw-placeholder-sq-dark-text-lighter specTextField';
|
|
4918
|
+
const darkTheme$3 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
4919
|
+
const lightTheme$3 = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
4878
4920
|
const sizeClasses = {
|
|
4879
|
-
sm: 'tw
|
|
4880
|
-
lg: 'tw
|
|
4921
|
+
sm: 'tw-text-sm',
|
|
4922
|
+
lg: 'tw-text-xl',
|
|
4881
4923
|
};
|
|
4882
4924
|
/**
|
|
4883
4925
|
* Textfield.
|
|
@@ -4919,12 +4961,12 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
4919
4961
|
internalRef.current.value = `${value}`;
|
|
4920
4962
|
}
|
|
4921
4963
|
}, [value]);
|
|
4922
|
-
let borderRadius = 'tw
|
|
4964
|
+
let borderRadius = 'tw-rounded-md';
|
|
4923
4965
|
if (inputGroup === 'left') {
|
|
4924
|
-
borderRadius = 'tw
|
|
4966
|
+
borderRadius = 'tw-rounded-l-md tw-border-r-0 focus:tw-border-r' + ' active:tw-border-r';
|
|
4925
4967
|
}
|
|
4926
4968
|
else if (inputGroup === 'right') {
|
|
4927
|
-
borderRadius = 'tw
|
|
4969
|
+
borderRadius = 'tw-rounded-r-md tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4928
4970
|
}
|
|
4929
4971
|
const appliedClasses = `${baseClasses$6} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$3} ${darkTheme$3} ${borderRadius} ${showError ? errorClasses$4 : borderColorClasses$4} `;
|
|
4930
4972
|
const inputProp = setValidInputDimension(inputWidth, inputHeight)
|
|
@@ -4937,18 +4979,18 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
4937
4979
|
inputLenghtProp.maxLength = maxLength;
|
|
4938
4980
|
if (minLength)
|
|
4939
4981
|
inputLenghtProp.minLength = minLength;
|
|
4940
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, min: min, max: max, ...inputLenghtProp, ...inputProp, ...tooltipData }), errorText && showError && jsxRuntime.jsx("div", { className: "tw
|
|
4982
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, min: min, max: max, ...inputLenghtProp, ...inputProp, ...tooltipData }), errorText && showError && jsxRuntime.jsx("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1", children: errorText })] }));
|
|
4941
4983
|
});
|
|
4942
4984
|
|
|
4943
|
-
const alignment = 'tw
|
|
4944
|
-
const labelClasses = 'tw
|
|
4945
|
-
const baseClasses$5 = 'tw
|
|
4946
|
-
'
|
|
4947
|
-
'
|
|
4948
|
-
'
|
|
4949
|
-
'
|
|
4950
|
-
const checkboxClasses = `tw
|
|
4951
|
-
const radioClasses = `tw
|
|
4985
|
+
const alignment = 'tw-flex';
|
|
4986
|
+
const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
|
|
4987
|
+
const baseClasses$5 = 'tw-border-1 tw-h-3.5 tw-w-3.5 focus:tw-ring-0 focus:tw-ring-offset-0 tw-outline-none focus:tw-outline-none' +
|
|
4988
|
+
' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
|
|
4989
|
+
' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
|
|
4990
|
+
' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
|
|
4991
|
+
' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
|
|
4992
|
+
const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$5}`;
|
|
4993
|
+
const radioClasses = `tw-form-radio ${baseClasses$5}`;
|
|
4952
4994
|
/**
|
|
4953
4995
|
* Checkbox and Radio Box Component.
|
|
4954
4996
|
*/
|
|
@@ -4956,25 +4998,25 @@ const Checkbox = (props) => {
|
|
|
4956
4998
|
const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, ...tooltipProps } = props;
|
|
4957
4999
|
const assignedId = id ?? 'checkbox_' + Math.random();
|
|
4958
5000
|
const tooltipData = getQTipData(tooltipProps);
|
|
4959
|
-
return (jsxRuntime.jsxs("span", { className: `${alignment} ${extraClassNames}`, children: [jsxRuntime.jsx("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, readOnly: !onChange, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw
|
|
4960
|
-
? 'tw
|
|
4961
|
-
: 'tw
|
|
4962
|
-
};
|
|
4963
|
-
|
|
4964
|
-
const baseClasses$4 = 'tw
|
|
4965
|
-
'
|
|
4966
|
-
'
|
|
4967
|
-
const darkTheme$2 = '
|
|
4968
|
-
'
|
|
4969
|
-
const lightTheme$2 = 'tw
|
|
4970
|
-
const errorClasses$3 = 'tw
|
|
5001
|
+
return (jsxRuntime.jsxs("span", { className: `${alignment} ${extraClassNames}`, children: [jsxRuntime.jsx("input", { value: value, type: type, "data-testid": testId, name: name, id: assignedId, readOnly: !onChange, checked: checked, defaultChecked: defaultChecked, className: `${type === 'checkbox' ? checkboxClasses : radioClasses} ${disabled ? 'tw-cursor-not-allowed' : 'tw-cursor-pointer'}`, disabled: disabled, onClick: onClick, onChange: onChange, onKeyDown: onKeyDown, ...tooltipData }), label && (jsxRuntime.jsx("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
|
|
5002
|
+
? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
|
|
5003
|
+
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}`, children: label }))] }));
|
|
5004
|
+
};
|
|
5005
|
+
|
|
5006
|
+
const baseClasses$4 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-md tw-w-full' +
|
|
5007
|
+
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
5008
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
|
|
5009
|
+
const darkTheme$2 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
|
|
5010
|
+
'dark:tw-placeholder-sq-dark-text-lighter disabled:dark:tw-text-sq-dark-text-lighter';
|
|
5011
|
+
const lightTheme$2 = 'tw-text-sq-text-color tw-placeholder-gray-400 disabled:tw-text-sq-darkish-gray';
|
|
5012
|
+
const errorClasses$3 = 'tw-border-sq-danger-color';
|
|
4971
5013
|
const borderColorClasses$3 = [
|
|
4972
|
-
'tw
|
|
4973
|
-
'
|
|
4974
|
-
'
|
|
4975
|
-
'
|
|
4976
|
-
'
|
|
4977
|
-
'
|
|
5014
|
+
'tw-border-sq-disabled-gray',
|
|
5015
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
5016
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
5017
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
5018
|
+
'focus:tw-border-sq-color-dark',
|
|
5019
|
+
'active:tw-border-sq-color-dark',
|
|
4978
5020
|
].join(' ');
|
|
4979
5021
|
/**
|
|
4980
5022
|
* TextArea.
|
|
@@ -5023,25 +5065,25 @@ const TextArea = React.forwardRef(({ readonly = false, disabled = false, onChang
|
|
|
5023
5065
|
* display correctly.
|
|
5024
5066
|
*/
|
|
5025
5067
|
const Tooltip = ({ position = 'bottom', children, text, delay = DEFAULT_TOOL_TIP_DELAY, }) => {
|
|
5026
|
-
const arrowBaseClasses = "
|
|
5027
|
-
const centerArrowVertically = '
|
|
5028
|
-
const centerArrowHorizontally = '
|
|
5029
|
-
const arrowRight = `${arrowBaseClasses} ${centerArrowVertically}
|
|
5030
|
-
|
|
5031
|
-
const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically}
|
|
5032
|
-
|
|
5033
|
-
const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally}
|
|
5034
|
-
|
|
5035
|
-
const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally}
|
|
5036
|
-
|
|
5068
|
+
const arrowBaseClasses = "before:tw-content-[''] before:tw-absolute before:tw-border-8";
|
|
5069
|
+
const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';
|
|
5070
|
+
const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';
|
|
5071
|
+
const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent
|
|
5072
|
+
before:tw-border-l-transparent before:tw-border-r-black`;
|
|
5073
|
+
const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent
|
|
5074
|
+
before:tw-border-l-black before:tw-border-r-transparent`;
|
|
5075
|
+
const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black
|
|
5076
|
+
before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;
|
|
5077
|
+
const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent
|
|
5078
|
+
before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;
|
|
5037
5079
|
const placements = {
|
|
5038
|
-
top:
|
|
5039
|
-
left:
|
|
5040
|
-
right: `tw
|
|
5041
|
-
bottom:
|
|
5080
|
+
top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,
|
|
5081
|
+
left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,
|
|
5082
|
+
right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,
|
|
5083
|
+
bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,
|
|
5042
5084
|
};
|
|
5043
|
-
return (jsxRuntime.jsxs("div", { className: "tw
|
|
5044
|
-
tw
|
|
5085
|
+
return (jsxRuntime.jsxs("div", { className: "tw-group tw-relative tw-inline-block", children: [children, jsxRuntime.jsx("div", { className: `tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms]
|
|
5086
|
+
tw-absolute tw-opacity-0 group-hover:tw-opacity-100 tw-rounded tw-bg-black tw-p-2 tw-text-xs tw-text-white ${placements[position]}`, children: text })] }));
|
|
5045
5087
|
};
|
|
5046
5088
|
|
|
5047
5089
|
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
@@ -7541,8 +7583,8 @@ const QTip = () => {
|
|
|
7541
7583
|
: positionTooltip();
|
|
7542
7584
|
}
|
|
7543
7585
|
};
|
|
7544
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { onMouseEnter: () => setOverTooltip(true), onMouseLeave: () => setOverTooltip(false), "data-testid": tooltipTestId, ref: tooltipRef, className: 'tw
|
|
7545
|
-
(show ? 'tw
|
|
7586
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { onMouseEnter: () => setOverTooltip(true), onMouseLeave: () => setOverTooltip(false), "data-testid": tooltipTestId, ref: tooltipRef, className: 'tw-absolute tw-rounded tw-bg-black tw-max-w-96 tw-p-2 tw-text-xs tw-text-white tw-z-[9999] fade-in ' +
|
|
7587
|
+
(show ? 'tw-visible' : 'tw-invisible tw-pointer-events-none'), children: [html ? jsxRuntime.jsx(HTMLTip, { text: tooltipText }) : tooltipText, jsxRuntime.jsx("div", { className: "tw-absolute tw-w-[10px] tw-h-[10px] tw-rotate-45 tw-bg-black", ref: tooltipArrowRef })] }) }));
|
|
7546
7588
|
};
|
|
7547
7589
|
|
|
7548
7590
|
function _typeof(o) {
|
|
@@ -13957,77 +13999,70 @@ var CreatableSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
13957
13999
|
});
|
|
13958
14000
|
var CreatableSelect$1 = CreatableSelect;
|
|
13959
14001
|
|
|
13960
|
-
const baseClasses$3 = ['
|
|
13961
|
-
const containerStyles = ['tw
|
|
13962
|
-
const errorClasses$2 = 'tw
|
|
13963
|
-
const borderColorClasses$2 = ['tw
|
|
13964
|
-
const borderStyles$3 = ['tw
|
|
14002
|
+
const baseClasses$3 = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
|
|
14003
|
+
const containerStyles = ['tw-bg-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
14004
|
+
const errorClasses$2 = 'tw-border-sq-danger-color';
|
|
14005
|
+
const borderColorClasses$2 = ['tw-border-sq-disabled-gray', 'dark:tw-border-sq-dark-disabled-gray'].join(' ');
|
|
14006
|
+
const borderStyles$3 = ['tw-border-solid', 'tw-border'].join(' ');
|
|
13965
14007
|
const borderActiveClasses = [
|
|
13966
|
-
'
|
|
13967
|
-
'
|
|
13968
|
-
'
|
|
13969
|
-
'
|
|
13970
|
-
'
|
|
13971
|
-
'
|
|
14008
|
+
'hover:tw-border-sq-color-dark',
|
|
14009
|
+
'focus-within:tw-border-sq-color-dark',
|
|
14010
|
+
'active:tw-border-sq-color-dark',
|
|
14011
|
+
'dark:hover:tw-border-sq-color-dark-dark',
|
|
14012
|
+
'dark:focus-within:tw-border-sq-color-dark-dark',
|
|
14013
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
13972
14014
|
].join(' ');
|
|
13973
|
-
const textStyles = ['tw
|
|
14015
|
+
const textStyles = ['tw-text-sq-text-color', 'dark:tw-text-sq-dark-text', 'tw-text-sm'].join(' ');
|
|
13974
14016
|
const textActiveStyles = [
|
|
13975
|
-
'
|
|
13976
|
-
'tw
|
|
13977
|
-
'
|
|
13978
|
-
'tw:dark:text-sq-dark-disabled-gray',
|
|
13979
|
-
'tw:dark:hover:text-sq-theme-dark-dark',
|
|
13980
|
-
'tw:dark:focus:text-sq-theme-dark-dark',
|
|
13981
|
-
'tw:dark:active:text-sq-theme-dark-dark',
|
|
13982
|
-
'tw:hover:text-sq-theme-dark',
|
|
13983
|
-
'tw:dark:text-sq-dark-disabled-gray',
|
|
13984
|
-
'tw:dark:hover:text-sq-theme-dark-dark',
|
|
14017
|
+
'hover:tw-text-sq-color-dark',
|
|
14018
|
+
'dark:tw-text-sq-dark-disabled-gray',
|
|
14019
|
+
'dark:hover:tw-text-sq-color-dark-dark',
|
|
13985
14020
|
].join(' ');
|
|
13986
14021
|
const menuStyles = [
|
|
13987
|
-
'tw
|
|
13988
|
-
'tw
|
|
13989
|
-
'tw
|
|
13990
|
-
'tw
|
|
13991
|
-
'
|
|
13992
|
-
'tw
|
|
13993
|
-
'tw
|
|
13994
|
-
'tw
|
|
14022
|
+
'tw-border-solid',
|
|
14023
|
+
'tw-border',
|
|
14024
|
+
'tw-rounded-b',
|
|
14025
|
+
'tw-border-sq-disabled-gray',
|
|
14026
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
14027
|
+
'tw-whitespace-nowrap',
|
|
14028
|
+
'tw-min-w-fit',
|
|
14029
|
+
'!tw-z-[9999]',
|
|
13995
14030
|
].join(' ');
|
|
13996
14031
|
const menuListStyles = [
|
|
13997
|
-
'tw
|
|
13998
|
-
'tw
|
|
13999
|
-
'
|
|
14000
|
-
'tw
|
|
14001
|
-
'tw
|
|
14032
|
+
'tw-rounded-b',
|
|
14033
|
+
'tw-bg-white',
|
|
14034
|
+
'dark:tw-bg-sq-dark-background',
|
|
14035
|
+
'tw-min-w-fit',
|
|
14036
|
+
'!tw-z-[9999]',
|
|
14002
14037
|
'specSelectMenu',
|
|
14003
14038
|
].join(' ');
|
|
14004
14039
|
const groupHeadingStyles = [
|
|
14005
|
-
'tw
|
|
14006
|
-
'
|
|
14007
|
-
'tw
|
|
14008
|
-
'tw
|
|
14009
|
-
'tw
|
|
14040
|
+
'tw-bg-sq-light-gray',
|
|
14041
|
+
'dark:tw-bg-sq-dark-disabled-gray',
|
|
14042
|
+
'tw-text-sq-darkish-gray',
|
|
14043
|
+
'tw-py-1',
|
|
14044
|
+
'tw-px-2.5',
|
|
14010
14045
|
'specSelectGroupHeading',
|
|
14011
14046
|
].join(' ');
|
|
14012
14047
|
const optionStyles = [
|
|
14013
|
-
'
|
|
14014
|
-
'
|
|
14015
|
-
'
|
|
14016
|
-
'tw
|
|
14017
|
-
'tw
|
|
14048
|
+
'hover:tw-bg-sq-gray-highlight',
|
|
14049
|
+
'hover:tw-cursor-pointer',
|
|
14050
|
+
'dark:hover:tw-bg-sq-gray-highlight-dark',
|
|
14051
|
+
'tw-py-1',
|
|
14052
|
+
'tw-px-2.5',
|
|
14018
14053
|
'specSelectOption',
|
|
14019
14054
|
].join(' ');
|
|
14020
|
-
const disabledClasses$3 = ['tw
|
|
14021
|
-
const dropDownIndicatorStyles = `tw
|
|
14022
|
-
const placeholderStyles = ['tw
|
|
14055
|
+
const disabledClasses$3 = ['tw-bg-sq-field-disabled-gray', '!tw-cursor-not-allowed', 'tw-opacity-50'].join(' ');
|
|
14056
|
+
const dropDownIndicatorStyles = `tw-text-sq-disabled-gray ${textActiveStyles} specOpenIt`;
|
|
14057
|
+
const placeholderStyles = ['tw-text-gray-400', 'dark:tw-text-sq-dark-text-lighter', 'specOpenSelect'].join(' ');
|
|
14023
14058
|
const multiValueStyles = [
|
|
14024
|
-
'tw
|
|
14025
|
-
'
|
|
14026
|
-
'tw
|
|
14027
|
-
'tw
|
|
14028
|
-
'tw
|
|
14029
|
-
'tw
|
|
14030
|
-
'tw
|
|
14059
|
+
'tw-bg-sq-disabled-gray',
|
|
14060
|
+
'dark:tw-bg-sq-multi-gray-dark',
|
|
14061
|
+
'tw-text-sm',
|
|
14062
|
+
'tw-py-0.5',
|
|
14063
|
+
'tw-px-1',
|
|
14064
|
+
'tw-m-0.5',
|
|
14065
|
+
'tw-rounded-sm',
|
|
14031
14066
|
'specOpenSelect',
|
|
14032
14067
|
].join(' ');
|
|
14033
14068
|
/**
|
|
@@ -14092,38 +14127,38 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
14092
14127
|
filterOption: filterOption ? filterOption : filterConfig ? createFilter(filterConfig) : undefined,
|
|
14093
14128
|
classNames: {
|
|
14094
14129
|
control: ({ menuIsOpen }) => {
|
|
14095
|
-
let border = menuIsOpen ? 'tw
|
|
14130
|
+
let border = menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
14096
14131
|
// if it's on the left side of the input group make sure the right side is straight and not curved
|
|
14097
14132
|
if (inputGroup === 'left') {
|
|
14098
|
-
border = menuIsOpen ? 'tw
|
|
14133
|
+
border = menuIsOpen ? 'tw-rounded-tl-md' : 'tw-rounded-l-md';
|
|
14099
14134
|
}
|
|
14100
14135
|
else if (inputGroup === 'right') {
|
|
14101
|
-
border = menuIsOpen ? 'tw
|
|
14136
|
+
border = menuIsOpen ? 'tw-rounded-tr-md' : 'tw-rounded-r-md';
|
|
14102
14137
|
}
|
|
14103
14138
|
const appliedClasses = `${borderStyles$3} ${isDisabled ? '' : borderActiveClasses} ${border} ${showError ? errorClasses$2 : borderColorClasses$2} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} ${controlClassNames}`;
|
|
14104
|
-
return `${appliedClasses} ${baseClasses$3} ${containerStyles} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw
|
|
14139
|
+
return `${appliedClasses} ${baseClasses$3} ${containerStyles} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
14105
14140
|
},
|
|
14106
14141
|
placeholder: () => placeholderStyles,
|
|
14107
14142
|
container: ({ selectProps }) => {
|
|
14108
|
-
const containerBorderStyles = selectProps?.menuIsOpen ? 'tw
|
|
14109
|
-
return `${textStyles} ${extraClassNames} ${containerBorderStyles} tw
|
|
14143
|
+
const containerBorderStyles = selectProps?.menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
14144
|
+
return `${textStyles} ${extraClassNames} ${containerBorderStyles} !tw-pointer-events-auto`;
|
|
14110
14145
|
},
|
|
14111
14146
|
input: () => textStyles + ' specSelectInput',
|
|
14112
14147
|
menuList: () => menuListStyles,
|
|
14113
14148
|
menu: () => menuStyles,
|
|
14114
|
-
menuPortal: () => 'tw
|
|
14149
|
+
menuPortal: () => '!tw-z-[9000]',
|
|
14115
14150
|
dropdownIndicator: () => dropDownIndicatorStyles,
|
|
14116
14151
|
option: ({ isSelected, isDisabled }) => {
|
|
14117
14152
|
let classes = optionStyles;
|
|
14118
14153
|
if (isDisabled) {
|
|
14119
14154
|
classes += ' specDisabledOption ';
|
|
14120
14155
|
}
|
|
14121
|
-
return isSelected ? classes + ' tw
|
|
14156
|
+
return isSelected ? classes + ' tw-bg-sq-colored-hover dark:tw-bg-sq-colored-hover-dark' : classes;
|
|
14122
14157
|
},
|
|
14123
14158
|
singleValue: () => 'specOpenSelect',
|
|
14124
14159
|
multiValue: () => multiValueStyles,
|
|
14125
|
-
multiValueRemove: () => '
|
|
14126
|
-
clearIndicator: () => 'tw
|
|
14160
|
+
multiValueRemove: () => 'hover:tw-text-sq-danger-color specSelectMultiValueRemove',
|
|
14161
|
+
clearIndicator: () => 'tw-text-sq-disabled-gray hover:tw-text-sq-danger-color specClearSelect',
|
|
14127
14162
|
group: () => 'specSelectGroup',
|
|
14128
14163
|
groupHeading: () => groupHeadingStyles,
|
|
14129
14164
|
},
|
|
@@ -14132,7 +14167,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
14132
14167
|
};
|
|
14133
14168
|
|
|
14134
14169
|
var DIALOG_NAME = "Dialog";
|
|
14135
|
-
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
14170
|
+
var [createDialogContext, createDialogScope] = createContextScope$1(DIALOG_NAME);
|
|
14136
14171
|
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
14137
14172
|
var Dialog$1 = (props) => {
|
|
14138
14173
|
const {
|
|
@@ -14145,10 +14180,11 @@ var Dialog$1 = (props) => {
|
|
|
14145
14180
|
} = props;
|
|
14146
14181
|
const triggerRef = React__namespace.useRef(null);
|
|
14147
14182
|
const contentRef = React__namespace.useRef(null);
|
|
14148
|
-
const [open
|
|
14183
|
+
const [open, setOpen] = useControllableState({
|
|
14149
14184
|
prop: openProp,
|
|
14150
|
-
defaultProp: defaultOpen,
|
|
14151
|
-
onChange: onOpenChange
|
|
14185
|
+
defaultProp: defaultOpen ?? false,
|
|
14186
|
+
onChange: onOpenChange,
|
|
14187
|
+
caller: DIALOG_NAME
|
|
14152
14188
|
});
|
|
14153
14189
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14154
14190
|
DialogProvider,
|
|
@@ -14175,7 +14211,7 @@ var DialogTrigger = React__namespace.forwardRef(
|
|
|
14175
14211
|
const context = useDialogContext(TRIGGER_NAME$4, __scopeDialog);
|
|
14176
14212
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
14177
14213
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14178
|
-
Primitive.button,
|
|
14214
|
+
Primitive$1.button,
|
|
14179
14215
|
{
|
|
14180
14216
|
type: "button",
|
|
14181
14217
|
"aria-haspopup": "dialog",
|
|
@@ -14210,6 +14246,7 @@ var DialogOverlay = React__namespace.forwardRef(
|
|
|
14210
14246
|
}
|
|
14211
14247
|
);
|
|
14212
14248
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
14249
|
+
var Slot$1 = createSlot$1("DialogOverlay.RemoveScroll");
|
|
14213
14250
|
var DialogOverlayImpl = React__namespace.forwardRef(
|
|
14214
14251
|
(props, forwardedRef) => {
|
|
14215
14252
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -14217,8 +14254,8 @@ var DialogOverlayImpl = React__namespace.forwardRef(
|
|
|
14217
14254
|
return (
|
|
14218
14255
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
14219
14256
|
// ie. when `Overlay` and `Content` are siblings
|
|
14220
|
-
/* @__PURE__ */ jsxRuntime.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14221
|
-
Primitive.div,
|
|
14257
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReactRemoveScroll, { as: Slot$1, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14258
|
+
Primitive$1.div,
|
|
14222
14259
|
{
|
|
14223
14260
|
"data-state": getState$2(context.open),
|
|
14224
14261
|
...overlayProps,
|
|
@@ -14356,7 +14393,7 @@ var DialogTitle$1 = React__namespace.forwardRef(
|
|
|
14356
14393
|
(props, forwardedRef) => {
|
|
14357
14394
|
const { __scopeDialog, ...titleProps } = props;
|
|
14358
14395
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
14359
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
14396
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
14360
14397
|
}
|
|
14361
14398
|
);
|
|
14362
14399
|
DialogTitle$1.displayName = TITLE_NAME;
|
|
@@ -14365,7 +14402,7 @@ var DialogDescription$1 = React__namespace.forwardRef(
|
|
|
14365
14402
|
(props, forwardedRef) => {
|
|
14366
14403
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
14367
14404
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
14368
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
14405
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
14369
14406
|
}
|
|
14370
14407
|
);
|
|
14371
14408
|
DialogDescription$1.displayName = DESCRIPTION_NAME;
|
|
@@ -14375,7 +14412,7 @@ var DialogClose$1 = React__namespace.forwardRef(
|
|
|
14375
14412
|
const { __scopeDialog, ...closeProps } = props;
|
|
14376
14413
|
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
14377
14414
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14378
|
-
Primitive.button,
|
|
14415
|
+
Primitive$1.button,
|
|
14379
14416
|
{
|
|
14380
14417
|
type: "button",
|
|
14381
14418
|
...closeProps,
|
|
@@ -14513,11 +14550,11 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
14513
14550
|
const Dialog = Root$4;
|
|
14514
14551
|
const DialogPortal = Portal$1;
|
|
14515
14552
|
const DialogClose = Close;
|
|
14516
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx("div", { className: "tw
|
|
14517
|
-
tw
|
|
14518
|
-
tw
|
|
14553
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx("div", { className: "tw-select-none tw-fixed tw-w-full tw-h-full tw-opacity-50 tw-inset-0 tw-z-[1009] tw-bg-sq-dark-background\n data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0\n data-[state=open]:fade-in-0 " }), jsxRuntime.jsxs(Content$2, { ref: ref, className: `tw-fixed tw-left-[50%] tw-top-0 tw-my-6 tw-translate-x-[-50%] tw-z-[1010] tw-grid
|
|
14554
|
+
tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
|
|
14555
|
+
tw-rounded-lg ${className}`, ...props, children: [jsxRuntime.jsx(DialogTitle$1, { className: "tw-hidden" }), children] })] })));
|
|
14519
14556
|
DialogContent.displayName = Content$2.displayName;
|
|
14520
|
-
const DialogHeader = (props) => (jsxRuntime.jsx("div", { className: "tw
|
|
14557
|
+
const DialogHeader = (props) => (jsxRuntime.jsx("div", { className: "tw-w-full tw-justify-between", children: jsxRuntime.jsx("div", { ...props }) }));
|
|
14521
14558
|
DialogHeader.displayName = 'DialogHeader';
|
|
14522
14559
|
const DialogFooter = (props) => jsxRuntime.jsx("div", { ...props });
|
|
14523
14560
|
DialogFooter.displayName = 'DialogFooter';
|
|
@@ -14555,31 +14592,31 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
|
|
|
14555
14592
|
let titleIconElement = jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
14556
14593
|
if (titleIcon) {
|
|
14557
14594
|
if (typeof titleIcon === 'string') {
|
|
14558
|
-
titleIconElement = (jsxRuntime.jsx(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw
|
|
14595
|
+
titleIconElement = (jsxRuntime.jsx(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
|
|
14559
14596
|
}
|
|
14560
14597
|
else {
|
|
14561
|
-
titleIconElement = jsxRuntime.jsx("div", { className: "tw
|
|
14598
|
+
titleIconElement = jsxRuntime.jsx("div", { className: "tw-mt-1.5", children: titleIcon });
|
|
14562
14599
|
}
|
|
14563
14600
|
}
|
|
14564
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [titleIcon && titleIconPosition === 'left' ? jsxRuntime.jsx("div", { className: "tw
|
|
14601
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [titleIcon && titleIconPosition === 'left' ? jsxRuntime.jsx("div", { className: "tw-flex tw-mr-2", children: titleIconElement }) : jsxRuntime.jsx(jsxRuntime.Fragment, {}), jsxRuntime.jsx(DialogTitle, { asChild: true, children: isTitleEditable ? (jsxRuntime.jsxs("div", { className: "tw-flex tw-w-full tw-items-center", children: [jsxRuntime.jsx(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }), titleError && jsxRuntime.jsx("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0", children: titleError })] })) : (customHeader ?? (jsxRuntime.jsxs("div", { "data-testid": "modalTitle", className: "modal-title", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx("h3", { children: title }), titleSuffixLabel && jsxRuntime.jsx("span", { className: "tw-text-xl tw-pl-0.5", children: titleSuffixLabel })] }), subtitle && (jsxRuntime.jsx("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle", children: subtitle }))] }))) }), titleIcon && titleIconPosition === 'right' ? jsxRuntime.jsx("div", { className: "tw-flex tw-ml-4", children: titleIconElement }) : jsxRuntime.jsx(jsxRuntime.Fragment, {})] }));
|
|
14565
14602
|
};
|
|
14566
|
-
return open ? (jsxRuntime.jsx(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: jsxRuntime.jsxs(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw
|
|
14567
|
-
'tw
|
|
14568
|
-
'tw
|
|
14569
|
-
'tw
|
|
14570
|
-
'tw
|
|
14571
|
-
'tw
|
|
14572
|
-
'tw
|
|
14573
|
-
'tw
|
|
14574
|
-
'tw
|
|
14575
|
-
'tw
|
|
14576
|
-
'tw
|
|
14577
|
-
}, dialogClassName), children: [jsxRuntime.jsxs(DialogHeader, { className: "modal-header tw
|
|
14603
|
+
return open ? (jsxRuntime.jsx(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: jsxRuntime.jsxs(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw-w-full !tw-p-0 tw-border-none tw-shadow-none dark:tw-text-sq-dark-text !tw-gap-0`, {
|
|
14604
|
+
'tw-max-w-xs': size === 'xs',
|
|
14605
|
+
'tw-max-w-sm': size === 'sm',
|
|
14606
|
+
'tw-max-w-md': size === 'md',
|
|
14607
|
+
'tw-max-w-lg': size === 'lg',
|
|
14608
|
+
'tw-max-w-xl': size === 'xl',
|
|
14609
|
+
'tw-max-w-2xl': size === '2xl',
|
|
14610
|
+
'tw-max-w-3xl': size === '3xl',
|
|
14611
|
+
'tw-max-w-4xl': size === '4xl',
|
|
14612
|
+
'tw-max-w-5xl': size === '5xl',
|
|
14613
|
+
'tw-max-w-6xl': size === '6xl',
|
|
14614
|
+
}, dialogClassName), children: [jsxRuntime.jsxs(DialogHeader, { className: "modal-header tw-flex tw-w-full tw-justify-between tw-border-sq-disabled-gray\n dark:tw-border-sq-dark-disabled-gray tw-border-0 tw-border-b tw-px-6 tw-py-4", children: [jsxRuntime.jsx("div", { className: "tw-flex tw-w-full", children: renderTitle() }), !hideCloseIcon && (jsxRuntime.jsx(DialogClose, { autoFocus: false, className: "[&:has(:focus-visible)]:none tw-opacity-70 tw-bg-transparent hover:tw-opacity-100 close tw-text-base tw-cursor-pointer tw-ml-4", "data-testid": "closeButton", children: jsxRuntime.jsx("span", { className: "tw-cursor-pointer", children: "\u00D7" }) }))] }), jsxRuntime.jsx(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true, children: children }), !hideFooterButtons && (jsxRuntime.jsx(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4", children: modalFooter ?? (jsxRuntime.jsxs("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter", children: [jsxRuntime.jsx("div", { className: "tw-flex tw-justify-start", children: customButton && (jsxRuntime.jsx(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant })) }), jsxRuntime.jsxs("div", { className: "tw-flex tw-justify-end", children: [jsxRuntime.jsx("div", { className: "tw-flex tw-items-center", children: middleFooterSection }), !hideCancelButton && (jsxRuntime.jsx(DialogClose, { asChild: true, children: jsxRuntime.jsx(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }) })), !hideSubmitButton && (jsxRuntime.jsx(Button, { label: submitButtonLabel, onClick: handleSubmit, disabled: disableSubmitButton || isLoading, variant: submitButtonVariant, stopPropagation: stopPropagationSubmitButton, tooltip: submitButtonTooltip, icon: isLoading ? 'fc-loading-notch tw-animate-spin' : undefined, iconPosition: "left", testId: "submitButton", extraClassNames: "tw-min-w-[100px]" }))] })] })) }))] }) })) : (jsxRuntime.jsx(jsxRuntime.Fragment, {}));
|
|
14578
14615
|
};
|
|
14579
14616
|
|
|
14580
14617
|
function createCollection(name) {
|
|
14581
14618
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
14582
|
-
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
14619
|
+
const [createCollectionContext, createCollectionScope] = createContextScope$1(PROVIDER_NAME);
|
|
14583
14620
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
14584
14621
|
PROVIDER_NAME,
|
|
14585
14622
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
@@ -14592,17 +14629,19 @@ function createCollection(name) {
|
|
|
14592
14629
|
};
|
|
14593
14630
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
14594
14631
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
14632
|
+
const CollectionSlotImpl = createSlot$1(COLLECTION_SLOT_NAME);
|
|
14595
14633
|
const CollectionSlot = React.forwardRef(
|
|
14596
14634
|
(props, forwardedRef) => {
|
|
14597
14635
|
const { scope, children } = props;
|
|
14598
14636
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14599
14637
|
const composedRefs = useComposedRefs$1(forwardedRef, context.collectionRef);
|
|
14600
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14638
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
14601
14639
|
}
|
|
14602
14640
|
);
|
|
14603
14641
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
14604
14642
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
14605
14643
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
14644
|
+
const CollectionItemSlotImpl = createSlot$1(ITEM_SLOT_NAME);
|
|
14606
14645
|
const CollectionItemSlot = React.forwardRef(
|
|
14607
14646
|
(props, forwardedRef) => {
|
|
14608
14647
|
const { scope, children, ...itemData } = props;
|
|
@@ -14613,7 +14652,7 @@ function createCollection(name) {
|
|
|
14613
14652
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
14614
14653
|
return () => void context.itemMap.delete(ref);
|
|
14615
14654
|
});
|
|
14616
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14655
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
14617
14656
|
}
|
|
14618
14657
|
);
|
|
14619
14658
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -14638,7 +14677,7 @@ function createCollection(name) {
|
|
|
14638
14677
|
];
|
|
14639
14678
|
}
|
|
14640
14679
|
|
|
14641
|
-
// packages/react/direction/src/
|
|
14680
|
+
// packages/react/direction/src/direction.tsx
|
|
14642
14681
|
var DirectionContext = React__namespace.createContext(void 0);
|
|
14643
14682
|
function useDirection(localDir) {
|
|
14644
14683
|
const globalDir = React__namespace.useContext(DirectionContext);
|
|
@@ -14649,7 +14688,7 @@ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
|
14649
14688
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
14650
14689
|
var GROUP_NAME$2 = "RovingFocusGroup";
|
|
14651
14690
|
var [Collection$3, useCollection$3, createCollectionScope$3] = createCollection(GROUP_NAME$2);
|
|
14652
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
14691
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope$1(
|
|
14653
14692
|
GROUP_NAME$2,
|
|
14654
14693
|
[createCollectionScope$3]
|
|
14655
14694
|
);
|
|
@@ -14676,10 +14715,11 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
14676
14715
|
const ref = React__namespace.useRef(null);
|
|
14677
14716
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
14678
14717
|
const direction = useDirection(dir);
|
|
14679
|
-
const [currentTabStopId
|
|
14718
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
14680
14719
|
prop: currentTabStopIdProp,
|
|
14681
|
-
defaultProp: defaultCurrentTabStopId,
|
|
14682
|
-
onChange: onCurrentTabStopIdChange
|
|
14720
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
14721
|
+
onChange: onCurrentTabStopIdChange,
|
|
14722
|
+
caller: GROUP_NAME$2
|
|
14683
14723
|
});
|
|
14684
14724
|
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
14685
14725
|
const handleEntryFocus = useCallbackRef$1(onEntryFocus);
|
|
@@ -14715,7 +14755,7 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
14715
14755
|
[]
|
|
14716
14756
|
),
|
|
14717
14757
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14718
|
-
Primitive.div,
|
|
14758
|
+
Primitive$1.div,
|
|
14719
14759
|
{
|
|
14720
14760
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
14721
14761
|
"data-orientation": orientation,
|
|
@@ -14757,6 +14797,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14757
14797
|
focusable = true,
|
|
14758
14798
|
active = false,
|
|
14759
14799
|
tabStopId,
|
|
14800
|
+
children,
|
|
14760
14801
|
...itemProps
|
|
14761
14802
|
} = props;
|
|
14762
14803
|
const autoId = useId();
|
|
@@ -14764,7 +14805,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14764
14805
|
const context = useRovingFocusContext(ITEM_NAME$3, __scopeRovingFocusGroup);
|
|
14765
14806
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
14766
14807
|
const getItems = useCollection$3(__scopeRovingFocusGroup);
|
|
14767
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
14808
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
14768
14809
|
React__namespace.useEffect(() => {
|
|
14769
14810
|
if (focusable) {
|
|
14770
14811
|
onFocusableItemAdd();
|
|
@@ -14779,7 +14820,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14779
14820
|
focusable,
|
|
14780
14821
|
active,
|
|
14781
14822
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14782
|
-
Primitive.span,
|
|
14823
|
+
Primitive$1.span,
|
|
14783
14824
|
{
|
|
14784
14825
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
14785
14826
|
"data-orientation": context.orientation,
|
|
@@ -14810,7 +14851,8 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14810
14851
|
}
|
|
14811
14852
|
setTimeout(() => focusFirst$1(candidateNodes));
|
|
14812
14853
|
}
|
|
14813
|
-
})
|
|
14854
|
+
}),
|
|
14855
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
14814
14856
|
}
|
|
14815
14857
|
)
|
|
14816
14858
|
}
|
|
@@ -14853,7 +14895,7 @@ var Root$3 = RovingFocusGroup;
|
|
|
14853
14895
|
var Item$1 = RovingFocusGroupItem;
|
|
14854
14896
|
|
|
14855
14897
|
var TABS_NAME = "Tabs";
|
|
14856
|
-
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
14898
|
+
var [createTabsContext, createTabsScope] = createContextScope$1(TABS_NAME, [
|
|
14857
14899
|
createRovingFocusGroupScope
|
|
14858
14900
|
]);
|
|
14859
14901
|
var useRovingFocusGroupScope$1 = createRovingFocusGroupScope();
|
|
@@ -14874,7 +14916,8 @@ var Tabs$1 = React__namespace.forwardRef(
|
|
|
14874
14916
|
const [value, setValue] = useControllableState({
|
|
14875
14917
|
prop: valueProp,
|
|
14876
14918
|
onChange: onValueChange,
|
|
14877
|
-
defaultProp: defaultValue
|
|
14919
|
+
defaultProp: defaultValue ?? "",
|
|
14920
|
+
caller: TABS_NAME
|
|
14878
14921
|
});
|
|
14879
14922
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14880
14923
|
TabsProvider,
|
|
@@ -14887,7 +14930,7 @@ var Tabs$1 = React__namespace.forwardRef(
|
|
|
14887
14930
|
dir: direction,
|
|
14888
14931
|
activationMode,
|
|
14889
14932
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14890
|
-
Primitive.div,
|
|
14933
|
+
Primitive$1.div,
|
|
14891
14934
|
{
|
|
14892
14935
|
dir: direction,
|
|
14893
14936
|
"data-orientation": orientation,
|
|
@@ -14915,7 +14958,7 @@ var TabsList = React__namespace.forwardRef(
|
|
|
14915
14958
|
dir: context.dir,
|
|
14916
14959
|
loop,
|
|
14917
14960
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14918
|
-
Primitive.div,
|
|
14961
|
+
Primitive$1.div,
|
|
14919
14962
|
{
|
|
14920
14963
|
role: "tablist",
|
|
14921
14964
|
"aria-orientation": context.orientation,
|
|
@@ -14945,7 +14988,7 @@ var TabsTrigger = React__namespace.forwardRef(
|
|
|
14945
14988
|
focusable: !disabled,
|
|
14946
14989
|
active: isSelected,
|
|
14947
14990
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14948
|
-
Primitive.button,
|
|
14991
|
+
Primitive$1.button,
|
|
14949
14992
|
{
|
|
14950
14993
|
type: "button",
|
|
14951
14994
|
role: "tab",
|
|
@@ -14994,7 +15037,7 @@ var TabsContent = React__namespace.forwardRef(
|
|
|
14994
15037
|
return () => cancelAnimationFrame(rAF);
|
|
14995
15038
|
}, []);
|
|
14996
15039
|
return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14997
|
-
Primitive.div,
|
|
15040
|
+
Primitive$1.div,
|
|
14998
15041
|
{
|
|
14999
15042
|
"data-state": isSelected ? "active" : "inactive",
|
|
15000
15043
|
"data-orientation": context.orientation,
|
|
@@ -15032,15 +15075,15 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
15032
15075
|
return;
|
|
15033
15076
|
onTabSelect && onTabSelect(tabId);
|
|
15034
15077
|
};
|
|
15035
|
-
return (jsxRuntime.jsxs(Root2$2, { className: `tw
|
|
15036
|
-
? 'tw
|
|
15037
|
-
: '
|
|
15038
|
-
? '
|
|
15039
|
-
: '
|
|
15078
|
+
return (jsxRuntime.jsxs(Root2$2, { className: `tw-flex tw-flex-col tw-min-w-[300px] tw-max-w-full tw-flex-grow focus-visible:tw-outline-none ${extraClassNames || ''}`, defaultValue: defaultActiveTab, "data-testid": testId, id: id, value: activeTab, onValueChange: handleTabSelect, children: [jsxRuntime.jsx(List, { className: `tw-flex tw-flex-row tw-flex-wrap tw-z-[1001]`, children: tabs.map(({ id, icon, label, tabExtraClassNames, testId: tabsTestId, disabled, tabLabelExtraClassNames = '' }, index) => (jsxRuntime.jsx(Trigger$2, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-h-[25px] focus-visible:tw-outline-none tw-min-w-[100px] tw-px-4 tw-border-solid dark:tw-border-gray-700 tw-flex tw-flex-1 tw-justify-center tw-items-center tw-border-r-[2px] last:tw-border-r-0 ${stretchTabs ? '' : 'tw-max-w-max tw-min-w-fit'} ${tabExtraClassNames || ''} ${activeTab === id
|
|
15079
|
+
? 'tw-border-b-sq-color-dark dark:tw-border-b-sq-color-dark tw-border-b-[3px]'
|
|
15080
|
+
: 'hover:tw-bg-sq-light-gray tw-border-b-[1px] hover:dark:tw-bg-gray-700'}`, "data-testid": tabsTestId, disabled: disabled, value: id, children: jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-overflow-hidden tw-pb-[3px]", children: [icon && (jsxRuntime.jsx(Icon, { icon: icon, testId: `${id}_tab-icon`, extraClassNames: "tw-text-[0.9375rem] tw-mr-[7px] tw-flex-shrink-0" })), jsxRuntime.jsx("span", { className: `tw-text-[0.875rem] tw-font-medium tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis ${activeTab === id
|
|
15081
|
+
? 'dark:tw-text-sq-dark-text tw-text-gray-500'
|
|
15082
|
+
: 'dark:tw-text-sq-color-dark-dark tw-text-sq-color-dark'} ${tabLabelExtraClassNames}`, children: label })] }) }, `${label}-${id}-${index}`))) }), tabs.map((tab, index) => (jsxRuntime.jsx(Content$1, { className: `tw-bg-sq-white dark:tw-bg-sq-dark-background tw-overflow-y-auto -tw-mt-[1px] tw-border-t-[1px] dark:tw-border-gray-700 tw-z-[500] tw-flex tw-flex-col tw-flex-grow focus-visible:tw-outline-none ${tab.tabContentExtraClassNames || ''}`, value: tab.id, children: tab.content }, `${tab.label}_${index}_content`)))] }));
|
|
15040
15083
|
};
|
|
15041
15084
|
|
|
15042
15085
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
15043
|
-
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
15086
|
+
var [createCollapsibleContext, createCollapsibleScope] = createContextScope$1(COLLAPSIBLE_NAME);
|
|
15044
15087
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
15045
15088
|
var Collapsible = React__namespace.forwardRef(
|
|
15046
15089
|
(props, forwardedRef) => {
|
|
@@ -15052,10 +15095,11 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
15052
15095
|
onOpenChange,
|
|
15053
15096
|
...collapsibleProps
|
|
15054
15097
|
} = props;
|
|
15055
|
-
const [open
|
|
15098
|
+
const [open, setOpen] = useControllableState({
|
|
15056
15099
|
prop: openProp,
|
|
15057
|
-
defaultProp: defaultOpen,
|
|
15058
|
-
onChange: onOpenChange
|
|
15100
|
+
defaultProp: defaultOpen ?? false,
|
|
15101
|
+
onChange: onOpenChange,
|
|
15102
|
+
caller: COLLAPSIBLE_NAME
|
|
15059
15103
|
});
|
|
15060
15104
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15061
15105
|
CollapsibleProvider,
|
|
@@ -15066,7 +15110,7 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
15066
15110
|
open,
|
|
15067
15111
|
onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
15068
15112
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15069
|
-
Primitive.div,
|
|
15113
|
+
Primitive$1.div,
|
|
15070
15114
|
{
|
|
15071
15115
|
"data-state": getState$1(open),
|
|
15072
15116
|
"data-disabled": disabled ? "" : void 0,
|
|
@@ -15085,7 +15129,7 @@ var CollapsibleTrigger = React__namespace.forwardRef(
|
|
|
15085
15129
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
15086
15130
|
const context = useCollapsibleContext(TRIGGER_NAME$2, __scopeCollapsible);
|
|
15087
15131
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15088
|
-
Primitive.button,
|
|
15132
|
+
Primitive$1.button,
|
|
15089
15133
|
{
|
|
15090
15134
|
type: "button",
|
|
15091
15135
|
"aria-controls": context.contentId,
|
|
@@ -15147,7 +15191,7 @@ var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
15147
15191
|
}
|
|
15148
15192
|
}, [context.open, present]);
|
|
15149
15193
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15150
|
-
Primitive.div,
|
|
15194
|
+
Primitive$1.div,
|
|
15151
15195
|
{
|
|
15152
15196
|
"data-state": getState$1(context.open),
|
|
15153
15197
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -15174,7 +15218,7 @@ var Content = CollapsibleContent;
|
|
|
15174
15218
|
var ACCORDION_NAME = "Accordion";
|
|
15175
15219
|
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
15176
15220
|
var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(ACCORDION_NAME);
|
|
15177
|
-
var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [
|
|
15221
|
+
var [createAccordionContext, createAccordionScope] = createContextScope$1(ACCORDION_NAME, [
|
|
15178
15222
|
createCollectionScope$2,
|
|
15179
15223
|
createCollapsibleScope
|
|
15180
15224
|
]);
|
|
@@ -15205,14 +15249,15 @@ var AccordionImplSingle = React.forwardRef(
|
|
|
15205
15249
|
} = props;
|
|
15206
15250
|
const [value, setValue] = useControllableState({
|
|
15207
15251
|
prop: valueProp,
|
|
15208
|
-
defaultProp: defaultValue,
|
|
15209
|
-
onChange: onValueChange
|
|
15252
|
+
defaultProp: defaultValue ?? "",
|
|
15253
|
+
onChange: onValueChange,
|
|
15254
|
+
caller: ACCORDION_NAME
|
|
15210
15255
|
});
|
|
15211
15256
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15212
15257
|
AccordionValueProvider,
|
|
15213
15258
|
{
|
|
15214
15259
|
scope: props.__scopeAccordion,
|
|
15215
|
-
value: value ? [value] : [],
|
|
15260
|
+
value: React.useMemo(() => value ? [value] : [], [value]),
|
|
15216
15261
|
onItemOpen: setValue,
|
|
15217
15262
|
onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
15218
15263
|
children: /* @__PURE__ */ jsxRuntime.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsxRuntime.jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
@@ -15228,10 +15273,11 @@ var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
|
|
|
15228
15273
|
},
|
|
15229
15274
|
...accordionMultipleProps
|
|
15230
15275
|
} = props;
|
|
15231
|
-
const [value
|
|
15276
|
+
const [value, setValue] = useControllableState({
|
|
15232
15277
|
prop: valueProp,
|
|
15233
|
-
defaultProp: defaultValue,
|
|
15234
|
-
onChange: onValueChange
|
|
15278
|
+
defaultProp: defaultValue ?? [],
|
|
15279
|
+
onChange: onValueChange,
|
|
15280
|
+
caller: ACCORDION_NAME
|
|
15235
15281
|
});
|
|
15236
15282
|
const handleItemOpen = React.useCallback(
|
|
15237
15283
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
@@ -15331,7 +15377,7 @@ var AccordionImpl = React.forwardRef(
|
|
|
15331
15377
|
direction: dir,
|
|
15332
15378
|
orientation,
|
|
15333
15379
|
children: /* @__PURE__ */ jsxRuntime.jsx(Collection$2.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15334
|
-
Primitive.div,
|
|
15380
|
+
Primitive$1.div,
|
|
15335
15381
|
{
|
|
15336
15382
|
...accordionProps,
|
|
15337
15383
|
"data-orientation": orientation,
|
|
@@ -15392,7 +15438,7 @@ var AccordionHeader = React.forwardRef(
|
|
|
15392
15438
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
15393
15439
|
const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
|
|
15394
15440
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15395
|
-
Primitive.h3,
|
|
15441
|
+
Primitive$1.h3,
|
|
15396
15442
|
{
|
|
15397
15443
|
"data-orientation": accordionContext.orientation,
|
|
15398
15444
|
"data-state": getState(itemContext.open),
|
|
@@ -15461,18 +15507,18 @@ var Trigger2 = AccordionTrigger;
|
|
|
15461
15507
|
var Content2$2 = AccordionContent;
|
|
15462
15508
|
|
|
15463
15509
|
const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled, extraClassNames, testId, }) => {
|
|
15464
|
-
return (jsxRuntime.jsx(Root2$1, { className: `tw
|
|
15510
|
+
return (jsxRuntime.jsx(Root2$1, { className: `tw-rounded-md tw-w-full focus-visible:tw-outline-none ${extraClassNames || ''}`, type: "single", defaultValue: defaultValue, value: value, collapsible: true, "data-testid": testId, onValueChange: (_value) => onItemSelect(_value), children: accordionItems.map((item) => (jsxRuntime.jsxs(Item, { className: `tw-bg-transparent tw-p-0 tw-flex tw-flex-col tw-w-full`, disabled: disabled, value: item.value, children: [jsxRuntime.jsx(Trigger2, { disabled: disabled, className: `tw-w-full tw-cursor-default focus-visible:tw-outline-none`, children: item.trigger }), jsxRuntime.jsx(Content2$2, { className: `data-[state=open]:tw-animate-slideDown data-[state=closed]:tw-animate-slideUp tw-overflow-hidden focus-visible:tw-outline-none ${item.contentClassNames || ''}`, children: item.content })] }, item.value))) }));
|
|
15465
15511
|
};
|
|
15466
15512
|
|
|
15467
|
-
const bgStyles$2 = ['tw
|
|
15513
|
+
const bgStyles$2 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
15468
15514
|
const borderStyles$2 = [
|
|
15469
|
-
'tw
|
|
15470
|
-
'tw
|
|
15471
|
-
'tw
|
|
15472
|
-
'tw
|
|
15473
|
-
'
|
|
15515
|
+
'tw-border-solid',
|
|
15516
|
+
'tw-border',
|
|
15517
|
+
'tw-rounded-popover',
|
|
15518
|
+
'tw-border-sq-disabled-gray',
|
|
15519
|
+
'dark:tw-border-gray-500',
|
|
15474
15520
|
].join(' ');
|
|
15475
|
-
const disabledClasses$2 = ['tw
|
|
15521
|
+
const disabledClasses$2 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
15476
15522
|
const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassNames, extraPopoverClassNames, containerTestId, onInteractOutside, onPointerDownOutside, isTriggerAsChild = false, shouldTriggerFullWidth = false, disabled = false, align = 'end', alignOffset = -35, placement = 'bottom', placementOffset = 2, isHoverEnabled = false, hoverOpenDelay = 300, onOpenChange, isOpen, isCloseOnContentClick = false, isPortal = false, ...tooltipProps }) => {
|
|
15477
15523
|
const tooltipData = getQTipData(tooltipProps);
|
|
15478
15524
|
const timeout = React.useRef(null);
|
|
@@ -15503,12 +15549,12 @@ const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassN
|
|
|
15503
15549
|
};
|
|
15504
15550
|
React__namespace.useEffect(() => clearHoverTimeout, []);
|
|
15505
15551
|
const renderContent = () => {
|
|
15506
|
-
return (jsxRuntime.jsx(Content2$3, { sideOffset: placementOffset, align: align, side: placement, onInteractOutside: onInteractOutside, onPointerDownOutside: onPointerDownOutside, alignOffset: isHoverEnabled ? -10 : alignOffset, asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "
|
|
15507
|
-
|
|
15508
|
-
${extraPopoverClassNames || ''}`, children: [hasArrow && (jsxRuntime.jsx(Arrow2$2, { asChild: true, children: jsxRuntime.jsx("div", { className: "tw
|
|
15552
|
+
return (jsxRuntime.jsx(Content2$3, { sideOffset: placementOffset, align: align, side: placement, onInteractOutside: onInteractOutside, onPointerDownOutside: onPointerDownOutside, alignOffset: isHoverEnabled ? -10 : alignOffset, asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "focus-visible:tw-outline-none tw-outline-none tw-w-full tw-h-full", children: jsxRuntime.jsxs("div", { "data-testid": containerTestId, className: `${bgStyles$2} ${borderStyles$2} tw-relative tw-z-[1200] tw-min-w-6 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out
|
|
15553
|
+
data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade tw-text-sq-text-color
|
|
15554
|
+
${extraPopoverClassNames || ''}`, children: [hasArrow && (jsxRuntime.jsx(Arrow2$2, { asChild: true, children: jsxRuntime.jsx("div", { className: "tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-mt-[-7px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500" }) })), children] }) }));
|
|
15509
15555
|
};
|
|
15510
15556
|
const renderPopover = (popoverOpenState) => {
|
|
15511
|
-
return (jsxRuntime.jsxs(Root2$3, { open: popoverOpenState, defaultOpen: false, onOpenChange: onOpenChange, children: [trigger ? (jsxRuntime.jsx(Trigger$3, { id: id, asChild: isTriggerAsChild, className: `
|
|
15557
|
+
return (jsxRuntime.jsxs(Root2$3, { open: popoverOpenState, defaultOpen: false, onOpenChange: onOpenChange, children: [trigger ? (jsxRuntime.jsx(Trigger$3, { id: id, asChild: isTriggerAsChild, className: `focus-visible:tw-outline-none tw-outline-none ${shouldTriggerFullWidth ? 'tw-w-full tw-h-full' : ''}`, disabled: disabled, children: jsxRuntime.jsx("div", { ...tooltipData, onMouseOver: onHoverStart, onMouseOut: onHoverEnd, className: `tw-bg-transparent focus-visible:tw-outline-none tw-outline-none ${disabled ? disabledClasses$2 : ''} ${shouldTriggerFullWidth ? 'tw-flex tw-flex-col tw-items-center tw-justify-center' : 'tw-inline'} ${extraTriggerClassNames || ''}`, children: trigger }) })) : (jsxRuntime.jsx(Trigger$3, { asChild: true, children: jsxRuntime.jsx("div", {}) })), isPortal ? jsxRuntime.jsx(Portal$2, { children: renderContent() }) : renderContent()] }));
|
|
15512
15558
|
};
|
|
15513
15559
|
return isHoverEnabled ? renderPopover(isHoveredOpen) : renderPopover(isOpen);
|
|
15514
15560
|
};
|
|
@@ -15527,7 +15573,7 @@ var SUB_CLOSE_KEYS = {
|
|
|
15527
15573
|
};
|
|
15528
15574
|
var MENU_NAME = "Menu";
|
|
15529
15575
|
var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(MENU_NAME);
|
|
15530
|
-
var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
|
|
15576
|
+
var [createMenuContext, createMenuScope] = createContextScope$1(MENU_NAME, [
|
|
15531
15577
|
createCollectionScope$1,
|
|
15532
15578
|
createPopperScope,
|
|
15533
15579
|
createRovingFocusGroupScope
|
|
@@ -15651,6 +15697,7 @@ var MenuRootContentNonModal = React__namespace.forwardRef((props, forwardedRef)
|
|
|
15651
15697
|
}
|
|
15652
15698
|
);
|
|
15653
15699
|
});
|
|
15700
|
+
var Slot = createSlot$1("MenuContent.ScrollLock");
|
|
15654
15701
|
var MenuContentImpl = React__namespace.forwardRef(
|
|
15655
15702
|
(props, forwardedRef) => {
|
|
15656
15703
|
const {
|
|
@@ -15838,7 +15885,7 @@ var GROUP_NAME$1 = "MenuGroup";
|
|
|
15838
15885
|
var MenuGroup = React__namespace.forwardRef(
|
|
15839
15886
|
(props, forwardedRef) => {
|
|
15840
15887
|
const { __scopeMenu, ...groupProps } = props;
|
|
15841
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
15888
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
15842
15889
|
}
|
|
15843
15890
|
);
|
|
15844
15891
|
MenuGroup.displayName = GROUP_NAME$1;
|
|
@@ -15846,7 +15893,7 @@ var LABEL_NAME$1 = "MenuLabel";
|
|
|
15846
15893
|
var MenuLabel = React__namespace.forwardRef(
|
|
15847
15894
|
(props, forwardedRef) => {
|
|
15848
15895
|
const { __scopeMenu, ...labelProps } = props;
|
|
15849
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
15896
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...labelProps, ref: forwardedRef });
|
|
15850
15897
|
}
|
|
15851
15898
|
);
|
|
15852
15899
|
MenuLabel.displayName = LABEL_NAME$1;
|
|
@@ -15922,7 +15969,7 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
15922
15969
|
disabled,
|
|
15923
15970
|
textValue: textValue ?? textContent,
|
|
15924
15971
|
children: /* @__PURE__ */ jsxRuntime.jsx(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15925
|
-
Primitive.div,
|
|
15972
|
+
Primitive$1.div,
|
|
15926
15973
|
{
|
|
15927
15974
|
role: "menuitem",
|
|
15928
15975
|
"data-highlighted": isFocused ? "" : void 0,
|
|
@@ -16030,7 +16077,7 @@ var MenuItemIndicator = React__namespace.forwardRef(
|
|
|
16030
16077
|
{
|
|
16031
16078
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
16032
16079
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16033
|
-
Primitive.span,
|
|
16080
|
+
Primitive$1.span,
|
|
16034
16081
|
{
|
|
16035
16082
|
...itemIndicatorProps,
|
|
16036
16083
|
ref: forwardedRef,
|
|
@@ -16047,7 +16094,7 @@ var MenuSeparator = React__namespace.forwardRef(
|
|
|
16047
16094
|
(props, forwardedRef) => {
|
|
16048
16095
|
const { __scopeMenu, ...separatorProps } = props;
|
|
16049
16096
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16050
|
-
Primitive.div,
|
|
16097
|
+
Primitive$1.div,
|
|
16051
16098
|
{
|
|
16052
16099
|
role: "separator",
|
|
16053
16100
|
"aria-orientation": "horizontal",
|
|
@@ -16288,10 +16335,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
16288
16335
|
const { x, y } = point;
|
|
16289
16336
|
let inside = false;
|
|
16290
16337
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
16291
|
-
const
|
|
16292
|
-
const
|
|
16293
|
-
const
|
|
16294
|
-
const
|
|
16338
|
+
const ii = polygon[i];
|
|
16339
|
+
const jj = polygon[j];
|
|
16340
|
+
const xi = ii.x;
|
|
16341
|
+
const yi = ii.y;
|
|
16342
|
+
const xj = jj.x;
|
|
16343
|
+
const yj = jj.y;
|
|
16295
16344
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
16296
16345
|
if (intersect) inside = !inside;
|
|
16297
16346
|
}
|
|
@@ -16323,7 +16372,7 @@ var SubTrigger = MenuSubTrigger;
|
|
|
16323
16372
|
var SubContent = MenuSubContent;
|
|
16324
16373
|
|
|
16325
16374
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
16326
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
16375
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope$1(
|
|
16327
16376
|
DROPDOWN_MENU_NAME,
|
|
16328
16377
|
[createMenuScope]
|
|
16329
16378
|
);
|
|
@@ -16341,10 +16390,11 @@ var DropdownMenu = (props) => {
|
|
|
16341
16390
|
} = props;
|
|
16342
16391
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16343
16392
|
const triggerRef = React__namespace.useRef(null);
|
|
16344
|
-
const [open
|
|
16393
|
+
const [open, setOpen] = useControllableState({
|
|
16345
16394
|
prop: openProp,
|
|
16346
|
-
defaultProp: defaultOpen,
|
|
16347
|
-
onChange: onOpenChange
|
|
16395
|
+
defaultProp: defaultOpen ?? false,
|
|
16396
|
+
onChange: onOpenChange,
|
|
16397
|
+
caller: DROPDOWN_MENU_NAME
|
|
16348
16398
|
});
|
|
16349
16399
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16350
16400
|
DropdownMenuProvider,
|
|
@@ -16369,7 +16419,7 @@ var DropdownMenuTrigger = React__namespace.forwardRef(
|
|
|
16369
16419
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
16370
16420
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16371
16421
|
return /* @__PURE__ */ jsxRuntime.jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16372
|
-
Primitive.button,
|
|
16422
|
+
Primitive$1.button,
|
|
16373
16423
|
{
|
|
16374
16424
|
type: "button",
|
|
16375
16425
|
id: context.triggerId,
|
|
@@ -16521,10 +16571,11 @@ DropdownMenuArrow.displayName = ARROW_NAME;
|
|
|
16521
16571
|
var DropdownMenuSub = (props) => {
|
|
16522
16572
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
16523
16573
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16524
|
-
const [open
|
|
16574
|
+
const [open, setOpen] = useControllableState({
|
|
16525
16575
|
prop: openProp,
|
|
16526
|
-
defaultProp: defaultOpen,
|
|
16527
|
-
onChange: onOpenChange
|
|
16576
|
+
defaultProp: defaultOpen ?? false,
|
|
16577
|
+
onChange: onOpenChange,
|
|
16578
|
+
caller: "DropdownMenuSub"
|
|
16528
16579
|
});
|
|
16529
16580
|
return /* @__PURE__ */ jsxRuntime.jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
16530
16581
|
};
|
|
@@ -16573,65 +16624,65 @@ var SubTrigger2 = DropdownMenuSubTrigger;
|
|
|
16573
16624
|
var SubContent2 = DropdownMenuSubContent;
|
|
16574
16625
|
|
|
16575
16626
|
const borderStyles$1 = [
|
|
16576
|
-
'tw
|
|
16577
|
-
'tw
|
|
16578
|
-
'tw
|
|
16579
|
-
'tw
|
|
16580
|
-
'
|
|
16627
|
+
'tw-border-solid',
|
|
16628
|
+
'tw-border',
|
|
16629
|
+
'tw-rounded-popover',
|
|
16630
|
+
'tw-border-sq-disabled-gray',
|
|
16631
|
+
'dark:tw-border-gray-500',
|
|
16581
16632
|
].join(' ');
|
|
16582
|
-
const bgStyles$1 = ['tw
|
|
16583
|
-
const disabledClasses$1 = ['tw
|
|
16633
|
+
const bgStyles$1 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
16634
|
+
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
16584
16635
|
const ButtonWithDropdown = ({ dropdownItems, triggerIcon, id, extraClassNames = '', contentExtraClassNames = '', containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 5, alignOffset = -35, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, onContainerClick, ...tooltipProps }) => {
|
|
16585
16636
|
const tooltipData = getQTipData(tooltipProps);
|
|
16586
|
-
return (jsxRuntime.jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsxRuntime.jsx(Trigger, { id: id, className: `tw
|
|
16637
|
+
return (jsxRuntime.jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsxRuntime.jsx(Trigger, { id: id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, disabled: disabled, children: jsxRuntime.jsx("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none ${disabled ? disabledClasses$1 : ''} ${extraClassNames}`, children: triggerIcon }) }), jsxRuntime.jsx(Portal2, { children: jsxRuntime.jsx(Content2, { onClick: onContainerClick, sideOffset: placementOffset, side: placement, align: align, alignOffset: alignOffset, asChild: true, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), className: "focus-visible:tw-outline-none tw-outline-none", children: jsxRuntime.jsxs("div", { "data-testid": containerTestId, className: `${bgStyles$1} tw-relative tw-z-[1200] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ${borderStyles$1} ${contentExtraClassNames}`, children: [hasArrow && (jsxRuntime.jsx(Arrow2, { asChild: true, children: jsxRuntime.jsx("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500 tw-mt-[-7px]" }) })), dropdownItems.map((item, index) => {
|
|
16587
16638
|
const tooltipData = getQTipData(item);
|
|
16588
16639
|
if (item.isLabel) {
|
|
16589
|
-
return (jsxRuntime.jsxs(Label2, { className: item.itemExtraClassNames, ...tooltipData, children: [item.icon && (jsxRuntime.jsx(Icon, { icon: item.icon, testId: item.iconTestId, type: "text", color: item.iconColor, extraClassNames: "tw
|
|
16640
|
+
return (jsxRuntime.jsxs(Label2, { className: item.itemExtraClassNames, ...tooltipData, children: [item.icon && (jsxRuntime.jsx(Icon, { icon: item.icon, testId: item.iconTestId, type: "text", color: item.iconColor, extraClassNames: "tw-text-sq-text-color dark:tw-text-sq-white tw-w-[18px]" })), jsxRuntime.jsx("div", { "data-testid": item.labelTestId, className: `tw-text-[0.8125rem] tw-ml-1 ${item.disabled ? 'tw-text-sq-disabled-gray' : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses}`, children: item.label })] }, (item.id || '') + index));
|
|
16590
16641
|
}
|
|
16591
16642
|
if (Array.isArray(item.subMenuItems) && item.subMenuItems.length > 0) {
|
|
16592
|
-
return (jsxRuntime.jsxs(Sub2, { children: [jsxRuntime.jsxs(SubTrigger2, { id: id, className: `tw
|
|
16593
|
-
? 'tw
|
|
16594
|
-
: 'tw
|
|
16595
|
-
return (jsxRuntime.jsxs(Item2, { onSelect: subItem.onClick, "data-qtip-text": subItem.tooltip, className: "tw
|
|
16596
|
-
? 'tw
|
|
16597
|
-
: 'tw
|
|
16643
|
+
return (jsxRuntime.jsxs(Sub2, { children: [jsxRuntime.jsxs(SubTrigger2, { id: id, className: `tw-cursor-pointer tw-flex tw-justify-between dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-h-[27px] tw-pl-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-pointer-events-none ${item.itemExtraClassNames || ''}`, "data-testid": item.testId, disabled: item.disabled, ...tooltipData, children: [jsxRuntime.jsxs("div", { className: "tw-flex", children: [item.icon && (jsxRuntime.jsx(Icon, { icon: item.icon, extraClassNames: `tw-w-[18px] ${item.disabled
|
|
16644
|
+
? '!tw-text-sq-disabled-gray'
|
|
16645
|
+
: 'tw-text-sq-text-color dark:tw-text-sq-white'} ${item.iconExtraClassNames || ''}` })), jsxRuntime.jsx("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[0.8125rem] tw-ml-1 ${item.disabled && '!tw-opacity-30'} tw-not-italic tw-font-semibold ${item.labelClasses}`, children: item.label })] }), jsxRuntime.jsx(Icon, { small: true, icon: "fc-arrow-dropdown -tw-rotate-90", extraClassNames: `${item.disabled ? 'tw-text-sq-disabled-gray' : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-w-[18px] tw-ml-4 tw-text-[0.5rem] tw-justify-center tw-flex` })] }), jsxRuntime.jsx(Portal2, { children: jsxRuntime.jsx(SubContent2, { className: "focus-visible:tw-outline-none tw-outline-none", children: jsxRuntime.jsx("div", { "data-testid": containerTestId, className: `${bgStyles$1} tw-relative tw-z-[1000] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ${borderStyles$1}`, children: item.subMenuItems.map((subItem, subIndex) => {
|
|
16646
|
+
return (jsxRuntime.jsxs(Item2, { onSelect: subItem.onClick, "data-qtip-text": subItem.tooltip, className: "tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-h-[27px] tw-px-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-pointer-events-none", disabled: subItem.disabled, children: [subItem.iconClass && (jsxRuntime.jsx(Icon, { icon: subItem.iconClass, type: "text", extraClassNames: `tw-w-[18px] ${item.disabled && '!tw-opacity-30'}` })), jsxRuntime.jsx("div", { className: `tw-text-[0.8125rem] tw-ml-1 ${subItem.disabled
|
|
16647
|
+
? 'tw-text-sq-disabled-gray'
|
|
16648
|
+
: 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses}`, children: subItem.label })] }, subItem.label + subIndex));
|
|
16598
16649
|
}) }) }) })] }, (item.id || item.icon || '') + index));
|
|
16599
16650
|
}
|
|
16600
16651
|
return (jsxRuntime.jsxs("div", { ...tooltipData, children: [jsxRuntime.jsxs(Item2, { "data-customid": item.itemCustomId, onSelect: (e) => {
|
|
16601
16652
|
item.onClick(e);
|
|
16602
|
-
}, className: `tw
|
|
16653
|
+
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-leading-none tw-items-center tw-min-h-[27px] tw-px-[19px] tw-relative tw-select-none tw-outline-none data-[disabled]:tw-pointer-events-none ${item.itemExtraClassNames || ''}`, "data-testid": item.testId, disabled: item.disabled, children: [item.icon && (jsxRuntime.jsx(Icon, { icon: item.icon, testId: item.iconTestId, type: (item.iconType || 'text'), color: item.iconColor, customId: item.iconCustomId, extraClassNames: `tw-w-[18px] ${item.disabled && '!tw-opacity-30'} ${item.iconExtraClassNames || ''}` })), jsxRuntime.jsx("div", { "data-testid": item.labelTestId, "data-customid": item.labelCustomId, className: `tw-text-[0.8125rem] tw-ml-1 ${item.disabled ? 'tw-text-sq-disabled-gray' : 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses || ''}`, children: item.label })] }, (item.id || item.icon || '') + index), item.hasDivider && (jsxRuntime.jsx(Separator2, { "data-testid": `dropdown-divider-${index}`, className: "tw-h-[1px] tw-bg-sq-disabled-gray dark:tw-bg-gray-500 tw-my-[8px]" }))] }, (item.id || '') + index));
|
|
16603
16654
|
})] }) }) })] }));
|
|
16604
16655
|
};
|
|
16605
16656
|
|
|
16606
|
-
const baseClasses$2 = 'tw
|
|
16607
|
-
' tw
|
|
16608
|
-
const darkTheme$1 = '
|
|
16609
|
-
const lightTheme$1 = 'tw
|
|
16610
|
-
const errorClasses$1 = 'tw
|
|
16611
|
-
const borderColorClasses$1 = 'tw
|
|
16657
|
+
const baseClasses$2 = 'tw-mx-auto tw-p-4 tw-leading-normal tw-outline-none tw-py-2 tw-px-3 tw-rounded-[10px] tw-w-full tw-relative' +
|
|
16658
|
+
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
16659
|
+
const darkTheme$1 = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
16660
|
+
const lightTheme$1 = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
16661
|
+
const errorClasses$1 = 'tw-border-sq-danger-color';
|
|
16662
|
+
const borderColorClasses$1 = 'tw-border-sq-color-dark';
|
|
16612
16663
|
/**
|
|
16613
16664
|
* Alert.
|
|
16614
16665
|
*/
|
|
16615
16666
|
const Alert = ({ children, dismissible = true, onClose, show = true, variant, testId = 'alert-id', id, extraClassNames, ...tooltipProps }) => {
|
|
16616
16667
|
const appliedTheme = {
|
|
16617
16668
|
theme: `${lightTheme$1} ${darkTheme$1}`,
|
|
16618
|
-
formulaError: 'tw
|
|
16619
|
-
danger: 'tw
|
|
16620
|
-
warning: 'tw
|
|
16621
|
-
gray: 'tw
|
|
16669
|
+
formulaError: 'tw-text-red-800 tw-bg-red-200 !tw-rounded-[4px]',
|
|
16670
|
+
danger: 'tw-text-sq-text-color tw-bg-sq-danger-color',
|
|
16671
|
+
warning: 'tw-bg-sq-bg-warning-color tw-text-sq-text-color',
|
|
16672
|
+
gray: 'tw-bg-sq-light-gray tw-text-sq-text-color dark:tw-bg-sq-worksheetspanel-gray-dark dark:tw-text-sq-dark-text',
|
|
16622
16673
|
};
|
|
16623
16674
|
const appliedBorderTheme = {
|
|
16624
16675
|
theme: borderColorClasses$1,
|
|
16625
16676
|
danger: errorClasses$1,
|
|
16626
|
-
warning: 'tw
|
|
16627
|
-
gray: 'tw
|
|
16628
|
-
formulaError: 'tw
|
|
16677
|
+
warning: 'tw-border-none',
|
|
16678
|
+
gray: 'tw-border-sq-darkish-gray',
|
|
16679
|
+
formulaError: 'tw-border-red-100',
|
|
16629
16680
|
};
|
|
16630
16681
|
const appliedClasses = `${baseClasses$2} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
16631
16682
|
if (!show) {
|
|
16632
16683
|
return jsxRuntime.jsx("div", {});
|
|
16633
16684
|
}
|
|
16634
|
-
return (jsxRuntime.jsxs("div", { "data-testid": testId, id: id, className: appliedClasses, children: [children, dismissible && (jsxRuntime.jsx(Icon, { icon: "fc-delete", type: variant.match(/danger|warning|formulaError/) ? 'color' : 'theme', color: variant.match(/danger|warning|formulaError/) ? 'inherit' : undefined, extraClassNames: `tw
|
|
16685
|
+
return (jsxRuntime.jsxs("div", { "data-testid": testId, id: id, className: appliedClasses, children: [children, dismissible && (jsxRuntime.jsx(Icon, { icon: "fc-delete", type: variant.match(/danger|warning|formulaError/) ? 'color' : 'theme', color: variant.match(/danger|warning|formulaError/) ? 'inherit' : undefined, extraClassNames: `tw-self-end tw-text-[0.6875rem] tw-cursor-pointer tw-absolute tw-right-[10px] tw-top-[10px] ${variant.match(/danger|warning|gray|formulaError/) ? 'tw-text-sq-text-color dark:tw-text-sq-dark-text' : ''}`, testId: `${testId}-close-btn`, onClick: onClose, ...tooltipProps }))] }));
|
|
16635
16686
|
};
|
|
16636
16687
|
|
|
16637
16688
|
/**
|
|
@@ -16650,40 +16701,47 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
|
|
|
16650
16701
|
* @param tooltipProps - props to pass to the tooltip
|
|
16651
16702
|
*/
|
|
16652
16703
|
const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, viewBox = '0 0 19 19', id, testId, customId, ...tooltipProps }) => {
|
|
16653
|
-
const appliedClassNames = `${onClick ? 'tw
|
|
16654
|
-
tw
|
|
16704
|
+
const appliedClassNames = `${onClick ? 'tw-cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none
|
|
16705
|
+
tw-outline-none`;
|
|
16655
16706
|
const tooltipData = getQTipData(tooltipProps);
|
|
16656
16707
|
const appliedType = type === 'default' ? 'currentColor' : 'rgb(var(--sq-icon))';
|
|
16657
|
-
return (jsxRuntime.jsx("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw
|
|
16708
|
+
return (jsxRuntime.jsx("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw-sq-icon dark:tw-text-white`, viewBox: viewBox, fill: color ? color : appliedType, "data-testid": testId, children: jsxRuntime.jsx("path", { d: getSvgIconPath(icon) }) }) }));
|
|
16658
16709
|
};
|
|
16659
16710
|
|
|
16660
16711
|
const SeeqActionDropdownItem = (item) => {
|
|
16661
16712
|
let renderIcon = jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
16662
16713
|
if (item.icon) {
|
|
16663
|
-
renderIcon = isSvgIcon(item.icon) ? (jsxRuntime.jsx(SvgIcon, { icon: item.icon, extraClassNames:
|
|
16714
|
+
renderIcon = isSvgIcon(item.icon) ? (jsxRuntime.jsx(SvgIcon, { icon: item.icon, extraClassNames: 'tw-rounded-[3px] tw-h-8 tw-w-8 tw-p-1 tw-flex tw-justify-center tw-items-center tw-bg-sq-color-dark' +
|
|
16715
|
+
' dark:tw-text-sq-white tw-text-[22px] tw-text-sq-white ' +
|
|
16716
|
+
item.iconExtraClassNames, ...item })) : (jsxRuntime.jsx(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-rounded-[3px] tw-h-8 tw-w-8 tw-flex tw-justify-center tw-items-center tw-bg-sq-color-dark dark:tw-text-sq-white tw-text-[1.375rem] tw-text-sq-white ' +
|
|
16717
|
+
item.iconExtraClassNames }));
|
|
16664
16718
|
}
|
|
16665
|
-
return (jsxRuntime.jsxs("div", { className: "tw
|
|
16719
|
+
return (jsxRuntime.jsxs("div", { className: "tw-flex-col tw-flex tw-p-[10px] tw-pl-5 tw-w-[600px]", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end", children: [renderIcon, jsxRuntime.jsx("h4", { className: "tw-text-base tw-font-[600] tw-leading-[20px] mb-0", children: item.display })] }), jsxRuntime.jsx("div", { className: "tw-text-[0.8125rem] tw-font-normal", children: item.text })] }));
|
|
16666
16720
|
};
|
|
16667
16721
|
const ViewWorkbench = (item) => {
|
|
16668
16722
|
let renderIcon = jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
16669
16723
|
if (item.icon) {
|
|
16670
|
-
renderIcon = isSvgIcon(item.icon) ? (jsxRuntime.jsx(SvgIcon, { icon: item.icon, extraClassNames: 'tw
|
|
16724
|
+
renderIcon = isSvgIcon(item.icon) ? (jsxRuntime.jsx(SvgIcon, { icon: item.icon, extraClassNames: 'tw-flex tw-w-5 tw-justify-center tw-items-center tw-text-[1.25rem] dark:tw-text-sq-white' +
|
|
16725
|
+
' tw-text-sq-text-color ' +
|
|
16726
|
+
item.iconExtraClassNames, type: "default", ...item })) : (jsxRuntime.jsx(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-flex tw-justify-center tw-items-center tw-text-[1.25rem] dark:tw-text-sq-white' +
|
|
16727
|
+
' tw-text-sq-text-color ' +
|
|
16728
|
+
item.iconExtraClassNames }));
|
|
16671
16729
|
}
|
|
16672
|
-
return (jsxRuntime.jsx("div", { className: "tw
|
|
16730
|
+
return (jsxRuntime.jsx("div", { className: "tw-flex-col tw-flex tw-p-[10px]", children: jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end", children: [renderIcon, jsxRuntime.jsx("div", { className: "tw-text-[0.8125rem]", children: item.display })] }) }));
|
|
16673
16731
|
};
|
|
16674
16732
|
const InsertSeeqContent = (item) => {
|
|
16675
|
-
return (jsxRuntime.jsxs("div", { className: "tw
|
|
16733
|
+
return (jsxRuntime.jsxs("div", { className: "tw-flex-col tw-flex tw-justify-start tw-p-[10px] tw-font-normal tw-text-left tw-text-sq-text-color dark:tw-text-sq-dark-text", children: [jsxRuntime.jsx("h5", { className: "tw-text-[1rem] tw-font-medium tw-text-sq-color-dark tw-leading-[18px]", children: item.display }), jsxRuntime.jsx("div", { className: "tw-text-[0.8125rem] tw-text-sq-text-color dark:tw-text-sq-dark-text !tw-mt-1", children: item.text })] }));
|
|
16676
16734
|
};
|
|
16677
16735
|
|
|
16678
16736
|
const borderStyles = [
|
|
16679
|
-
'tw
|
|
16680
|
-
'tw
|
|
16681
|
-
'tw
|
|
16682
|
-
'tw
|
|
16683
|
-
'
|
|
16737
|
+
'tw-border-solid',
|
|
16738
|
+
'tw-border',
|
|
16739
|
+
'tw-rounded-md',
|
|
16740
|
+
'tw-border-sq-disabled-gray',
|
|
16741
|
+
'dark:tw-border-gray-500',
|
|
16684
16742
|
].join(' ');
|
|
16685
|
-
const bgStyles = ['tw
|
|
16686
|
-
const disabledClasses = ['tw
|
|
16743
|
+
const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
16744
|
+
const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
16687
16745
|
const renderItem = (variant, item) => {
|
|
16688
16746
|
switch (variant) {
|
|
16689
16747
|
case 'create-workbench':
|
|
@@ -16698,31 +16756,31 @@ const renderItem = (variant, item) => {
|
|
|
16698
16756
|
};
|
|
16699
16757
|
const SeeqActionDropdown = ({ seeqActionDropdownItems, trigger, id, extraClassNames, containerTestId, disabled = false, align = 'end', placement = 'bottom', placementOffset = 5, alignOffset = -35, hasArrow = false, onOpenChange, isOpen, setFocusOnTriggerOnClose = true, keepFocusInsideDropdown = true, variant, ...tooltipProps }) => {
|
|
16700
16758
|
const tooltipData = getQTipData(tooltipProps);
|
|
16701
|
-
return (jsxRuntime.jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsxRuntime.jsx(Trigger, { id: id, "data-testid": id, className: `tw
|
|
16702
|
-
' tw
|
|
16703
|
-
'
|
|
16704
|
-
' forceFont
|
|
16705
|
-
borderStyles, children: [hasArrow && (jsxRuntime.jsx(Arrow2, { asChild: true, children: jsxRuntime.jsx("div", { className: " tw
|
|
16759
|
+
return (jsxRuntime.jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsxRuntime.jsx(Trigger, { id: id, "data-testid": id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, asChild: true, disabled: disabled, children: jsxRuntime.jsx("div", { ...tooltipData, className: `tw-bg-transparent tw-flex tw-flex-col tw-items-center focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none ${disabled ? disabledClasses : ''} ${extraClassNames || ''}`, children: trigger }) }), jsxRuntime.jsx(Content2, { sideOffset: placementOffset, side: placement, align: align, alignOffset: alignOffset, asChild: true, onCloseAutoFocus: (e) => !setFocusOnTriggerOnClose && e.preventDefault(), className: "focus-visible:tw-outline-none tw-outline-none", children: jsxRuntime.jsxs("div", { "data-testid": containerTestId, className: bgStyles +
|
|
16760
|
+
' tw-relative tw-z-[1200] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none' +
|
|
16761
|
+
' data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
16762
|
+
' forceFont data-[side=top]:tw-animate-slideDownAndFade data-[side=right]:tw-animate-slideLeftAndFade data-[side=bottom]:tw-animate-slideUpAndFade data-[side=left]:tw-animate-slideRightAndFade ' +
|
|
16763
|
+
borderStyles, children: [hasArrow && (jsxRuntime.jsx(Arrow2, { asChild: true, children: jsxRuntime.jsx("div", { className: " tw-fill-transparent tw-bg-white tw-w-[15px] tw-h-[15px] tw-rotate-45 dark:tw-bg-sq-dark-background tw-border-b tw-border-r tw-border-sq-disabled-gray dark:tw-border-gray-500 tw-mt-[-7px]" }) })), seeqActionDropdownItems.map((item, index) => {
|
|
16706
16764
|
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Item2, { onSelect: (e) => {
|
|
16707
16765
|
item.action(e);
|
|
16708
|
-
}, className: `tw
|
|
16766
|
+
}, className: `tw-cursor-pointer tw-flex dark:tw-text-sq-white hover:tw-bg-sq-gray-highlight dark:hover:tw-bg-sq-gray-highlight-dark tw-relative tw-select-none tw-outline-none data-[disabled]:tw-text-sq-disabled-gray data-[disabled]:tw-pointer-events-none`, "data-testid": item.testId, disabled: !item.enabled, children: renderItem(variant, item) }), item.divider && (jsxRuntime.jsx(Separator2, { "data-testid": `dropdown-divider-${index}`, className: "tw-h-[1px] tw-bg-sq-disabled-gray dark:tw-bg-gray-500 tw-my-[8px]" }))] }, item.display + index));
|
|
16709
16767
|
})] }) })] }));
|
|
16710
16768
|
};
|
|
16711
16769
|
|
|
16712
|
-
const baseClasses$1 = 'tw
|
|
16713
|
-
const errorClasses = 'tw
|
|
16770
|
+
const baseClasses$1 = 'tw-flex tw-outline-none tw-rounded-md tw-w-full tw-relative tw-flex-wrap';
|
|
16771
|
+
const errorClasses = 'tw-border-sq-danger-color';
|
|
16714
16772
|
const borderColorClasses = [
|
|
16715
|
-
'tw
|
|
16716
|
-
'
|
|
16717
|
-
'
|
|
16718
|
-
'
|
|
16719
|
-
'
|
|
16720
|
-
'
|
|
16773
|
+
'tw-border-sq-disabled-gray',
|
|
16774
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
16775
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
16776
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
16777
|
+
'focus:tw-border-sq-color-dark',
|
|
16778
|
+
'active:tw-border-sq-color-dark',
|
|
16721
16779
|
].join(' ');
|
|
16722
|
-
const fieldBorderRadius = 'tw
|
|
16723
|
-
const fieldClasses = 'tw
|
|
16724
|
-
const darkTheme = '
|
|
16725
|
-
const lightTheme = 'tw
|
|
16780
|
+
const fieldBorderRadius = 'tw-rounded-l-md tw-rounded-r-none';
|
|
16781
|
+
const fieldClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3' + 'tw-p-1 tw-border-solid tw-border';
|
|
16782
|
+
const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
16783
|
+
const lightTheme = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
16726
16784
|
/**
|
|
16727
16785
|
* InputGroup.
|
|
16728
16786
|
*/
|
|
@@ -16732,10 +16790,8 @@ const InputGroup = React.forwardRef((props, ref) => {
|
|
|
16732
16790
|
const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
|
|
16733
16791
|
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
16734
16792
|
const elementsToAppend = append.filter(Boolean);
|
|
16735
|
-
return (jsxRuntime.jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsxRuntime.jsx("div", { "data-testid": testId, className: `tw
|
|
16736
|
-
return item?.variant === 'button' ? (jsxRuntime.jsx(Button, { extraClassNames: `$
|
|
16737
|
-
index ? 'tw:-ml-px' : 'tw:ml-0'
|
|
16738
|
-
} tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`, ...item.buttonProps }, index)) : (jsxRuntime.jsx("div", { className: `${borderColorClasses} ${index ? 'tw:-ml-px' : 'tw:ml-0'} tw:flex tw:items-center tw:justify-center tw:rounded-none tw:last:rounded-r-md tw:active:z-30 tw:active:border tw:border`, children: item?.element }, index));
|
|
16793
|
+
return (jsxRuntime.jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsxRuntime.jsx("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}`, children: field })) : (jsxRuntime.jsx(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, extraClassNames: `tw-flex tw-flex-1 tw-w-full focus:tw-z-30 tw-rounded-r-none last:tw-rounded-r-md ${extraClassNames}`, ...tooltipData })), elementsToAppend.map((item, index) => {
|
|
16794
|
+
return item?.variant === 'button' ? (jsxRuntime.jsx(Button, { extraClassNames: `${index ? 'tw-ml-[-1px]' : 'tw-ml-0'} focus:tw-z-40 focus:tw-border tw-rounded-none last:tw-rounded-r-md`, ...item.buttonProps }, index)) : (jsxRuntime.jsx("div", { className: `${borderColorClasses} ${index ? 'tw-ml-[-1px]' : 'tw-ml-0'} tw-flex tw-items-center tw-justify-center tw-rounded-none last:tw-rounded-r-md active:tw-z-30 active:tw-border tw-border`, children: item?.element }, index));
|
|
16739
16795
|
})] }));
|
|
16740
16796
|
});
|
|
16741
16797
|
|
|
@@ -27065,7 +27121,7 @@ function clamp(value, [min, max]) {
|
|
|
27065
27121
|
return Math.min(max, Math.max(min, value));
|
|
27066
27122
|
}
|
|
27067
27123
|
|
|
27068
|
-
// packages/react/use-previous/src/
|
|
27124
|
+
// packages/react/use-previous/src/use-previous.tsx
|
|
27069
27125
|
function usePrevious(value) {
|
|
27070
27126
|
const ref = React__namespace.useRef({ value, previous: value });
|
|
27071
27127
|
return React__namespace.useMemo(() => {
|
|
@@ -27087,7 +27143,7 @@ var BACK_KEYS = {
|
|
|
27087
27143
|
};
|
|
27088
27144
|
var SLIDER_NAME = "Slider";
|
|
27089
27145
|
var [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);
|
|
27090
|
-
var [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [
|
|
27146
|
+
var [createSliderContext, createSliderScope] = createContextScope$1(SLIDER_NAME, [
|
|
27091
27147
|
createCollectionScope
|
|
27092
27148
|
]);
|
|
27093
27149
|
var [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);
|
|
@@ -27357,7 +27413,7 @@ var SliderImpl = React__namespace.forwardRef(
|
|
|
27357
27413
|
} = props;
|
|
27358
27414
|
const context = useSliderContext(SLIDER_NAME, __scopeSlider);
|
|
27359
27415
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27360
|
-
Primitive.span,
|
|
27416
|
+
Primitive$1.span,
|
|
27361
27417
|
{
|
|
27362
27418
|
...sliderProps,
|
|
27363
27419
|
ref: forwardedRef,
|
|
@@ -27404,7 +27460,7 @@ var SliderTrack = React__namespace.forwardRef(
|
|
|
27404
27460
|
const { __scopeSlider, ...trackProps } = props;
|
|
27405
27461
|
const context = useSliderContext(TRACK_NAME, __scopeSlider);
|
|
27406
27462
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27407
|
-
Primitive.span,
|
|
27463
|
+
Primitive$1.span,
|
|
27408
27464
|
{
|
|
27409
27465
|
"data-disabled": context.disabled ? "" : void 0,
|
|
27410
27466
|
"data-orientation": context.orientation,
|
|
@@ -27430,7 +27486,7 @@ var SliderRange = React__namespace.forwardRef(
|
|
|
27430
27486
|
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
|
27431
27487
|
const offsetEnd = 100 - Math.max(...percentages);
|
|
27432
27488
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27433
|
-
Primitive.span,
|
|
27489
|
+
Primitive$1.span,
|
|
27434
27490
|
{
|
|
27435
27491
|
"data-orientation": context.orientation,
|
|
27436
27492
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -27491,7 +27547,7 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27491
27547
|
},
|
|
27492
27548
|
children: [
|
|
27493
27549
|
/* @__PURE__ */ jsxRuntime.jsx(Collection.ItemSlot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27494
|
-
Primitive.span,
|
|
27550
|
+
Primitive$1.span,
|
|
27495
27551
|
{
|
|
27496
27552
|
role: "slider",
|
|
27497
27553
|
"aria-label": props["aria-label"] || label,
|
|
@@ -27511,7 +27567,7 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27511
27567
|
}
|
|
27512
27568
|
) }),
|
|
27513
27569
|
isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27514
|
-
|
|
27570
|
+
SliderBubbleInput,
|
|
27515
27571
|
{
|
|
27516
27572
|
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
27517
27573
|
form: context.form,
|
|
@@ -27525,23 +27581,36 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27525
27581
|
}
|
|
27526
27582
|
);
|
|
27527
27583
|
SliderThumb.displayName = THUMB_NAME;
|
|
27528
|
-
var
|
|
27529
|
-
|
|
27530
|
-
|
|
27531
|
-
|
|
27532
|
-
|
|
27533
|
-
const
|
|
27534
|
-
|
|
27535
|
-
|
|
27536
|
-
|
|
27537
|
-
|
|
27538
|
-
const
|
|
27539
|
-
setValue.
|
|
27540
|
-
|
|
27541
|
-
|
|
27542
|
-
|
|
27543
|
-
|
|
27544
|
-
}
|
|
27584
|
+
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
|
27585
|
+
var SliderBubbleInput = React__namespace.forwardRef(
|
|
27586
|
+
({ __scopeSlider, value, ...props }, forwardedRef) => {
|
|
27587
|
+
const ref = React__namespace.useRef(null);
|
|
27588
|
+
const composedRefs = useComposedRefs$1(ref, forwardedRef);
|
|
27589
|
+
const prevValue = usePrevious(value);
|
|
27590
|
+
React__namespace.useEffect(() => {
|
|
27591
|
+
const input = ref.current;
|
|
27592
|
+
if (!input) return;
|
|
27593
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
27594
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
|
|
27595
|
+
const setValue = descriptor.set;
|
|
27596
|
+
if (prevValue !== value && setValue) {
|
|
27597
|
+
const event = new Event("input", { bubbles: true });
|
|
27598
|
+
setValue.call(input, value);
|
|
27599
|
+
input.dispatchEvent(event);
|
|
27600
|
+
}
|
|
27601
|
+
}, [prevValue, value]);
|
|
27602
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27603
|
+
Primitive$1.input,
|
|
27604
|
+
{
|
|
27605
|
+
style: { display: "none" },
|
|
27606
|
+
...props,
|
|
27607
|
+
ref: composedRefs,
|
|
27608
|
+
defaultValue: value
|
|
27609
|
+
}
|
|
27610
|
+
);
|
|
27611
|
+
}
|
|
27612
|
+
);
|
|
27613
|
+
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
27545
27614
|
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
27546
27615
|
const nextValues = [...prevValues];
|
|
27547
27616
|
nextValues[atIndex] = nextValue;
|
|
@@ -27609,9 +27678,201 @@ var Thumb = SliderThumb;
|
|
|
27609
27678
|
*/
|
|
27610
27679
|
const Slider = (props) => {
|
|
27611
27680
|
const { onValueChange, onPointerUp, id, value, name, disabled = false, rootExtraClassNames = '', trackExtraClassNames = '', rangeExtraClassNames = '', thumbExtraClassNames = '', step, min, max, } = props;
|
|
27612
|
-
return (jsxRuntime.jsxs(Root$1, { className: `tw
|
|
27681
|
+
return (jsxRuntime.jsxs(Root$1, { className: `tw-relative tw-flex tw-h-5 tw-w-full tw-touch-none tw-select-none tw-items-center ${rootExtraClassNames}`, defaultValue: [value], value: [value], onValueChange: (value) => onValueChange && onValueChange(value), onPointerUp: (e) => onPointerUp && onPointerUp(e), name: name, id: id, max: max, min: min, disabled: disabled, step: step, children: [jsxRuntime.jsx(Track, { className: `tw-relative tw-h-[5px] tw-grow tw-rounded-[4px] tw-bg-sq-dark-gray dark:tw-bg-sq-dark-disabled-gray ${trackExtraClassNames}`, children: jsxRuntime.jsx(Range, { className: `tw-absolute tw-h-full tw-rounded-full ${rangeExtraClassNames}` }) }), jsxRuntime.jsx(Thumb, { className: `tw-block tw-h-[15px] tw-w-[15px] tw-rounded-full tw-bg-sq-color-dark active:tw-bg-sq-color-dark-dark focus:outline-none focus-visible:tw-outline-none aria-disabled:tw-bg-sq-dark-gray dark:aria-disabled:tw-bg-sq-dark-disabled-gray tw-transition tw-ease-in-out ${thumbExtraClassNames}`, "aria-disabled": disabled })] }));
|
|
27613
27682
|
};
|
|
27614
27683
|
|
|
27684
|
+
// src/create-context.tsx
|
|
27685
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
27686
|
+
let defaultContexts = [];
|
|
27687
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
27688
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
|
27689
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
27690
|
+
const index = defaultContexts.length;
|
|
27691
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
27692
|
+
const Provider = (props) => {
|
|
27693
|
+
const { scope, children, ...context } = props;
|
|
27694
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
27695
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
|
27696
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
27697
|
+
};
|
|
27698
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
27699
|
+
function useContext2(consumerName, scope) {
|
|
27700
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
27701
|
+
const context = React__namespace.useContext(Context);
|
|
27702
|
+
if (context) return context;
|
|
27703
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
27704
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
27705
|
+
}
|
|
27706
|
+
return [Provider, useContext2];
|
|
27707
|
+
}
|
|
27708
|
+
const createScope = () => {
|
|
27709
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
27710
|
+
return React__namespace.createContext(defaultContext);
|
|
27711
|
+
});
|
|
27712
|
+
return function useScope(scope) {
|
|
27713
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
27714
|
+
return React__namespace.useMemo(
|
|
27715
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
27716
|
+
[scope, contexts]
|
|
27717
|
+
);
|
|
27718
|
+
};
|
|
27719
|
+
};
|
|
27720
|
+
createScope.scopeName = scopeName;
|
|
27721
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
27722
|
+
}
|
|
27723
|
+
function composeContextScopes(...scopes) {
|
|
27724
|
+
const baseScope = scopes[0];
|
|
27725
|
+
if (scopes.length === 1) return baseScope;
|
|
27726
|
+
const createScope = () => {
|
|
27727
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
27728
|
+
useScope: createScope2(),
|
|
27729
|
+
scopeName: createScope2.scopeName
|
|
27730
|
+
}));
|
|
27731
|
+
return function useComposedScopes(overrideScopes) {
|
|
27732
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
27733
|
+
const scopeProps = useScope(overrideScopes);
|
|
27734
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
27735
|
+
return { ...nextScopes2, ...currentScope };
|
|
27736
|
+
}, {});
|
|
27737
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
27738
|
+
};
|
|
27739
|
+
};
|
|
27740
|
+
createScope.scopeName = baseScope.scopeName;
|
|
27741
|
+
return createScope;
|
|
27742
|
+
}
|
|
27743
|
+
|
|
27744
|
+
// src/slot.tsx
|
|
27745
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
27746
|
+
var use = React__namespace[" use ".trim().toString()];
|
|
27747
|
+
function isPromiseLike(value) {
|
|
27748
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
27749
|
+
}
|
|
27750
|
+
function isLazyComponent(element) {
|
|
27751
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
27752
|
+
}
|
|
27753
|
+
// @__NO_SIDE_EFFECTS__
|
|
27754
|
+
function createSlot(ownerName) {
|
|
27755
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
27756
|
+
const Slot2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
27757
|
+
let { children, ...slotProps } = props;
|
|
27758
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
27759
|
+
children = use(children._payload);
|
|
27760
|
+
}
|
|
27761
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
27762
|
+
const slottable = childrenArray.find(isSlottable);
|
|
27763
|
+
if (slottable) {
|
|
27764
|
+
const newElement = slottable.props.children;
|
|
27765
|
+
const newChildren = childrenArray.map((child) => {
|
|
27766
|
+
if (child === slottable) {
|
|
27767
|
+
if (React__namespace.Children.count(newElement) > 1) return React__namespace.Children.only(null);
|
|
27768
|
+
return React__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
27769
|
+
} else {
|
|
27770
|
+
return child;
|
|
27771
|
+
}
|
|
27772
|
+
});
|
|
27773
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
27774
|
+
}
|
|
27775
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
27776
|
+
});
|
|
27777
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
27778
|
+
return Slot2;
|
|
27779
|
+
}
|
|
27780
|
+
// @__NO_SIDE_EFFECTS__
|
|
27781
|
+
function createSlotClone(ownerName) {
|
|
27782
|
+
const SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
|
27783
|
+
let { children, ...slotProps } = props;
|
|
27784
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
27785
|
+
children = use(children._payload);
|
|
27786
|
+
}
|
|
27787
|
+
if (React__namespace.isValidElement(children)) {
|
|
27788
|
+
const childrenRef = getElementRef(children);
|
|
27789
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
27790
|
+
if (children.type !== React__namespace.Fragment) {
|
|
27791
|
+
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
27792
|
+
}
|
|
27793
|
+
return React__namespace.cloneElement(children, props2);
|
|
27794
|
+
}
|
|
27795
|
+
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
|
27796
|
+
});
|
|
27797
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
27798
|
+
return SlotClone;
|
|
27799
|
+
}
|
|
27800
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
27801
|
+
function isSlottable(child) {
|
|
27802
|
+
return React__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
27803
|
+
}
|
|
27804
|
+
function mergeProps(slotProps, childProps) {
|
|
27805
|
+
const overrideProps = { ...childProps };
|
|
27806
|
+
for (const propName in childProps) {
|
|
27807
|
+
const slotPropValue = slotProps[propName];
|
|
27808
|
+
const childPropValue = childProps[propName];
|
|
27809
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
27810
|
+
if (isHandler) {
|
|
27811
|
+
if (slotPropValue && childPropValue) {
|
|
27812
|
+
overrideProps[propName] = (...args) => {
|
|
27813
|
+
const result = childPropValue(...args);
|
|
27814
|
+
slotPropValue(...args);
|
|
27815
|
+
return result;
|
|
27816
|
+
};
|
|
27817
|
+
} else if (slotPropValue) {
|
|
27818
|
+
overrideProps[propName] = slotPropValue;
|
|
27819
|
+
}
|
|
27820
|
+
} else if (propName === "style") {
|
|
27821
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
27822
|
+
} else if (propName === "className") {
|
|
27823
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
27824
|
+
}
|
|
27825
|
+
}
|
|
27826
|
+
return { ...slotProps, ...overrideProps };
|
|
27827
|
+
}
|
|
27828
|
+
function getElementRef(element) {
|
|
27829
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
27830
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
27831
|
+
if (mayWarn) {
|
|
27832
|
+
return element.ref;
|
|
27833
|
+
}
|
|
27834
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
27835
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
27836
|
+
if (mayWarn) {
|
|
27837
|
+
return element.props.ref;
|
|
27838
|
+
}
|
|
27839
|
+
return element.props.ref || element.ref;
|
|
27840
|
+
}
|
|
27841
|
+
|
|
27842
|
+
// src/primitive.tsx
|
|
27843
|
+
var NODES = [
|
|
27844
|
+
"a",
|
|
27845
|
+
"button",
|
|
27846
|
+
"div",
|
|
27847
|
+
"form",
|
|
27848
|
+
"h2",
|
|
27849
|
+
"h3",
|
|
27850
|
+
"img",
|
|
27851
|
+
"input",
|
|
27852
|
+
"label",
|
|
27853
|
+
"li",
|
|
27854
|
+
"nav",
|
|
27855
|
+
"ol",
|
|
27856
|
+
"p",
|
|
27857
|
+
"select",
|
|
27858
|
+
"span",
|
|
27859
|
+
"svg",
|
|
27860
|
+
"ul"
|
|
27861
|
+
];
|
|
27862
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
27863
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
27864
|
+
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
27865
|
+
const { asChild, ...primitiveProps } = props;
|
|
27866
|
+
const Comp = asChild ? Slot : node;
|
|
27867
|
+
if (typeof window !== "undefined") {
|
|
27868
|
+
window[Symbol.for("radix-ui")] = true;
|
|
27869
|
+
}
|
|
27870
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
27871
|
+
});
|
|
27872
|
+
Node.displayName = `Primitive.${node}`;
|
|
27873
|
+
return { ...primitive, [node]: Node };
|
|
27874
|
+
}, {});
|
|
27875
|
+
|
|
27615
27876
|
var PROGRESS_NAME = "Progress";
|
|
27616
27877
|
var DEFAULT_MAX = 100;
|
|
27617
27878
|
var [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);
|
|
@@ -28898,7 +29159,7 @@ var tinycolor$1 = {exports: {}};
|
|
|
28898
29159
|
var tinycolorExports = tinycolor$1.exports;
|
|
28899
29160
|
var tinycolor = /*@__PURE__*/getDefaultExportFromCjs(tinycolorExports);
|
|
28900
29161
|
|
|
28901
|
-
const baseLabelClasses = 'tw
|
|
29162
|
+
const baseLabelClasses = 'tw-left-1 tw-text-xs tw-text-sq-text-color dark:tw-text-sq-dark-text tw-items-center tw-h-[18px]';
|
|
28902
29163
|
const ProgressIndicator = (props) => {
|
|
28903
29164
|
const { value, color = undefined, testId, label, extraClasses = '', labelClasses = '', valuesLength, max, index, totalValue, ...tooltipProps } = props;
|
|
28904
29165
|
const tooltipData = getQTipData(tooltipProps);
|
|
@@ -28911,19 +29172,19 @@ const ProgressIndicator = (props) => {
|
|
|
28911
29172
|
if (totalValue >= max) {
|
|
28912
29173
|
// If progress is 100%, round both ends
|
|
28913
29174
|
if (index === 0 && valuesLength === 1) {
|
|
28914
|
-
roundedCorners = 'tw
|
|
29175
|
+
roundedCorners = 'tw-rounded-[15px]';
|
|
28915
29176
|
}
|
|
28916
29177
|
else if (index === 0) {
|
|
28917
|
-
roundedCorners = 'tw
|
|
29178
|
+
roundedCorners = 'tw-rounded-l-[15px]';
|
|
28918
29179
|
}
|
|
28919
29180
|
else if (index === valuesLength - 1) {
|
|
28920
|
-
roundedCorners = 'tw
|
|
29181
|
+
roundedCorners = 'tw-rounded-r-[15px]';
|
|
28921
29182
|
}
|
|
28922
29183
|
}
|
|
28923
29184
|
else {
|
|
28924
29185
|
// Otherwise, only round the leftmost indicator
|
|
28925
29186
|
if (index === 0) {
|
|
28926
|
-
roundedCorners = 'tw
|
|
29187
|
+
roundedCorners = 'tw-rounded-l-[15px]';
|
|
28927
29188
|
}
|
|
28928
29189
|
}
|
|
28929
29190
|
React.useEffect(() => {
|
|
@@ -28935,13 +29196,13 @@ const ProgressIndicator = (props) => {
|
|
|
28935
29196
|
return () => clearTimeout(timeout);
|
|
28936
29197
|
}, [value]);
|
|
28937
29198
|
const bgColor = color || undefined;
|
|
28938
|
-
const bgClass = color ? '' : 'tw
|
|
29199
|
+
const bgClass = color ? '' : 'tw-bg-sq-color-dark';
|
|
28939
29200
|
const computeTextClass = (elem) => {
|
|
28940
29201
|
const computedStyle = getComputedStyle(elem);
|
|
28941
29202
|
const backgroundColor = computedStyle.backgroundColor;
|
|
28942
29203
|
const textColorClass = tinycolor(backgroundColor).isDark()
|
|
28943
|
-
? 'tw
|
|
28944
|
-
: 'tw
|
|
29204
|
+
? 'tw-text-sq-white dark:tw-text-sq-white'
|
|
29205
|
+
: 'tw-text-sq-text-color dark:tw-text-sq-text-color';
|
|
28945
29206
|
setTextColorClass(textColorClass);
|
|
28946
29207
|
};
|
|
28947
29208
|
React.useEffect(() => {
|
|
@@ -28949,35 +29210,35 @@ const ProgressIndicator = (props) => {
|
|
|
28949
29210
|
computeTextClass(indicatorElementRef.current);
|
|
28950
29211
|
}
|
|
28951
29212
|
}, [!!indicatorElementRef.current]);
|
|
28952
|
-
return (React.createElement(Indicator, { className: `tw
|
|
29213
|
+
return (React.createElement(Indicator, { className: `tw-ease-[cubic-bezier(0.65, 0, 0.35, 1)] tw-w-full tw-h-[18px] tw-duration-[660ms] tw-flex tw-justify-center tw-items-center ${valuesLength === 1 ? '' : 'tw-overflow-hidden'} ${roundedCorners} ${bgClass} ${extraClasses}`, ...tooltipData, "data-qtip-text": tooltipProps.tooltip ? tooltipProps.tooltip : `${value}%`, "data-testid": `progress-bar-indicator-${testId ? testId : value}`, key: `${index}-${value}`, ref: indicatorElementRef, style: {
|
|
28953
29214
|
// Background color will default to the theme color if undefined
|
|
28954
29215
|
backgroundColor: bgColor,
|
|
28955
29216
|
animation: 'width 660ms forwards',
|
|
28956
29217
|
width: `${animatedWidth}%`,
|
|
28957
|
-
} }, label ? (jsxRuntime.jsx("span", { className: `${baseLabelClasses} ${labelClasses} ${textColorClass} ${valuesLength === 1 ? 'tw
|
|
29218
|
+
} }, label ? (jsxRuntime.jsx("span", { className: `${baseLabelClasses} ${labelClasses} ${textColorClass} ${valuesLength === 1 ? 'tw-absolute tw-z-50' : ''}`, children: label })) : undefined));
|
|
28958
29219
|
};
|
|
28959
29220
|
const ProgressBar = ({ values = [], max = 100, containerExtraClasses = '', zeroValueLabel = 'No progress yet', }) => {
|
|
28960
29221
|
const totalValue = values.reduce((acc, { value }) => acc + value, 0);
|
|
28961
|
-
return (jsxRuntime.jsx(Root, { className: `tw
|
|
29222
|
+
return (jsxRuntime.jsx(Root, { className: `tw-relative tw-h-[18px] tw-w-full tw-overflow-hidden tw-rounded-[15px] tw-bg-sq-dark-gray dark:tw-bg-sq-dark-disabled-gray tw-flex tw-flex-1 ${containerExtraClasses}`, max: max, value: totalValue, children: totalValue > 0 ? (values.map((props, i) => {
|
|
28962
29223
|
return (React.createElement(ProgressIndicator, { ...props, max: max, valuesLength: values.length, index: i, totalValue: totalValue, key: i }));
|
|
28963
|
-
})) : (jsxRuntime.jsx("div", { className: `${baseLabelClasses} tw
|
|
29224
|
+
})) : (jsxRuntime.jsx("div", { className: `${baseLabelClasses} tw-mx-auto tw-overflow-hidden`, children: zeroValueLabel })) }));
|
|
28964
29225
|
};
|
|
28965
29226
|
|
|
28966
|
-
const baseClasses = 'tw
|
|
29227
|
+
const baseClasses = 'tw-flex tw-outline-none tw-w-full tw-relative tw-flex-wrap';
|
|
28967
29228
|
const activeClassesByVariantLightTheme = {
|
|
28968
|
-
'outline': 'tw
|
|
28969
|
-
'theme': 'tw
|
|
29229
|
+
'outline': '!tw-bg-sq-disabled-gray tw-border-sq-color-dark',
|
|
29230
|
+
'theme': 'tw-bg-sq-color-highlight',
|
|
28970
29231
|
'danger': '',
|
|
28971
29232
|
'theme-light': '',
|
|
28972
|
-
'no-border': 'tw
|
|
29233
|
+
'no-border': '!tw-bg-sq-disabled-gray',
|
|
28973
29234
|
'warning': '',
|
|
28974
29235
|
};
|
|
28975
29236
|
const activeClassesByVariantDarkTheme = {
|
|
28976
|
-
'outline': 'tw
|
|
28977
|
-
'theme': '
|
|
29237
|
+
'outline': 'dark:!tw-bg-sq-multi-gray-dark dark:tw-border-sq-color-dark',
|
|
29238
|
+
'theme': 'dark:tw-bg-sq-color-highlight',
|
|
28978
29239
|
'danger': '',
|
|
28979
29240
|
'theme-light': '',
|
|
28980
|
-
'no-border': 'tw
|
|
29241
|
+
'no-border': 'dark:!tw-bg-sq-multi-gray-dark',
|
|
28981
29242
|
'warning': '',
|
|
28982
29243
|
};
|
|
28983
29244
|
/**
|
|
@@ -28989,7 +29250,7 @@ const ButtonGroup = (props) => {
|
|
|
28989
29250
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
28990
29251
|
return (jsxRuntime.jsx("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData, children: buttons
|
|
28991
29252
|
.filter(Boolean)
|
|
28992
|
-
.map((item, index) => item?.variant === 'button' ? (jsxRuntime.jsx(Button, { ...item.buttonProps, extraClassNames: `tw
|
|
29253
|
+
.map((item, index) => item?.variant === 'button' ? (jsxRuntime.jsx(Button, { ...item.buttonProps, extraClassNames: `tw-ml-[-1px] focus:tw-z-40 tw-outline-none focus:tw-border tw-rounded-none first:tw-rounded-l-md last:tw-rounded-r-md ${item.buttonProps?.isActive
|
|
28993
29254
|
? `${activeClassesByVariantLightTheme[item?.buttonProps?.variant ?? 'outline']} ${activeClassesByVariantDarkTheme[item?.buttonProps?.variant ?? 'outline']} `
|
|
28994
29255
|
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) }, index)) : (item?.element)) }));
|
|
28995
29256
|
};
|
|
@@ -28999,7 +29260,7 @@ const ButtonGroup = (props) => {
|
|
|
28999
29260
|
* - Easily create a carousel with custom slides.
|
|
29000
29261
|
* - Supports automatic sliding, navigation arrows, and slide indicators.
|
|
29001
29262
|
*/
|
|
29002
|
-
const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '', onSlide = () => { }, autoSlide, showIndicators = true, continuous = true, interval = 4000, prevIcon = 'fc-arrow-dropdown tw
|
|
29263
|
+
const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '', onSlide = () => { }, autoSlide, showIndicators = true, continuous = true, interval = 4000, prevIcon = 'fc-arrow-dropdown tw-rotate-90', nextIcon = 'fc-arrow-dropdown -tw-rotate-90', showArrows = true, iconExtraClassNames = '', carouselItems = [], }) => {
|
|
29003
29264
|
const [currentIndex, setCurrentIndex] = React.useState(activeIndex);
|
|
29004
29265
|
const changeSlide = (nextIndex) => {
|
|
29005
29266
|
const newIndex = (nextIndex + carouselItems.length) % carouselItems.length;
|
|
@@ -29066,7 +29327,7 @@ const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '
|
|
|
29066
29327
|
transition: springTransition,
|
|
29067
29328
|
}),
|
|
29068
29329
|
};
|
|
29069
|
-
return (jsxRuntime.jsxs("div", { "data-testid": testId, className: `tw
|
|
29330
|
+
return (jsxRuntime.jsxs("div", { "data-testid": testId, className: `tw-flex tw-flex-col tw-items-center tw-justify-center tw-w-full tw-overflow-hidden ${extraClassNames}`, children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-w-full tw-h-max tw-gap-1", children: [showArrows && (jsxRuntime.jsx(Button, { icon: prevIcon, size: "lg", variant: "no-border", testId: "carousel-prev", extraClassNames: `${currentIndex === 0 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onBackClick })), jsxRuntime.jsx("div", { className: "tw-h-full tw-w-full tw-overflow-hidden", children: jsxRuntime.jsx(motion.div, { custom: 1, initial: "initial", animate: "animate", exit: "exit", variants: slideVariants, className: "tw-w-full", children: carouselItems[currentIndex] }, currentIndex) }), showArrows && (jsxRuntime.jsx(Button, { icon: nextIcon, testId: "carousel-next", size: "lg", variant: "no-border", extraClassNames: `${currentIndex === carouselItems.length - 1 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onForwardClick }))] }), showIndicators && (jsxRuntime.jsx("div", { className: "tw-flex tw-gap-1 tw-mt-2", children: carouselItems.map((_, i) => (jsxRuntime.jsx("div", { className: `tw-w-2 tw-h-2 tw-rounded-full tw-cursor-pointer ${i === currentIndex ? 'tw-bg-sq-color-dark' : 'tw-bg-sq-darkish-gray'}`, onClick: () => changeSlide(i) }, i))) }))] }));
|
|
29070
29331
|
};
|
|
29071
29332
|
|
|
29072
29333
|
const buttonTypes = ['button', 'reset', 'submit', 'link'];
|