@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.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as jsx$1, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useLayoutEffect, useState, useRef, useEffect, useCallback, forwardRef, useContext, useMemo, createContext, Component, Fragment as Fragment$1, useId as useId$1, useInsertionEffect as useInsertionEffect$
|
|
3
|
+
import React__default, { useLayoutEffect, useState, useRef, useEffect, useCallback, forwardRef, useContext, useMemo, createContext, Component, Fragment as Fragment$1, useId as useId$1, useInsertionEffect as useInsertionEffect$2, Children, isValidElement, createElement } from 'react';
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
5
|
import ReactDOM__default, { createPortal } from 'react-dom';
|
|
6
6
|
|
|
@@ -46,34 +46,34 @@ const getQTipData = ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId,
|
|
|
46
46
|
: undefined;
|
|
47
47
|
|
|
48
48
|
const colorClassesThemeLight = {
|
|
49
|
-
'theme': 'tw
|
|
50
|
-
'white': 'tw
|
|
51
|
-
'dark-gray': 'tw
|
|
52
|
-
'warning': 'tw
|
|
53
|
-
'darkish-gray': 'tw
|
|
54
|
-
'gray': 'tw
|
|
49
|
+
'theme': 'tw-text-sq-color-dark',
|
|
50
|
+
'white': 'tw-text-white',
|
|
51
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
52
|
+
'warning': 'tw-text-sq-warning-color',
|
|
53
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
54
|
+
'gray': 'tw-text-sq-disabled-gray',
|
|
55
55
|
'color': '',
|
|
56
|
-
'info': 'tw
|
|
57
|
-
'text': 'tw
|
|
56
|
+
'info': 'tw-text-sq-link',
|
|
57
|
+
'text': 'tw-text-sq-text-color',
|
|
58
58
|
'inherit': '',
|
|
59
|
-
'danger': 'tw
|
|
60
|
-
'theme-light': 'tw
|
|
61
|
-
'success': 'tw
|
|
59
|
+
'danger': 'tw-text-sq-danger-color',
|
|
60
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
61
|
+
'success': 'tw-text-sq-success-color',
|
|
62
62
|
};
|
|
63
63
|
const colorClassesThemeDark = {
|
|
64
|
-
'theme': '
|
|
64
|
+
'theme': 'dark:tw-text-sq-color-dark-dark',
|
|
65
65
|
'white': '',
|
|
66
|
-
'dark-gray': 'tw
|
|
66
|
+
'dark-gray': 'tw-text-sq-fairly-dark-gray',
|
|
67
67
|
'warning': '',
|
|
68
|
-
'darkish-gray': 'tw
|
|
69
|
-
'gray': '
|
|
68
|
+
'darkish-gray': 'tw-text-sq-darkish-gray',
|
|
69
|
+
'gray': 'dark:tw-text-sq-dark-disabled-gray',
|
|
70
70
|
'color': '',
|
|
71
|
-
'info': '
|
|
72
|
-
'text': '
|
|
71
|
+
'info': 'dark:tw-text-sq-link-dark',
|
|
72
|
+
'text': 'dark:tw-text-sq-dark-text',
|
|
73
73
|
'inherit': '',
|
|
74
|
-
'danger': 'tw
|
|
75
|
-
'theme-light': 'tw
|
|
76
|
-
'success': 'tw
|
|
74
|
+
'danger': 'tw-text-sq-danger-color',
|
|
75
|
+
'theme-light': 'tw-text-sq-color-light',
|
|
76
|
+
'success': 'tw-text-sq-success-color',
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
79
|
* Icon:
|
|
@@ -85,14 +85,14 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
85
85
|
const errorMessage = color === undefined || color === ''
|
|
86
86
|
? 'Icon with type="color" must have prop color specified.'
|
|
87
87
|
: 'Icon with prop color must have type="color".';
|
|
88
|
-
return jsx$1("div", { className: "tw
|
|
88
|
+
return jsx$1("div", { className: "tw-text-sq-danger-color", children: errorMessage });
|
|
89
89
|
}
|
|
90
90
|
const fontAwesomePrefix = iconPrefix ? iconPrefix : 'fa-sharp fa-regular';
|
|
91
91
|
const iconPrefixString = icon.startsWith('fc') ? 'fc' : fontAwesomePrefix;
|
|
92
92
|
const style = type === 'color' && color ? { color } : {};
|
|
93
93
|
const sizeClass = size ? `fa-${size}` : small ? 'fa-sm' : large ? 'fa-lg' : '';
|
|
94
94
|
const appliedClassNames = `${iconPrefixString} ${icon} ${sizeClass}
|
|
95
|
-
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'tw
|
|
95
|
+
${colorClassesThemeLight[type]} ${colorClassesThemeDark[type]} ${onClick ? 'tw-cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none tw-outline-none`;
|
|
96
96
|
const tooltipData = getQTipData(tooltipProps);
|
|
97
97
|
return (jsx$1("i", { className: appliedClassNames, style: style, onClick: onClick, "data-testid": testId, "data-customid": customId, id: id, "data-number": number, ...tooltipData }));
|
|
98
98
|
};
|
|
@@ -103,71 +103,71 @@ const Icon = ({ onClick, icon, iconPrefix = undefined, type = 'theme', extraClas
|
|
|
103
103
|
* - include tooltips and/or icons
|
|
104
104
|
*/
|
|
105
105
|
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, }) => {
|
|
106
|
-
const baseClasses = 'tw
|
|
106
|
+
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';
|
|
107
107
|
const baseClassesByVariant = {
|
|
108
|
-
'outline': '
|
|
109
|
-
'theme': '
|
|
110
|
-
'danger': 'tw
|
|
111
|
-
'tw
|
|
112
|
-
'theme-light': '
|
|
113
|
-
'no-border': '
|
|
114
|
-
'warning': 'tw
|
|
115
|
-
'
|
|
108
|
+
'outline': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
109
|
+
'theme': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
110
|
+
'danger': 'tw-bg-sq-danger-color disabled:tw-opacity-50 aria-disabled:tw-opacity-50 ' +
|
|
111
|
+
'tw-border-solid tw-border tw-border-sq-danger-color',
|
|
112
|
+
'theme-light': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50 tw-border-solid tw-border',
|
|
113
|
+
'no-border': 'disabled:tw-opacity-50 aria-disabled:tw-opacity-50',
|
|
114
|
+
'warning': 'tw-bg-sq-warning-color tw-border-solid tw-border tw-border-sq-warning-color ' +
|
|
115
|
+
'disabled:tw-opacity-50 aria-disabled:tw-opacity-50',
|
|
116
116
|
};
|
|
117
117
|
const textClassesByVariantLightTheme = {
|
|
118
|
-
'outline': 'tw
|
|
119
|
-
'theme': 'tw
|
|
120
|
-
'theme-light': 'tw
|
|
121
|
-
'danger': 'tw
|
|
122
|
-
'no-border': 'tw
|
|
123
|
-
'warning': 'tw
|
|
118
|
+
'outline': 'tw-text-sq-text-color',
|
|
119
|
+
'theme': 'tw-text-white',
|
|
120
|
+
'theme-light': 'tw-text-white',
|
|
121
|
+
'danger': 'tw-text-white',
|
|
122
|
+
'no-border': 'tw-text-sq-text-color',
|
|
123
|
+
'warning': 'tw-text-white',
|
|
124
124
|
};
|
|
125
125
|
const textClassesByVariantDarkTheme = {
|
|
126
|
-
'outline': '
|
|
127
|
-
'theme': '
|
|
128
|
-
'theme-light': '
|
|
129
|
-
'danger': '
|
|
130
|
-
'no-border': '
|
|
131
|
-
'warning': '
|
|
126
|
+
'outline': 'dark:tw-text-sq-dark-text',
|
|
127
|
+
'theme': 'dark:tw-text-white',
|
|
128
|
+
'theme-light': 'dark:tw-text-white',
|
|
129
|
+
'danger': 'dark:tw-text-white',
|
|
130
|
+
'no-border': 'dark:tw-text-sq-dark-text',
|
|
131
|
+
'warning': 'dark:tw-text-white',
|
|
132
132
|
};
|
|
133
133
|
const classesByVariantLightTheme = {
|
|
134
|
-
'outline': 'tw
|
|
135
|
-
'theme': 'tw
|
|
134
|
+
'outline': 'tw-bg-white tw-border-sq-disabled-gray',
|
|
135
|
+
'theme': 'tw-bg-sq-color-dark tw-border-sq-color-dark',
|
|
136
136
|
'danger': '',
|
|
137
|
-
'theme-light': 'tw
|
|
137
|
+
'theme-light': 'tw-bg-sq-icon',
|
|
138
138
|
'no-border': '',
|
|
139
139
|
'warning': '',
|
|
140
140
|
};
|
|
141
141
|
const classesByVariantDarkTheme = {
|
|
142
|
-
'outline': '
|
|
143
|
-
'theme': '
|
|
142
|
+
'outline': 'dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-disabled-gray',
|
|
143
|
+
'theme': 'dark:tw-bg-sq-color-dark dark:tw-border-sq-color-dark',
|
|
144
144
|
'danger': '',
|
|
145
|
-
'theme-light': '
|
|
145
|
+
'theme-light': 'dark:tw-bg-sq-icon-dark dark:tw-border-sq-icon-dark',
|
|
146
146
|
'no-border': '',
|
|
147
147
|
'warning': '',
|
|
148
148
|
};
|
|
149
149
|
const activeClassesByVariantLightTheme = {
|
|
150
|
-
'outline': '
|
|
151
|
-
'
|
|
152
|
-
'theme': '
|
|
153
|
-
'danger': '
|
|
154
|
-
'theme-light': '
|
|
150
|
+
'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' +
|
|
151
|
+
' active:tw-border-sq-color-dark',
|
|
152
|
+
'theme': 'hover:tw-bg-sq-color-highlight hover:tw-border-sq-color-highlight',
|
|
153
|
+
'danger': 'hover:tw-bg-sq-danger-color-hover hover:tw-border-sq-danger-color-hover',
|
|
154
|
+
'theme-light': 'hover:tw-bg-sq-link hover:tw-border-sq-link',
|
|
155
155
|
'no-border': '',
|
|
156
156
|
'warning': '',
|
|
157
157
|
};
|
|
158
158
|
const activeClassesByVariantDarkTheme = {
|
|
159
|
-
'outline': '
|
|
160
|
-
'
|
|
161
|
-
'theme': '
|
|
162
|
-
'danger': '
|
|
163
|
-
'theme-light': '
|
|
159
|
+
'outline': 'dark:hover:tw-bg-sq-highlight-color-dark dark:focus:tw-bg-sq-multi-gray-dark' +
|
|
160
|
+
' dark:active:tw-bg-sq-multi-gray-dark dark:focus:tw-border-sq-color-dark dark:active:tw-border-sq-color-dark',
|
|
161
|
+
'theme': 'dark:hover:tw-bg-sq-color-highlight dark:hover:tw-border-sq-color-highlight',
|
|
162
|
+
'danger': 'dark:hover:tw-bg-sq-danger-color-hover dark:hover:tw-border-sq-danger-color-hover',
|
|
163
|
+
'theme-light': 'dark:hover:tw-bg-sq-link-dark dark:hover:tw-border-sq-link-dark',
|
|
164
164
|
'no-border': '',
|
|
165
165
|
'warning': '',
|
|
166
166
|
};
|
|
167
167
|
const sizeClasses = {
|
|
168
|
-
xs: 'tw
|
|
169
|
-
sm: 'tw
|
|
170
|
-
lg: 'tw
|
|
168
|
+
xs: 'tw-text-xs tw-py-0.5',
|
|
169
|
+
sm: 'tw-text-sm tw-py-1',
|
|
170
|
+
lg: 'tw-text-xl tw-py-1',
|
|
171
171
|
};
|
|
172
172
|
let tooltipData = undefined;
|
|
173
173
|
let appliedClasses = `${baseClasses} ${baseClassesByVariant[variant]} ${sizeClasses[size]} ${classesByVariantLightTheme[variant]} ${classesByVariantDarkTheme[variant]} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]} ${extraClassNames}`;
|
|
@@ -183,7 +183,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
183
183
|
'data-qtip-delay': tooltipOptions?.delay ?? DEFAULT_TOOL_TIP_DELAY,
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
const iconClass = iconPosition === 'left' ? 'tw
|
|
186
|
+
const iconClass = iconPosition === 'left' ? 'tw-mr-1' : 'tw-ml-1';
|
|
187
187
|
const iconElement = icon && (jsx$1(Icon, { icon: icon, iconPrefix: iconPrefix, type: iconStyle, color: iconColor, extraClassNames: label
|
|
188
188
|
? `${iconClass} ${textClassesByVariantLightTheme[variant]} ${textClassesByVariantDarkTheme[variant]}`
|
|
189
189
|
: '', testId: `${id}_spinner` }));
|
|
@@ -199,7 +199,7 @@ const Button = ({ onClick, label, variant = 'outline', type = 'button', size = '
|
|
|
199
199
|
}, className: appliedClasses, children: [iconPosition === 'left' && iconElement, label, iconPosition === 'right' && iconElement] }));
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
-
//
|
|
202
|
+
// src/primitive.tsx
|
|
203
203
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
204
204
|
return function handleEvent(event) {
|
|
205
205
|
originalEventHandler?.(event);
|
|
@@ -209,7 +209,7 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
// packages/react/compose-refs/src/
|
|
212
|
+
// packages/react/compose-refs/src/compose-refs.tsx
|
|
213
213
|
function setRef$1(ref, value) {
|
|
214
214
|
if (typeof ref === "function") {
|
|
215
215
|
return ref(value);
|
|
@@ -245,7 +245,7 @@ function useComposedRefs$1(...refs) {
|
|
|
245
245
|
return React.useCallback(composeRefs$1(...refs), refs);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
// packages/react/context/src/
|
|
248
|
+
// packages/react/context/src/create-context.tsx
|
|
249
249
|
function createContext2(rootComponentName, defaultContext) {
|
|
250
250
|
const Context = React.createContext(defaultContext);
|
|
251
251
|
const Provider = (props) => {
|
|
@@ -262,7 +262,7 @@ function createContext2(rootComponentName, defaultContext) {
|
|
|
262
262
|
}
|
|
263
263
|
return [Provider, useContext2];
|
|
264
264
|
}
|
|
265
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
265
|
+
function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
266
266
|
let defaultContexts = [];
|
|
267
267
|
function createContext3(rootComponentName, defaultContext) {
|
|
268
268
|
const BaseContext = React.createContext(defaultContext);
|
|
@@ -297,9 +297,9 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
297
297
|
};
|
|
298
298
|
};
|
|
299
299
|
createScope.scopeName = scopeName;
|
|
300
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
300
|
+
return [createContext3, composeContextScopes$1(createScope, ...createContextScopeDeps)];
|
|
301
301
|
}
|
|
302
|
-
function composeContextScopes(...scopes) {
|
|
302
|
+
function composeContextScopes$1(...scopes) {
|
|
303
303
|
const baseScope = scopes[0];
|
|
304
304
|
if (scopes.length === 1) return baseScope;
|
|
305
305
|
const createScope = () => {
|
|
@@ -320,46 +320,53 @@ function composeContextScopes(...scopes) {
|
|
|
320
320
|
return createScope;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
//
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
323
|
+
// src/slot.tsx
|
|
324
|
+
// @__NO_SIDE_EFFECTS__
|
|
325
|
+
function createSlot$1(ownerName) {
|
|
326
|
+
const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
|
|
327
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
328
|
+
const { children, ...slotProps } = props;
|
|
329
|
+
const childrenArray = React.Children.toArray(children);
|
|
330
|
+
const slottable = childrenArray.find(isSlottable$1);
|
|
331
|
+
if (slottable) {
|
|
332
|
+
const newElement = slottable.props.children;
|
|
333
|
+
const newChildren = childrenArray.map((child) => {
|
|
334
|
+
if (child === slottable) {
|
|
335
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
336
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
337
|
+
} else {
|
|
338
|
+
return child;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
342
|
+
}
|
|
343
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
344
|
+
});
|
|
345
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
346
|
+
return Slot2;
|
|
347
|
+
}
|
|
348
|
+
// @__NO_SIDE_EFFECTS__
|
|
349
|
+
function createSlotClone$1(ownerName) {
|
|
350
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
351
|
+
const { children, ...slotProps } = props;
|
|
352
|
+
if (React.isValidElement(children)) {
|
|
353
|
+
const childrenRef = getElementRef$2(children);
|
|
354
|
+
const props2 = mergeProps$1(slotProps, children.props);
|
|
355
|
+
if (children.type !== React.Fragment) {
|
|
356
|
+
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
336
357
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
var SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
344
|
-
const { children, ...slotProps } = props;
|
|
345
|
-
if (React.isValidElement(children)) {
|
|
346
|
-
const childrenRef = getElementRef$1(children);
|
|
347
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
348
|
-
if (children.type !== React.Fragment) {
|
|
349
|
-
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
350
|
-
}
|
|
351
|
-
return React.cloneElement(children, props2);
|
|
352
|
-
}
|
|
353
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
354
|
-
});
|
|
355
|
-
SlotClone.displayName = "SlotClone";
|
|
356
|
-
var Slottable = ({ children }) => {
|
|
357
|
-
return /* @__PURE__ */ jsx$1(Fragment, { children });
|
|
358
|
-
};
|
|
359
|
-
function isSlottable(child) {
|
|
360
|
-
return React.isValidElement(child) && child.type === Slottable;
|
|
358
|
+
return React.cloneElement(children, props2);
|
|
359
|
+
}
|
|
360
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
361
|
+
});
|
|
362
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
363
|
+
return SlotClone;
|
|
361
364
|
}
|
|
362
|
-
|
|
365
|
+
var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
|
|
366
|
+
function isSlottable$1(child) {
|
|
367
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
|
|
368
|
+
}
|
|
369
|
+
function mergeProps$1(slotProps, childProps) {
|
|
363
370
|
const overrideProps = { ...childProps };
|
|
364
371
|
for (const propName in childProps) {
|
|
365
372
|
const slotPropValue = slotProps[propName];
|
|
@@ -368,8 +375,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
368
375
|
if (isHandler) {
|
|
369
376
|
if (slotPropValue && childPropValue) {
|
|
370
377
|
overrideProps[propName] = (...args) => {
|
|
371
|
-
childPropValue(...args);
|
|
378
|
+
const result = childPropValue(...args);
|
|
372
379
|
slotPropValue(...args);
|
|
380
|
+
return result;
|
|
373
381
|
};
|
|
374
382
|
} else if (slotPropValue) {
|
|
375
383
|
overrideProps[propName] = slotPropValue;
|
|
@@ -382,7 +390,7 @@ function mergeProps(slotProps, childProps) {
|
|
|
382
390
|
}
|
|
383
391
|
return { ...slotProps, ...overrideProps };
|
|
384
392
|
}
|
|
385
|
-
function getElementRef$
|
|
393
|
+
function getElementRef$2(element) {
|
|
386
394
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
387
395
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
388
396
|
if (mayWarn) {
|
|
@@ -396,8 +404,8 @@ function getElementRef$1(element) {
|
|
|
396
404
|
return element.props.ref || element.ref;
|
|
397
405
|
}
|
|
398
406
|
|
|
399
|
-
//
|
|
400
|
-
var NODES = [
|
|
407
|
+
// src/primitive.tsx
|
|
408
|
+
var NODES$1 = [
|
|
401
409
|
"a",
|
|
402
410
|
"button",
|
|
403
411
|
"div",
|
|
@@ -411,11 +419,13 @@ var NODES = [
|
|
|
411
419
|
"nav",
|
|
412
420
|
"ol",
|
|
413
421
|
"p",
|
|
422
|
+
"select",
|
|
414
423
|
"span",
|
|
415
424
|
"svg",
|
|
416
425
|
"ul"
|
|
417
426
|
];
|
|
418
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
427
|
+
var Primitive$1 = NODES$1.reduce((primitive, node) => {
|
|
428
|
+
const Slot = createSlot$1(`Primitive.${node}`);
|
|
419
429
|
const Node = React.forwardRef((props, forwardedRef) => {
|
|
420
430
|
const { asChild, ...primitiveProps } = props;
|
|
421
431
|
const Comp = asChild ? Slot : node;
|
|
@@ -431,7 +441,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
431
441
|
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
432
442
|
}
|
|
433
443
|
|
|
434
|
-
// packages/react/use-callback-ref/src/
|
|
444
|
+
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
|
435
445
|
function useCallbackRef$1(callback) {
|
|
436
446
|
const callbackRef = React.useRef(callback);
|
|
437
447
|
React.useEffect(() => {
|
|
@@ -440,7 +450,7 @@ function useCallbackRef$1(callback) {
|
|
|
440
450
|
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
441
451
|
}
|
|
442
452
|
|
|
443
|
-
// packages/react/use-escape-keydown/src/
|
|
453
|
+
// packages/react/use-escape-keydown/src/use-escape-keydown.tsx
|
|
444
454
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
445
455
|
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
446
456
|
React.useEffect(() => {
|
|
@@ -542,7 +552,7 @@ var DismissableLayer = React.forwardRef(
|
|
|
542
552
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
543
553
|
}, []);
|
|
544
554
|
return /* @__PURE__ */ jsx$1(
|
|
545
|
-
Primitive.div,
|
|
555
|
+
Primitive$1.div,
|
|
546
556
|
{
|
|
547
557
|
...layerProps,
|
|
548
558
|
ref: composedRefs,
|
|
@@ -575,7 +585,7 @@ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
|
575
585
|
};
|
|
576
586
|
}
|
|
577
587
|
}, [context.branches]);
|
|
578
|
-
return /* @__PURE__ */ jsx$1(Primitive.div, { ...props, ref: composedRefs });
|
|
588
|
+
return /* @__PURE__ */ jsx$1(Primitive$1.div, { ...props, ref: composedRefs });
|
|
579
589
|
});
|
|
580
590
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
581
591
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
@@ -799,7 +809,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
|
799
809
|
},
|
|
800
810
|
[loop, trapped, focusScope.paused]
|
|
801
811
|
);
|
|
802
|
-
return /* @__PURE__ */ jsx$1(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
812
|
+
return /* @__PURE__ */ jsx$1(Primitive$1.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
803
813
|
});
|
|
804
814
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
805
815
|
function focusFirst$2(candidates, { select = false } = {}) {
|
|
@@ -882,12 +892,12 @@ function removeLinks(items) {
|
|
|
882
892
|
return items.filter((item) => item.tagName !== "A");
|
|
883
893
|
}
|
|
884
894
|
|
|
885
|
-
// packages/react/use-layout-effect/src/
|
|
886
|
-
var useLayoutEffect2 =
|
|
895
|
+
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
|
896
|
+
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
|
887
897
|
};
|
|
888
898
|
|
|
889
899
|
// packages/react/id/src/id.tsx
|
|
890
|
-
var useReactId = React["useId".toString()] || (() => void 0);
|
|
900
|
+
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
891
901
|
var count = 0;
|
|
892
902
|
function useId(deterministicId) {
|
|
893
903
|
const [id, setId] = React.useState(useReactId());
|
|
@@ -3093,12 +3103,12 @@ const arrow$2 = (options, deps) => ({
|
|
|
3093
3103
|
options: [options, deps]
|
|
3094
3104
|
});
|
|
3095
3105
|
|
|
3096
|
-
//
|
|
3106
|
+
// src/arrow.tsx
|
|
3097
3107
|
var NAME = "Arrow";
|
|
3098
3108
|
var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
3099
3109
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
3100
3110
|
return /* @__PURE__ */ jsx$1(
|
|
3101
|
-
Primitive.svg,
|
|
3111
|
+
Primitive$1.svg,
|
|
3102
3112
|
{
|
|
3103
3113
|
...arrowProps,
|
|
3104
3114
|
ref: forwardedRef,
|
|
@@ -3113,7 +3123,7 @@ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
3113
3123
|
Arrow$1.displayName = NAME;
|
|
3114
3124
|
var Root$5 = Arrow$1;
|
|
3115
3125
|
|
|
3116
|
-
// packages/react/use-size/src/
|
|
3126
|
+
// packages/react/use-size/src/use-size.tsx
|
|
3117
3127
|
function useSize(element) {
|
|
3118
3128
|
const [size, setSize] = React.useState(void 0);
|
|
3119
3129
|
useLayoutEffect2(() => {
|
|
@@ -3150,7 +3160,7 @@ function useSize(element) {
|
|
|
3150
3160
|
}
|
|
3151
3161
|
|
|
3152
3162
|
var POPPER_NAME = "Popper";
|
|
3153
|
-
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
3163
|
+
var [createPopperContext, createPopperScope] = createContextScope$1(POPPER_NAME);
|
|
3154
3164
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
3155
3165
|
var Popper = (props) => {
|
|
3156
3166
|
const { __scopePopper, children } = props;
|
|
@@ -3165,10 +3175,15 @@ var PopperAnchor = React.forwardRef(
|
|
|
3165
3175
|
const context = usePopperContext(ANCHOR_NAME$2, __scopePopper);
|
|
3166
3176
|
const ref = React.useRef(null);
|
|
3167
3177
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
3178
|
+
const anchorRef = React.useRef(null);
|
|
3168
3179
|
React.useEffect(() => {
|
|
3169
|
-
|
|
3180
|
+
const previousAnchor = anchorRef.current;
|
|
3181
|
+
anchorRef.current = virtualRef?.current || ref.current;
|
|
3182
|
+
if (previousAnchor !== anchorRef.current) {
|
|
3183
|
+
context.onAnchorChange(anchorRef.current);
|
|
3184
|
+
}
|
|
3170
3185
|
});
|
|
3171
|
-
return virtualRef ? null : /* @__PURE__ */ jsx$1(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
3186
|
+
return virtualRef ? null : /* @__PURE__ */ jsx$1(Primitive$1.div, { ...anchorProps, ref: composedRefs });
|
|
3172
3187
|
}
|
|
3173
3188
|
);
|
|
3174
3189
|
PopperAnchor.displayName = ANCHOR_NAME$2;
|
|
@@ -3295,7 +3310,7 @@ var PopperContent = React.forwardRef(
|
|
|
3295
3310
|
arrowY,
|
|
3296
3311
|
shouldHideArrow: cannotCenterArrow,
|
|
3297
3312
|
children: /* @__PURE__ */ jsx$1(
|
|
3298
|
-
Primitive.div,
|
|
3313
|
+
Primitive$1.div,
|
|
3299
3314
|
{
|
|
3300
3315
|
"data-side": placedSide,
|
|
3301
3316
|
"data-align": placedAlign,
|
|
@@ -3420,7 +3435,7 @@ var Portal$3 = React.forwardRef((props, forwardedRef) => {
|
|
|
3420
3435
|
const [mounted, setMounted] = React.useState(false);
|
|
3421
3436
|
useLayoutEffect2(() => setMounted(true), []);
|
|
3422
3437
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
3423
|
-
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx$1(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
3438
|
+
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx$1(Primitive$1.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
3424
3439
|
});
|
|
3425
3440
|
Portal$3.displayName = PORTAL_NAME$4;
|
|
3426
3441
|
|
|
@@ -3431,19 +3446,19 @@ function useStateMachine(initialState, machine) {
|
|
|
3431
3446
|
}, initialState);
|
|
3432
3447
|
}
|
|
3433
3448
|
|
|
3434
|
-
//
|
|
3449
|
+
// src/presence.tsx
|
|
3435
3450
|
var Presence = (props) => {
|
|
3436
3451
|
const { present, children } = props;
|
|
3437
3452
|
const presence = usePresence$1(present);
|
|
3438
3453
|
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
|
|
3439
|
-
const ref = useComposedRefs$1(presence.ref, getElementRef(child));
|
|
3454
|
+
const ref = useComposedRefs$1(presence.ref, getElementRef$1(child));
|
|
3440
3455
|
const forceMount = typeof children === "function";
|
|
3441
3456
|
return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
|
|
3442
3457
|
};
|
|
3443
3458
|
Presence.displayName = "Presence";
|
|
3444
3459
|
function usePresence$1(present) {
|
|
3445
3460
|
const [node, setNode] = React.useState();
|
|
3446
|
-
const stylesRef = React.useRef(
|
|
3461
|
+
const stylesRef = React.useRef(null);
|
|
3447
3462
|
const prevPresentRef = React.useRef(present);
|
|
3448
3463
|
const prevAnimationNameRef = React.useRef("none");
|
|
3449
3464
|
const initialState = present ? "mounted" : "unmounted";
|
|
@@ -3492,7 +3507,7 @@ function usePresence$1(present) {
|
|
|
3492
3507
|
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
3493
3508
|
const handleAnimationEnd = (event) => {
|
|
3494
3509
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
3495
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
3510
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
3496
3511
|
if (event.target === node && isCurrentAnimation) {
|
|
3497
3512
|
send("ANIMATION_END");
|
|
3498
3513
|
if (!prevPresentRef.current) {
|
|
@@ -3527,7 +3542,7 @@ function usePresence$1(present) {
|
|
|
3527
3542
|
return {
|
|
3528
3543
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
3529
3544
|
ref: React.useCallback((node2) => {
|
|
3530
|
-
|
|
3545
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
3531
3546
|
setNode(node2);
|
|
3532
3547
|
}, [])
|
|
3533
3548
|
};
|
|
@@ -3535,7 +3550,7 @@ function usePresence$1(present) {
|
|
|
3535
3550
|
function getAnimationName(styles) {
|
|
3536
3551
|
return styles?.animationName || "none";
|
|
3537
3552
|
}
|
|
3538
|
-
function getElementRef(element) {
|
|
3553
|
+
function getElementRef$1(element) {
|
|
3539
3554
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
3540
3555
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3541
3556
|
if (mayWarn) {
|
|
@@ -3549,28 +3564,47 @@ function getElementRef(element) {
|
|
|
3549
3564
|
return element.props.ref || element.ref;
|
|
3550
3565
|
}
|
|
3551
3566
|
|
|
3552
|
-
//
|
|
3567
|
+
// src/use-controllable-state.tsx
|
|
3568
|
+
var useInsertionEffect$1 = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3553
3569
|
function useControllableState({
|
|
3554
3570
|
prop,
|
|
3555
3571
|
defaultProp,
|
|
3556
3572
|
onChange = () => {
|
|
3557
|
-
}
|
|
3573
|
+
},
|
|
3574
|
+
caller
|
|
3558
3575
|
}) {
|
|
3559
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
3576
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
3577
|
+
defaultProp,
|
|
3578
|
+
onChange
|
|
3579
|
+
});
|
|
3560
3580
|
const isControlled = prop !== void 0;
|
|
3561
3581
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3562
|
-
|
|
3582
|
+
{
|
|
3583
|
+
const isControlledRef = React.useRef(prop !== void 0);
|
|
3584
|
+
React.useEffect(() => {
|
|
3585
|
+
const wasControlled = isControlledRef.current;
|
|
3586
|
+
if (wasControlled !== isControlled) {
|
|
3587
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
3588
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
3589
|
+
console.warn(
|
|
3590
|
+
`${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.`
|
|
3591
|
+
);
|
|
3592
|
+
}
|
|
3593
|
+
isControlledRef.current = isControlled;
|
|
3594
|
+
}, [isControlled, caller]);
|
|
3595
|
+
}
|
|
3563
3596
|
const setValue = React.useCallback(
|
|
3564
3597
|
(nextValue) => {
|
|
3565
3598
|
if (isControlled) {
|
|
3566
|
-
const
|
|
3567
|
-
|
|
3568
|
-
|
|
3599
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
3600
|
+
if (value2 !== prop) {
|
|
3601
|
+
onChangeRef.current?.(value2);
|
|
3602
|
+
}
|
|
3569
3603
|
} else {
|
|
3570
3604
|
setUncontrolledProp(nextValue);
|
|
3571
3605
|
}
|
|
3572
3606
|
},
|
|
3573
|
-
[isControlled, prop, setUncontrolledProp,
|
|
3607
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
3574
3608
|
);
|
|
3575
3609
|
return [value, setValue];
|
|
3576
3610
|
}
|
|
@@ -3578,17 +3612,22 @@ function useUncontrolledState({
|
|
|
3578
3612
|
defaultProp,
|
|
3579
3613
|
onChange
|
|
3580
3614
|
}) {
|
|
3581
|
-
const
|
|
3582
|
-
const [value] = uncontrolledState;
|
|
3615
|
+
const [value, setValue] = React.useState(defaultProp);
|
|
3583
3616
|
const prevValueRef = React.useRef(value);
|
|
3584
|
-
const
|
|
3617
|
+
const onChangeRef = React.useRef(onChange);
|
|
3618
|
+
useInsertionEffect$1(() => {
|
|
3619
|
+
onChangeRef.current = onChange;
|
|
3620
|
+
}, [onChange]);
|
|
3585
3621
|
React.useEffect(() => {
|
|
3586
3622
|
if (prevValueRef.current !== value) {
|
|
3587
|
-
|
|
3623
|
+
onChangeRef.current?.(value);
|
|
3588
3624
|
prevValueRef.current = value;
|
|
3589
3625
|
}
|
|
3590
|
-
}, [value, prevValueRef
|
|
3591
|
-
return
|
|
3626
|
+
}, [value, prevValueRef]);
|
|
3627
|
+
return [value, setValue, onChangeRef];
|
|
3628
|
+
}
|
|
3629
|
+
function isFunction(value) {
|
|
3630
|
+
return typeof value === "function";
|
|
3592
3631
|
}
|
|
3593
3632
|
|
|
3594
3633
|
var getDefaultParent = function (originalTarget) {
|
|
@@ -4479,7 +4518,7 @@ var ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.c
|
|
|
4479
4518
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4480
4519
|
|
|
4481
4520
|
var POPOVER_NAME = "Popover";
|
|
4482
|
-
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
4521
|
+
var [createPopoverContext, createPopoverScope] = createContextScope$1(POPOVER_NAME, [
|
|
4483
4522
|
createPopperScope
|
|
4484
4523
|
]);
|
|
4485
4524
|
var usePopperScope$1 = createPopperScope();
|
|
@@ -4496,10 +4535,11 @@ var Popover = (props) => {
|
|
|
4496
4535
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
4497
4536
|
const triggerRef = React.useRef(null);
|
|
4498
4537
|
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
4499
|
-
const [open
|
|
4538
|
+
const [open, setOpen] = useControllableState({
|
|
4500
4539
|
prop: openProp,
|
|
4501
|
-
defaultProp: defaultOpen,
|
|
4502
|
-
onChange: onOpenChange
|
|
4540
|
+
defaultProp: defaultOpen ?? false,
|
|
4541
|
+
onChange: onOpenChange,
|
|
4542
|
+
caller: POPOVER_NAME
|
|
4503
4543
|
});
|
|
4504
4544
|
return /* @__PURE__ */ jsx$1(Root2$4, { ...popperScope, children: /* @__PURE__ */ jsx$1(
|
|
4505
4545
|
PopoverProvider,
|
|
@@ -4542,7 +4582,7 @@ var PopoverTrigger = React.forwardRef(
|
|
|
4542
4582
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
4543
4583
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
4544
4584
|
const trigger = /* @__PURE__ */ jsx$1(
|
|
4545
|
-
Primitive.button,
|
|
4585
|
+
Primitive$1.button,
|
|
4546
4586
|
{
|
|
4547
4587
|
type: "button",
|
|
4548
4588
|
"aria-haspopup": "dialog",
|
|
@@ -4578,6 +4618,7 @@ var PopoverContent$1 = React.forwardRef(
|
|
|
4578
4618
|
}
|
|
4579
4619
|
);
|
|
4580
4620
|
PopoverContent$1.displayName = CONTENT_NAME$6;
|
|
4621
|
+
var Slot$2 = createSlot$1("PopoverContent.RemoveScroll");
|
|
4581
4622
|
var PopoverContentModal = React.forwardRef(
|
|
4582
4623
|
(props, forwardedRef) => {
|
|
4583
4624
|
const context = usePopoverContext(CONTENT_NAME$6, props.__scopePopover);
|
|
@@ -4588,7 +4629,7 @@ var PopoverContentModal = React.forwardRef(
|
|
|
4588
4629
|
const content = contentRef.current;
|
|
4589
4630
|
if (content) return hideOthers(content);
|
|
4590
4631
|
}, []);
|
|
4591
|
-
return /* @__PURE__ */ jsx$1(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx$1(
|
|
4632
|
+
return /* @__PURE__ */ jsx$1(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, children: /* @__PURE__ */ jsx$1(
|
|
4592
4633
|
PopoverContentImpl,
|
|
4593
4634
|
{
|
|
4594
4635
|
...props,
|
|
@@ -4727,7 +4768,7 @@ var PopoverClose = React.forwardRef(
|
|
|
4727
4768
|
const { __scopePopover, ...closeProps } = props;
|
|
4728
4769
|
const context = usePopoverContext(CLOSE_NAME$1, __scopePopover);
|
|
4729
4770
|
return /* @__PURE__ */ jsx$1(
|
|
4730
|
-
Primitive.button,
|
|
4771
|
+
Primitive$1.button,
|
|
4731
4772
|
{
|
|
4732
4773
|
type: "button",
|
|
4733
4774
|
...closeProps,
|
|
@@ -4777,30 +4818,31 @@ function getSvgIconPath(icon) {
|
|
|
4777
4818
|
}
|
|
4778
4819
|
|
|
4779
4820
|
const popoverBorderStyles = [
|
|
4780
|
-
'tw
|
|
4781
|
-
'tw
|
|
4782
|
-
'tw
|
|
4783
|
-
'tw
|
|
4784
|
-
'
|
|
4821
|
+
'tw-border-solid',
|
|
4822
|
+
'tw-border',
|
|
4823
|
+
'tw-rounded-md',
|
|
4824
|
+
'tw-border-sq-disabled-gray',
|
|
4825
|
+
'dark:tw-border-gray-500',
|
|
4785
4826
|
].join(' ');
|
|
4786
4827
|
const triggerBackgroundStyles = [
|
|
4787
|
-
'tw
|
|
4788
|
-
'
|
|
4789
|
-
'
|
|
4790
|
-
'
|
|
4791
|
-
'
|
|
4792
|
-
'
|
|
4828
|
+
'tw-bg-transparent',
|
|
4829
|
+
'hover:tw-bg-sq-worksheetspanel-gray',
|
|
4830
|
+
'active:tw-bg-sq-worksheetspanel-gray',
|
|
4831
|
+
'dark:tw-bg-transparent',
|
|
4832
|
+
'dark:hover:tw-bg-sq-field-disabled-gray',
|
|
4833
|
+
'dark:active:tw-bg-sq-field-disabled-gray',
|
|
4793
4834
|
].join(' ');
|
|
4794
4835
|
const activeBackgroundStyles = [
|
|
4795
4836
|
'active',
|
|
4796
|
-
'tw
|
|
4797
|
-
'tw
|
|
4798
|
-
'tw
|
|
4799
|
-
'
|
|
4800
|
-
'
|
|
4837
|
+
'tw-bg-sq-overlay-gray',
|
|
4838
|
+
'hover:tw-bg-sq-overlay-gray',
|
|
4839
|
+
'active:tw-bg-sq-overlay-gray',
|
|
4840
|
+
'dark:tw-bg-sq-dark-disabled-gray',
|
|
4841
|
+
'dark:hover:tw-border-sq-dark-disabled-gray',
|
|
4842
|
+
'dark:active:tw-bg-sq-dark-disabled-gray',
|
|
4801
4843
|
].join(' ');
|
|
4802
|
-
const bgStyles$3 = ['tw
|
|
4803
|
-
const disabledClasses$4 = ['tw
|
|
4844
|
+
const bgStyles$3 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
4845
|
+
const disabledClasses$4 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
4804
4846
|
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (jsx$1(Content2$3, { ref: ref, align: align, sideOffset: sideOffset, ...props, asChild: true })));
|
|
4805
4847
|
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, }) => {
|
|
4806
4848
|
let tooltipData = undefined;
|
|
@@ -4818,12 +4860,12 @@ const ToolbarButton = ({ isSmall = false, label, icon, secondIcon, forceSmallIco
|
|
|
4818
4860
|
onHide && onHide();
|
|
4819
4861
|
}
|
|
4820
4862
|
};
|
|
4821
|
-
return (jsxs(Root2$3, { defaultOpen: false, onOpenChange: onOpenChange, children: [jsx$1(Trigger$3, { id: id, className: `tw
|
|
4863
|
+
return (jsxs(Root2$3, { defaultOpen: false, onOpenChange: onOpenChange, children: [jsx$1(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) => {
|
|
4822
4864
|
onClick && onClick(e);
|
|
4823
|
-
}, children: jsxs("div", { ...tooltipData, className: `tw
|
|
4824
|
-
' tw
|
|
4825
|
-
'
|
|
4826
|
-
popoverBorderStyles, children: [hasArrow && (jsx$1(Arrow2$2, { asChild: true, children: jsx$1("div", { className: " tw
|
|
4865
|
+
}, children: 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: [jsxs("span", { className: "tw-nowrap", children: [isPrimaryAnSvg ? (jsx$1("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: jsx$1("path", { d: getSvgIconPath(icon) }) })) : (jsx$1(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 && jsx$1(Icon, { icon: secondIcon, type: "text", testId: "secondIcon" }), popoverContent ? (jsx$1(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 && (jsx$1("small", { className: "tw-text-sq-text-color dark:tw-text-sq-dark-text tw-text-[0.625rem]", children: label }))] }) }), !!popoverContent ? (jsx$1(PopoverContent, { sideOffset: 2, align: "start", children: jsxs("div", { className: bgStyles$3 +
|
|
4866
|
+
' 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' +
|
|
4867
|
+
' 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' +
|
|
4868
|
+
popoverBorderStyles, children: [hasArrow && (jsx$1(Arrow2$2, { asChild: true, children: jsx$1("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] }));
|
|
4827
4869
|
};
|
|
4828
4870
|
|
|
4829
4871
|
const setValidInputDimension = (width, height) => {
|
|
@@ -4840,24 +4882,24 @@ const setValidInputDimension = (width, height) => {
|
|
|
4840
4882
|
return inputStyle;
|
|
4841
4883
|
};
|
|
4842
4884
|
|
|
4843
|
-
const errorClasses$4 = 'tw
|
|
4885
|
+
const errorClasses$4 = 'tw-border-sq-danger-color';
|
|
4844
4886
|
const borderColorClasses$4 = [
|
|
4845
|
-
'tw
|
|
4846
|
-
'
|
|
4847
|
-
'
|
|
4848
|
-
'
|
|
4849
|
-
'
|
|
4850
|
-
'
|
|
4887
|
+
'tw-border-sq-disabled-gray',
|
|
4888
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
4889
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4890
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
4891
|
+
'focus:tw-border-sq-color-dark',
|
|
4892
|
+
'active:tw-border-sq-color-dark',
|
|
4851
4893
|
].join(' ');
|
|
4852
|
-
const baseClasses$6 = 'tw
|
|
4853
|
-
'
|
|
4854
|
-
'
|
|
4855
|
-
'
|
|
4856
|
-
const darkTheme$3 = '
|
|
4857
|
-
const lightTheme$3 = 'tw
|
|
4894
|
+
const baseClasses$6 = 'tw-h-inputs tw-leading-normal tw-outline-none tw-py-1 tw-px-3' +
|
|
4895
|
+
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4896
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-placeholder-gray-400' +
|
|
4897
|
+
' dark:tw-placeholder-sq-dark-text-lighter specTextField';
|
|
4898
|
+
const darkTheme$3 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
4899
|
+
const lightTheme$3 = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
4858
4900
|
const sizeClasses = {
|
|
4859
|
-
sm: 'tw
|
|
4860
|
-
lg: 'tw
|
|
4901
|
+
sm: 'tw-text-sm',
|
|
4902
|
+
lg: 'tw-text-xl',
|
|
4861
4903
|
};
|
|
4862
4904
|
/**
|
|
4863
4905
|
* Textfield.
|
|
@@ -4899,12 +4941,12 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4899
4941
|
internalRef.current.value = `${value}`;
|
|
4900
4942
|
}
|
|
4901
4943
|
}, [value]);
|
|
4902
|
-
let borderRadius = 'tw
|
|
4944
|
+
let borderRadius = 'tw-rounded-md';
|
|
4903
4945
|
if (inputGroup === 'left') {
|
|
4904
|
-
borderRadius = 'tw
|
|
4946
|
+
borderRadius = 'tw-rounded-l-md tw-border-r-0 focus:tw-border-r' + ' active:tw-border-r';
|
|
4905
4947
|
}
|
|
4906
4948
|
else if (inputGroup === 'right') {
|
|
4907
|
-
borderRadius = 'tw
|
|
4949
|
+
borderRadius = 'tw-rounded-r-md tw-border-l-0 focus:tw-border-l active:tw-border-l';
|
|
4908
4950
|
}
|
|
4909
4951
|
const appliedClasses = `${baseClasses$6} ${sizeClasses[size]} ${extraClassNames} ${lightTheme$3} ${darkTheme$3} ${borderRadius} ${showError ? errorClasses$4 : borderColorClasses$4} `;
|
|
4910
4952
|
const inputProp = setValidInputDimension(inputWidth, inputHeight)
|
|
@@ -4917,18 +4959,18 @@ const TextField = React__default.forwardRef((props, ref) => {
|
|
|
4917
4959
|
inputLenghtProp.maxLength = maxLength;
|
|
4918
4960
|
if (minLength)
|
|
4919
4961
|
inputLenghtProp.minLength = minLength;
|
|
4920
|
-
return (jsxs(Fragment, { children: [jsx$1("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 && jsx$1("div", { className: "tw
|
|
4962
|
+
return (jsxs(Fragment, { children: [jsx$1("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 && jsx$1("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1", children: errorText })] }));
|
|
4921
4963
|
});
|
|
4922
4964
|
|
|
4923
|
-
const alignment = 'tw
|
|
4924
|
-
const labelClasses = 'tw
|
|
4925
|
-
const baseClasses$5 = 'tw
|
|
4926
|
-
'
|
|
4927
|
-
'
|
|
4928
|
-
'
|
|
4929
|
-
'
|
|
4930
|
-
const checkboxClasses = `tw
|
|
4931
|
-
const radioClasses = `tw
|
|
4965
|
+
const alignment = 'tw-flex';
|
|
4966
|
+
const labelClasses = 'tw-ml-1.5 tw-text-sm tw--mt-0.5';
|
|
4967
|
+
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' +
|
|
4968
|
+
' dark:tw-bg-sq-dark-background dark:tw-border-sq-dark-text dark:hover:tw-bg-sq-dark-background' +
|
|
4969
|
+
' checked:tw-text-white checked:tw-border-sq-text-color checked:hover:tw-border-sq-color-dark' +
|
|
4970
|
+
' checked:active:tw-border-sq-color-dark checked:focus:tw-border-sq-color-dark disabled:tw-border-sq-disabled-gray' +
|
|
4971
|
+
' dark:disabled:tw-border-sq-fairly-dark-gray dark:checked:focus:tw-bg-sq-dark-background';
|
|
4972
|
+
const checkboxClasses = `tw-form-checkbox tw-rounded ${baseClasses$5}`;
|
|
4973
|
+
const radioClasses = `tw-form-radio ${baseClasses$5}`;
|
|
4932
4974
|
/**
|
|
4933
4975
|
* Checkbox and Radio Box Component.
|
|
4934
4976
|
*/
|
|
@@ -4936,25 +4978,25 @@ const Checkbox = (props) => {
|
|
|
4936
4978
|
const { type = 'checkbox', value, disabled = false, label, onChange, onClick, onKeyDown, checked, defaultChecked, id, name, extraClassNames, extraLabelClassNames, testId, ...tooltipProps } = props;
|
|
4937
4979
|
const assignedId = id ?? 'checkbox_' + Math.random();
|
|
4938
4980
|
const tooltipData = getQTipData(tooltipProps);
|
|
4939
|
-
return (jsxs("span", { className: `${alignment} ${extraClassNames}`, children: [jsx$1("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
|
|
4940
|
-
? 'tw
|
|
4941
|
-
: 'tw
|
|
4942
|
-
};
|
|
4943
|
-
|
|
4944
|
-
const baseClasses$4 = 'tw
|
|
4945
|
-
'
|
|
4946
|
-
'
|
|
4947
|
-
const darkTheme$2 = '
|
|
4948
|
-
'
|
|
4949
|
-
const lightTheme$2 = 'tw
|
|
4950
|
-
const errorClasses$3 = 'tw
|
|
4981
|
+
return (jsxs("span", { className: `${alignment} ${extraClassNames}`, children: [jsx$1("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 && (jsx$1("label", { htmlFor: assignedId, className: `${labelClasses} ${extraLabelClassNames} ${disabled
|
|
4982
|
+
? 'tw-cursor-not-allowed dark:tw-text-sq-fairly-dark-gray tw-text-sq-fairly-dark-gray'
|
|
4983
|
+
: 'tw-cursor-pointer tw-text-sq-text-color dark:tw-text-sq-dark-text'}`, children: label }))] }));
|
|
4984
|
+
};
|
|
4985
|
+
|
|
4986
|
+
const baseClasses$4 = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3 tw-rounded-md tw-w-full' +
|
|
4987
|
+
' disabled:tw-pointer-events-none disabled:tw-bg-sq-light-gray disabled:dark:tw-bg-sq-dark-disabled-gray' +
|
|
4988
|
+
' disabled:tw-cursor-not-allowed tw-p-1 tw-border-solid tw-border tw-text-sm';
|
|
4989
|
+
const darkTheme$2 = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text ' +
|
|
4990
|
+
'dark:tw-placeholder-sq-dark-text-lighter disabled:dark:tw-text-sq-dark-text-lighter';
|
|
4991
|
+
const lightTheme$2 = 'tw-text-sq-text-color tw-placeholder-gray-400 disabled:tw-text-sq-darkish-gray';
|
|
4992
|
+
const errorClasses$3 = 'tw-border-sq-danger-color';
|
|
4951
4993
|
const borderColorClasses$3 = [
|
|
4952
|
-
'tw
|
|
4953
|
-
'
|
|
4954
|
-
'
|
|
4955
|
-
'
|
|
4956
|
-
'
|
|
4957
|
-
'
|
|
4994
|
+
'tw-border-sq-disabled-gray',
|
|
4995
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
4996
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
4997
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
4998
|
+
'focus:tw-border-sq-color-dark',
|
|
4999
|
+
'active:tw-border-sq-color-dark',
|
|
4958
5000
|
].join(' ');
|
|
4959
5001
|
/**
|
|
4960
5002
|
* TextArea.
|
|
@@ -5003,25 +5045,25 @@ const TextArea = React__default.forwardRef(({ readonly = false, disabled = false
|
|
|
5003
5045
|
* display correctly.
|
|
5004
5046
|
*/
|
|
5005
5047
|
const Tooltip = ({ position = 'bottom', children, text, delay = DEFAULT_TOOL_TIP_DELAY, }) => {
|
|
5006
|
-
const arrowBaseClasses = "
|
|
5007
|
-
const centerArrowVertically = '
|
|
5008
|
-
const centerArrowHorizontally = '
|
|
5009
|
-
const arrowRight = `${arrowBaseClasses} ${centerArrowVertically}
|
|
5010
|
-
|
|
5011
|
-
const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically}
|
|
5012
|
-
|
|
5013
|
-
const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally}
|
|
5014
|
-
|
|
5015
|
-
const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally}
|
|
5016
|
-
|
|
5048
|
+
const arrowBaseClasses = "before:tw-content-[''] before:tw-absolute before:tw-border-8";
|
|
5049
|
+
const centerArrowVertically = 'before:tw-top-1/2 before:-tw-translate-y-1/2';
|
|
5050
|
+
const centerArrowHorizontally = 'before:tw-left-1/2 before:-tw-translate-x-1/2';
|
|
5051
|
+
const arrowRight = `${arrowBaseClasses} ${centerArrowVertically} before:tw-right-[100%] before:tw-border-y-transparent
|
|
5052
|
+
before:tw-border-l-transparent before:tw-border-r-black`;
|
|
5053
|
+
const arrowLeft = `${arrowBaseClasses} ${centerArrowVertically} before:tw-left-[100%] before:tw-border-y-transparent
|
|
5054
|
+
before:tw-border-l-black before:tw-border-r-transparent`;
|
|
5055
|
+
const arrowBottom = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-top-4 before:tw-border-b-black
|
|
5056
|
+
before:tw-border-r-transparent before:tw-border-l-transparent before:tw-border-t-transparent`;
|
|
5057
|
+
const arrowTop = `${arrowBaseClasses} ${centerArrowHorizontally} before:-tw-bottom-4 before:tw-border-b-transparent
|
|
5058
|
+
before:tw-border-t-black before:tw-border-l-transparent before:tw-border-r-transparent`;
|
|
5017
5059
|
const placements = {
|
|
5018
|
-
top:
|
|
5019
|
-
left:
|
|
5020
|
-
right: `tw
|
|
5021
|
-
bottom:
|
|
5060
|
+
top: `-tw-top-2 -tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowTop}`,
|
|
5061
|
+
left: `-tw-translate-x-full -tw-left-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowLeft}`,
|
|
5062
|
+
right: `tw-translate-x-full -tw-right-3 -tw-translate-y-1/2 tw-top-1/2 ${arrowRight}`,
|
|
5063
|
+
bottom: `-tw-bottom-2 tw-translate-y-full tw-left-1/2 -tw-translate-x-1/2 ${arrowBottom}`,
|
|
5022
5064
|
};
|
|
5023
|
-
return (jsxs("div", { className: "tw
|
|
5024
|
-
tw
|
|
5065
|
+
return (jsxs("div", { className: "tw-group tw-relative tw-inline-block", children: [children, jsx$1("div", { className: `tw-z-50 tw-whitespace-nowrap tw-hidden group-hover:tw-inline-block group-hover:tw-delay-[${delay}ms]
|
|
5066
|
+
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 })] }));
|
|
5025
5067
|
};
|
|
5026
5068
|
|
|
5027
5069
|
/*! @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 */
|
|
@@ -7521,8 +7563,8 @@ const QTip = () => {
|
|
|
7521
7563
|
: positionTooltip();
|
|
7522
7564
|
}
|
|
7523
7565
|
};
|
|
7524
|
-
return (jsx$1(Fragment, { children: jsxs("div", { onMouseEnter: () => setOverTooltip(true), onMouseLeave: () => setOverTooltip(false), "data-testid": tooltipTestId, ref: tooltipRef, className: 'tw
|
|
7525
|
-
(show ? 'tw
|
|
7566
|
+
return (jsx$1(Fragment, { children: 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 ' +
|
|
7567
|
+
(show ? 'tw-visible' : 'tw-invisible tw-pointer-events-none'), children: [html ? jsx$1(HTMLTip, { text: tooltipText }) : tooltipText, jsx$1("div", { className: "tw-absolute tw-w-[10px] tw-h-[10px] tw-rotate-45 tw-bg-black", ref: tooltipArrowRef })] }) }));
|
|
7526
7568
|
};
|
|
7527
7569
|
|
|
7528
7570
|
function _typeof(o) {
|
|
@@ -13937,77 +13979,70 @@ var CreatableSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
13937
13979
|
});
|
|
13938
13980
|
var CreatableSelect$1 = CreatableSelect;
|
|
13939
13981
|
|
|
13940
|
-
const baseClasses$3 = ['
|
|
13941
|
-
const containerStyles = ['tw
|
|
13942
|
-
const errorClasses$2 = 'tw
|
|
13943
|
-
const borderColorClasses$2 = ['tw
|
|
13944
|
-
const borderStyles$3 = ['tw
|
|
13982
|
+
const baseClasses$3 = ['focus:tw-ring-0', 'disabled:tw-cursor-not-allowed'].join(' ');
|
|
13983
|
+
const containerStyles = ['tw-bg-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
13984
|
+
const errorClasses$2 = 'tw-border-sq-danger-color';
|
|
13985
|
+
const borderColorClasses$2 = ['tw-border-sq-disabled-gray', 'dark:tw-border-sq-dark-disabled-gray'].join(' ');
|
|
13986
|
+
const borderStyles$3 = ['tw-border-solid', 'tw-border'].join(' ');
|
|
13945
13987
|
const borderActiveClasses = [
|
|
13946
|
-
'
|
|
13947
|
-
'
|
|
13948
|
-
'
|
|
13949
|
-
'
|
|
13950
|
-
'
|
|
13951
|
-
'
|
|
13988
|
+
'hover:tw-border-sq-color-dark',
|
|
13989
|
+
'focus-within:tw-border-sq-color-dark',
|
|
13990
|
+
'active:tw-border-sq-color-dark',
|
|
13991
|
+
'dark:hover:tw-border-sq-color-dark-dark',
|
|
13992
|
+
'dark:focus-within:tw-border-sq-color-dark-dark',
|
|
13993
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
13952
13994
|
].join(' ');
|
|
13953
|
-
const textStyles = ['tw
|
|
13995
|
+
const textStyles = ['tw-text-sq-text-color', 'dark:tw-text-sq-dark-text', 'tw-text-sm'].join(' ');
|
|
13954
13996
|
const textActiveStyles = [
|
|
13955
|
-
'
|
|
13956
|
-
'tw
|
|
13957
|
-
'
|
|
13958
|
-
'tw:dark:text-sq-dark-disabled-gray',
|
|
13959
|
-
'tw:dark:hover:text-sq-theme-dark-dark',
|
|
13960
|
-
'tw:dark:focus:text-sq-theme-dark-dark',
|
|
13961
|
-
'tw:dark:active:text-sq-theme-dark-dark',
|
|
13962
|
-
'tw:hover:text-sq-theme-dark',
|
|
13963
|
-
'tw:dark:text-sq-dark-disabled-gray',
|
|
13964
|
-
'tw:dark:hover:text-sq-theme-dark-dark',
|
|
13997
|
+
'hover:tw-text-sq-color-dark',
|
|
13998
|
+
'dark:tw-text-sq-dark-disabled-gray',
|
|
13999
|
+
'dark:hover:tw-text-sq-color-dark-dark',
|
|
13965
14000
|
].join(' ');
|
|
13966
14001
|
const menuStyles = [
|
|
13967
|
-
'tw
|
|
13968
|
-
'tw
|
|
13969
|
-
'tw
|
|
13970
|
-
'tw
|
|
13971
|
-
'
|
|
13972
|
-
'tw
|
|
13973
|
-
'tw
|
|
13974
|
-
'tw
|
|
14002
|
+
'tw-border-solid',
|
|
14003
|
+
'tw-border',
|
|
14004
|
+
'tw-rounded-b',
|
|
14005
|
+
'tw-border-sq-disabled-gray',
|
|
14006
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
14007
|
+
'tw-whitespace-nowrap',
|
|
14008
|
+
'tw-min-w-fit',
|
|
14009
|
+
'!tw-z-[9999]',
|
|
13975
14010
|
].join(' ');
|
|
13976
14011
|
const menuListStyles = [
|
|
13977
|
-
'tw
|
|
13978
|
-
'tw
|
|
13979
|
-
'
|
|
13980
|
-
'tw
|
|
13981
|
-
'tw
|
|
14012
|
+
'tw-rounded-b',
|
|
14013
|
+
'tw-bg-white',
|
|
14014
|
+
'dark:tw-bg-sq-dark-background',
|
|
14015
|
+
'tw-min-w-fit',
|
|
14016
|
+
'!tw-z-[9999]',
|
|
13982
14017
|
'specSelectMenu',
|
|
13983
14018
|
].join(' ');
|
|
13984
14019
|
const groupHeadingStyles = [
|
|
13985
|
-
'tw
|
|
13986
|
-
'
|
|
13987
|
-
'tw
|
|
13988
|
-
'tw
|
|
13989
|
-
'tw
|
|
14020
|
+
'tw-bg-sq-light-gray',
|
|
14021
|
+
'dark:tw-bg-sq-dark-disabled-gray',
|
|
14022
|
+
'tw-text-sq-darkish-gray',
|
|
14023
|
+
'tw-py-1',
|
|
14024
|
+
'tw-px-2.5',
|
|
13990
14025
|
'specSelectGroupHeading',
|
|
13991
14026
|
].join(' ');
|
|
13992
14027
|
const optionStyles = [
|
|
13993
|
-
'
|
|
13994
|
-
'
|
|
13995
|
-
'
|
|
13996
|
-
'tw
|
|
13997
|
-
'tw
|
|
14028
|
+
'hover:tw-bg-sq-gray-highlight',
|
|
14029
|
+
'hover:tw-cursor-pointer',
|
|
14030
|
+
'dark:hover:tw-bg-sq-gray-highlight-dark',
|
|
14031
|
+
'tw-py-1',
|
|
14032
|
+
'tw-px-2.5',
|
|
13998
14033
|
'specSelectOption',
|
|
13999
14034
|
].join(' ');
|
|
14000
|
-
const disabledClasses$3 = ['tw
|
|
14001
|
-
const dropDownIndicatorStyles = `tw
|
|
14002
|
-
const placeholderStyles = ['tw
|
|
14035
|
+
const disabledClasses$3 = ['tw-bg-sq-field-disabled-gray', '!tw-cursor-not-allowed', 'tw-opacity-50'].join(' ');
|
|
14036
|
+
const dropDownIndicatorStyles = `tw-text-sq-disabled-gray ${textActiveStyles} specOpenIt`;
|
|
14037
|
+
const placeholderStyles = ['tw-text-gray-400', 'dark:tw-text-sq-dark-text-lighter', 'specOpenSelect'].join(' ');
|
|
14003
14038
|
const multiValueStyles = [
|
|
14004
|
-
'tw
|
|
14005
|
-
'
|
|
14006
|
-
'tw
|
|
14007
|
-
'tw
|
|
14008
|
-
'tw
|
|
14009
|
-
'tw
|
|
14010
|
-
'tw
|
|
14039
|
+
'tw-bg-sq-disabled-gray',
|
|
14040
|
+
'dark:tw-bg-sq-multi-gray-dark',
|
|
14041
|
+
'tw-text-sm',
|
|
14042
|
+
'tw-py-0.5',
|
|
14043
|
+
'tw-px-1',
|
|
14044
|
+
'tw-m-0.5',
|
|
14045
|
+
'tw-rounded-sm',
|
|
14011
14046
|
'specOpenSelect',
|
|
14012
14047
|
].join(' ');
|
|
14013
14048
|
/**
|
|
@@ -14072,38 +14107,38 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
14072
14107
|
filterOption: filterOption ? filterOption : filterConfig ? createFilter(filterConfig) : undefined,
|
|
14073
14108
|
classNames: {
|
|
14074
14109
|
control: ({ menuIsOpen }) => {
|
|
14075
|
-
let border = menuIsOpen ? 'tw
|
|
14110
|
+
let border = menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
14076
14111
|
// if it's on the left side of the input group make sure the right side is straight and not curved
|
|
14077
14112
|
if (inputGroup === 'left') {
|
|
14078
|
-
border = menuIsOpen ? 'tw
|
|
14113
|
+
border = menuIsOpen ? 'tw-rounded-tl-md' : 'tw-rounded-l-md';
|
|
14079
14114
|
}
|
|
14080
14115
|
else if (inputGroup === 'right') {
|
|
14081
|
-
border = menuIsOpen ? 'tw
|
|
14116
|
+
border = menuIsOpen ? 'tw-rounded-tr-md' : 'tw-rounded-r-md';
|
|
14082
14117
|
}
|
|
14083
14118
|
const appliedClasses = `${borderStyles$3} ${isDisabled ? '' : borderActiveClasses} ${border} ${showError ? errorClasses$2 : borderColorClasses$2} ${small ? 'reactSelectMinHeightSmall' : 'reactSelectMinHeight'} ${controlClassNames}`;
|
|
14084
|
-
return `${appliedClasses} ${baseClasses$3} ${containerStyles} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw
|
|
14119
|
+
return `${appliedClasses} ${baseClasses$3} ${containerStyles} specSelectControl ${isDisabled ? disabledClasses$3 : ''} ${small ? 'tw-pl-2 tw-pr-1' : 'tw-pl-2.5 tw-pr-1.5'}`;
|
|
14085
14120
|
},
|
|
14086
14121
|
placeholder: () => placeholderStyles,
|
|
14087
14122
|
container: ({ selectProps }) => {
|
|
14088
|
-
const containerBorderStyles = selectProps?.menuIsOpen ? 'tw
|
|
14089
|
-
return `${textStyles} ${extraClassNames} ${containerBorderStyles} tw
|
|
14123
|
+
const containerBorderStyles = selectProps?.menuIsOpen ? 'tw-rounded-t-md' : 'tw-rounded-md';
|
|
14124
|
+
return `${textStyles} ${extraClassNames} ${containerBorderStyles} !tw-pointer-events-auto`;
|
|
14090
14125
|
},
|
|
14091
14126
|
input: () => textStyles + ' specSelectInput',
|
|
14092
14127
|
menuList: () => menuListStyles,
|
|
14093
14128
|
menu: () => menuStyles,
|
|
14094
|
-
menuPortal: () => 'tw
|
|
14129
|
+
menuPortal: () => '!tw-z-[9000]',
|
|
14095
14130
|
dropdownIndicator: () => dropDownIndicatorStyles,
|
|
14096
14131
|
option: ({ isSelected, isDisabled }) => {
|
|
14097
14132
|
let classes = optionStyles;
|
|
14098
14133
|
if (isDisabled) {
|
|
14099
14134
|
classes += ' specDisabledOption ';
|
|
14100
14135
|
}
|
|
14101
|
-
return isSelected ? classes + ' tw
|
|
14136
|
+
return isSelected ? classes + ' tw-bg-sq-colored-hover dark:tw-bg-sq-colored-hover-dark' : classes;
|
|
14102
14137
|
},
|
|
14103
14138
|
singleValue: () => 'specOpenSelect',
|
|
14104
14139
|
multiValue: () => multiValueStyles,
|
|
14105
|
-
multiValueRemove: () => '
|
|
14106
|
-
clearIndicator: () => 'tw
|
|
14140
|
+
multiValueRemove: () => 'hover:tw-text-sq-danger-color specSelectMultiValueRemove',
|
|
14141
|
+
clearIndicator: () => 'tw-text-sq-disabled-gray hover:tw-text-sq-danger-color specClearSelect',
|
|
14107
14142
|
group: () => 'specSelectGroup',
|
|
14108
14143
|
groupHeading: () => groupHeadingStyles,
|
|
14109
14144
|
},
|
|
@@ -14112,7 +14147,7 @@ const Select = ({ options, value, placeholder = 'select', noOptionsMessage = 'no
|
|
|
14112
14147
|
};
|
|
14113
14148
|
|
|
14114
14149
|
var DIALOG_NAME = "Dialog";
|
|
14115
|
-
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
14150
|
+
var [createDialogContext, createDialogScope] = createContextScope$1(DIALOG_NAME);
|
|
14116
14151
|
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
14117
14152
|
var Dialog$1 = (props) => {
|
|
14118
14153
|
const {
|
|
@@ -14125,10 +14160,11 @@ var Dialog$1 = (props) => {
|
|
|
14125
14160
|
} = props;
|
|
14126
14161
|
const triggerRef = React.useRef(null);
|
|
14127
14162
|
const contentRef = React.useRef(null);
|
|
14128
|
-
const [open
|
|
14163
|
+
const [open, setOpen] = useControllableState({
|
|
14129
14164
|
prop: openProp,
|
|
14130
|
-
defaultProp: defaultOpen,
|
|
14131
|
-
onChange: onOpenChange
|
|
14165
|
+
defaultProp: defaultOpen ?? false,
|
|
14166
|
+
onChange: onOpenChange,
|
|
14167
|
+
caller: DIALOG_NAME
|
|
14132
14168
|
});
|
|
14133
14169
|
return /* @__PURE__ */ jsx$1(
|
|
14134
14170
|
DialogProvider,
|
|
@@ -14155,7 +14191,7 @@ var DialogTrigger = React.forwardRef(
|
|
|
14155
14191
|
const context = useDialogContext(TRIGGER_NAME$4, __scopeDialog);
|
|
14156
14192
|
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
14157
14193
|
return /* @__PURE__ */ jsx$1(
|
|
14158
|
-
Primitive.button,
|
|
14194
|
+
Primitive$1.button,
|
|
14159
14195
|
{
|
|
14160
14196
|
type: "button",
|
|
14161
14197
|
"aria-haspopup": "dialog",
|
|
@@ -14190,6 +14226,7 @@ var DialogOverlay = React.forwardRef(
|
|
|
14190
14226
|
}
|
|
14191
14227
|
);
|
|
14192
14228
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
14229
|
+
var Slot$1 = createSlot$1("DialogOverlay.RemoveScroll");
|
|
14193
14230
|
var DialogOverlayImpl = React.forwardRef(
|
|
14194
14231
|
(props, forwardedRef) => {
|
|
14195
14232
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -14197,8 +14234,8 @@ var DialogOverlayImpl = React.forwardRef(
|
|
|
14197
14234
|
return (
|
|
14198
14235
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
14199
14236
|
// ie. when `Overlay` and `Content` are siblings
|
|
14200
|
-
/* @__PURE__ */ jsx$1(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx$1(
|
|
14201
|
-
Primitive.div,
|
|
14237
|
+
/* @__PURE__ */ jsx$1(ReactRemoveScroll, { as: Slot$1, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx$1(
|
|
14238
|
+
Primitive$1.div,
|
|
14202
14239
|
{
|
|
14203
14240
|
"data-state": getState$2(context.open),
|
|
14204
14241
|
...overlayProps,
|
|
@@ -14336,7 +14373,7 @@ var DialogTitle$1 = React.forwardRef(
|
|
|
14336
14373
|
(props, forwardedRef) => {
|
|
14337
14374
|
const { __scopeDialog, ...titleProps } = props;
|
|
14338
14375
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
14339
|
-
return /* @__PURE__ */ jsx$1(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
14376
|
+
return /* @__PURE__ */ jsx$1(Primitive$1.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
14340
14377
|
}
|
|
14341
14378
|
);
|
|
14342
14379
|
DialogTitle$1.displayName = TITLE_NAME;
|
|
@@ -14345,7 +14382,7 @@ var DialogDescription$1 = React.forwardRef(
|
|
|
14345
14382
|
(props, forwardedRef) => {
|
|
14346
14383
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
14347
14384
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
14348
|
-
return /* @__PURE__ */ jsx$1(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
14385
|
+
return /* @__PURE__ */ jsx$1(Primitive$1.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
14349
14386
|
}
|
|
14350
14387
|
);
|
|
14351
14388
|
DialogDescription$1.displayName = DESCRIPTION_NAME;
|
|
@@ -14355,7 +14392,7 @@ var DialogClose$1 = React.forwardRef(
|
|
|
14355
14392
|
const { __scopeDialog, ...closeProps } = props;
|
|
14356
14393
|
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
14357
14394
|
return /* @__PURE__ */ jsx$1(
|
|
14358
|
-
Primitive.button,
|
|
14395
|
+
Primitive$1.button,
|
|
14359
14396
|
{
|
|
14360
14397
|
type: "button",
|
|
14361
14398
|
...closeProps,
|
|
@@ -14493,11 +14530,11 @@ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
|
14493
14530
|
const Dialog = Root$4;
|
|
14494
14531
|
const DialogPortal = Portal$1;
|
|
14495
14532
|
const DialogClose = Close;
|
|
14496
|
-
const DialogContent = React__default.forwardRef(({ className, children, ...props }, ref) => (jsxs(DialogPortal, { children: [jsx$1("div", { className: "tw
|
|
14497
|
-
tw
|
|
14498
|
-
tw
|
|
14533
|
+
const DialogContent = React__default.forwardRef(({ className, children, ...props }, ref) => (jsxs(DialogPortal, { children: [jsx$1("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 " }), 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
|
|
14534
|
+
tw-gap-4 tw-border tw-bg-sq-white dark:tw-bg-sq-dark-background tw-p-6 tw-shadow-lg tw-duration-200
|
|
14535
|
+
tw-rounded-lg ${className}`, ...props, children: [jsx$1(DialogTitle$1, { className: "tw-hidden" }), children] })] })));
|
|
14499
14536
|
DialogContent.displayName = Content$2.displayName;
|
|
14500
|
-
const DialogHeader = (props) => (jsx$1("div", { className: "tw
|
|
14537
|
+
const DialogHeader = (props) => (jsx$1("div", { className: "tw-w-full tw-justify-between", children: jsx$1("div", { ...props }) }));
|
|
14501
14538
|
DialogHeader.displayName = 'DialogHeader';
|
|
14502
14539
|
const DialogFooter = (props) => jsx$1("div", { ...props });
|
|
14503
14540
|
DialogFooter.displayName = 'DialogFooter';
|
|
@@ -14535,31 +14572,31 @@ const Modal = ({ titleIcon, title = 'Modal title example', titleSuffixLabel, sub
|
|
|
14535
14572
|
let titleIconElement = jsx$1(Fragment, {});
|
|
14536
14573
|
if (titleIcon) {
|
|
14537
14574
|
if (typeof titleIcon === 'string') {
|
|
14538
|
-
titleIconElement = (jsx$1(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw
|
|
14575
|
+
titleIconElement = (jsx$1(Icon, { icon: titleIcon, testId: "modalTitleIcon", extraClassNames: "tw-flex tw-text-xl tw-mt-1" }));
|
|
14539
14576
|
}
|
|
14540
14577
|
else {
|
|
14541
|
-
titleIconElement = jsx$1("div", { className: "tw
|
|
14578
|
+
titleIconElement = jsx$1("div", { className: "tw-mt-1.5", children: titleIcon });
|
|
14542
14579
|
}
|
|
14543
14580
|
}
|
|
14544
|
-
return (jsxs(Fragment, { children: [titleIcon && titleIconPosition === 'left' ? jsx$1("div", { className: "tw
|
|
14581
|
+
return (jsxs(Fragment, { children: [titleIcon && titleIconPosition === 'left' ? jsx$1("div", { className: "tw-flex tw-mr-2", children: titleIconElement }) : jsx$1(Fragment, {}), jsx$1(DialogTitle, { asChild: true, children: isTitleEditable ? (jsxs("div", { className: "tw-flex tw-w-full tw-items-center", children: [jsx$1(TextField, { extraClassNames: inputExtraClassNames, value: title, type: "text", testId: "modalTitle", onChange: onTitleChanged, placeholder: titlePlaceholder, required: titleRequired, showError: !!titleError }), titleError && jsx$1("p", { className: "tw-text-sq-danger-color tw-min-w-fit tw-pl-2 tw-mb-0", children: titleError })] })) : (customHeader ?? (jsxs("div", { "data-testid": "modalTitle", className: "modal-title", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx$1("h3", { children: title }), titleSuffixLabel && jsx$1("span", { className: "tw-text-xl tw-pl-0.5", children: titleSuffixLabel })] }), subtitle && (jsx$1("div", { className: "tw-italic tw-text-sm tw-text-left tw-mt-1", "data-testid": "modal-subtitle", children: subtitle }))] }))) }), titleIcon && titleIconPosition === 'right' ? jsx$1("div", { className: "tw-flex tw-ml-4", children: titleIconElement }) : jsx$1(Fragment, {})] }));
|
|
14545
14582
|
};
|
|
14546
|
-
return open ? (jsx$1(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: jsxs(DialogContent, { onPointerDownOutside: (e) => (onPointerDownOutside ? onPointerDownOutside(e) : e.preventDefault()), onInteractOutside: (e) => (onInteractOutside ? onInteractOutside(e) : e.preventDefault()), "data-testid": testId, className: classNames(`modalContent tw
|
|
14547
|
-
'tw
|
|
14548
|
-
'tw
|
|
14549
|
-
'tw
|
|
14550
|
-
'tw
|
|
14551
|
-
'tw
|
|
14552
|
-
'tw
|
|
14553
|
-
'tw
|
|
14554
|
-
'tw
|
|
14555
|
-
'tw
|
|
14556
|
-
'tw
|
|
14557
|
-
}, dialogClassName), children: [jsxs(DialogHeader, { className: "modal-header tw
|
|
14583
|
+
return open ? (jsx$1(Dialog, { open: true, onOpenChange: onClose, modal: keepFocusInsideModal, children: 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`, {
|
|
14584
|
+
'tw-max-w-xs': size === 'xs',
|
|
14585
|
+
'tw-max-w-sm': size === 'sm',
|
|
14586
|
+
'tw-max-w-md': size === 'md',
|
|
14587
|
+
'tw-max-w-lg': size === 'lg',
|
|
14588
|
+
'tw-max-w-xl': size === 'xl',
|
|
14589
|
+
'tw-max-w-2xl': size === '2xl',
|
|
14590
|
+
'tw-max-w-3xl': size === '3xl',
|
|
14591
|
+
'tw-max-w-4xl': size === '4xl',
|
|
14592
|
+
'tw-max-w-5xl': size === '5xl',
|
|
14593
|
+
'tw-max-w-6xl': size === '6xl',
|
|
14594
|
+
}, dialogClassName), children: [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: [jsx$1("div", { className: "tw-flex tw-w-full", children: renderTitle() }), !hideCloseIcon && (jsx$1(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: jsx$1("span", { className: "tw-cursor-pointer", children: "\u00D7" }) }))] }), jsx$1(DialogDescription, { className: "modal-body tw-px-6 tw-py-4 tw-overflow-y-auto", asChild: true, children: children }), !hideFooterButtons && (jsx$1(DialogFooter, { className: "modal-footer tw-px-6 tw-py-4", children: modalFooter ?? (jsxs("div", { className: "tw-flex tw-w-full tw-justify-between", "data-testid": "modalFooter", children: [jsx$1("div", { className: "tw-flex tw-justify-start", children: customButton && (jsx$1(Button, { label: customButtonLabel, onClick: onClickCustomButton, disabled: disableCustomButton, extraClassNames: "tw-justify-start tw-min-w-[100px]", testId: "customButton", variant: customButtonVariant })) }), jsxs("div", { className: "tw-flex tw-justify-end", children: [jsx$1("div", { className: "tw-flex tw-items-center", children: middleFooterSection }), !hideCancelButton && (jsx$1(DialogClose, { asChild: true, children: jsx$1(Button, { label: cancelButtonLabel, extraClassNames: "tw-mr-5 tw-min-w-[100px]", tooltip: cancelButtonTooltip, variant: "outline", stopPropagation: false, testId: "cancelButton" }) })), !hideSubmitButton && (jsx$1(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]" }))] })] })) }))] }) })) : (jsx$1(Fragment, {}));
|
|
14558
14595
|
};
|
|
14559
14596
|
|
|
14560
14597
|
function createCollection(name) {
|
|
14561
14598
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
14562
|
-
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
14599
|
+
const [createCollectionContext, createCollectionScope] = createContextScope$1(PROVIDER_NAME);
|
|
14563
14600
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
14564
14601
|
PROVIDER_NAME,
|
|
14565
14602
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
@@ -14572,17 +14609,19 @@ function createCollection(name) {
|
|
|
14572
14609
|
};
|
|
14573
14610
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
14574
14611
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
14612
|
+
const CollectionSlotImpl = createSlot$1(COLLECTION_SLOT_NAME);
|
|
14575
14613
|
const CollectionSlot = React__default.forwardRef(
|
|
14576
14614
|
(props, forwardedRef) => {
|
|
14577
14615
|
const { scope, children } = props;
|
|
14578
14616
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14579
14617
|
const composedRefs = useComposedRefs$1(forwardedRef, context.collectionRef);
|
|
14580
|
-
return /* @__PURE__ */ jsx$1(
|
|
14618
|
+
return /* @__PURE__ */ jsx$1(CollectionSlotImpl, { ref: composedRefs, children });
|
|
14581
14619
|
}
|
|
14582
14620
|
);
|
|
14583
14621
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
14584
14622
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
14585
14623
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
14624
|
+
const CollectionItemSlotImpl = createSlot$1(ITEM_SLOT_NAME);
|
|
14586
14625
|
const CollectionItemSlot = React__default.forwardRef(
|
|
14587
14626
|
(props, forwardedRef) => {
|
|
14588
14627
|
const { scope, children, ...itemData } = props;
|
|
@@ -14593,7 +14632,7 @@ function createCollection(name) {
|
|
|
14593
14632
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
14594
14633
|
return () => void context.itemMap.delete(ref);
|
|
14595
14634
|
});
|
|
14596
|
-
return /* @__PURE__ */ jsx$1(
|
|
14635
|
+
return /* @__PURE__ */ jsx$1(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
14597
14636
|
}
|
|
14598
14637
|
);
|
|
14599
14638
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -14618,7 +14657,7 @@ function createCollection(name) {
|
|
|
14618
14657
|
];
|
|
14619
14658
|
}
|
|
14620
14659
|
|
|
14621
|
-
// packages/react/direction/src/
|
|
14660
|
+
// packages/react/direction/src/direction.tsx
|
|
14622
14661
|
var DirectionContext = React.createContext(void 0);
|
|
14623
14662
|
function useDirection(localDir) {
|
|
14624
14663
|
const globalDir = React.useContext(DirectionContext);
|
|
@@ -14629,7 +14668,7 @@ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
|
14629
14668
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
14630
14669
|
var GROUP_NAME$2 = "RovingFocusGroup";
|
|
14631
14670
|
var [Collection$3, useCollection$3, createCollectionScope$3] = createCollection(GROUP_NAME$2);
|
|
14632
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
14671
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope$1(
|
|
14633
14672
|
GROUP_NAME$2,
|
|
14634
14673
|
[createCollectionScope$3]
|
|
14635
14674
|
);
|
|
@@ -14656,10 +14695,11 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
14656
14695
|
const ref = React.useRef(null);
|
|
14657
14696
|
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
14658
14697
|
const direction = useDirection(dir);
|
|
14659
|
-
const [currentTabStopId
|
|
14698
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
14660
14699
|
prop: currentTabStopIdProp,
|
|
14661
|
-
defaultProp: defaultCurrentTabStopId,
|
|
14662
|
-
onChange: onCurrentTabStopIdChange
|
|
14700
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
14701
|
+
onChange: onCurrentTabStopIdChange,
|
|
14702
|
+
caller: GROUP_NAME$2
|
|
14663
14703
|
});
|
|
14664
14704
|
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
14665
14705
|
const handleEntryFocus = useCallbackRef$1(onEntryFocus);
|
|
@@ -14695,7 +14735,7 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
14695
14735
|
[]
|
|
14696
14736
|
),
|
|
14697
14737
|
children: /* @__PURE__ */ jsx$1(
|
|
14698
|
-
Primitive.div,
|
|
14738
|
+
Primitive$1.div,
|
|
14699
14739
|
{
|
|
14700
14740
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
14701
14741
|
"data-orientation": orientation,
|
|
@@ -14737,6 +14777,7 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14737
14777
|
focusable = true,
|
|
14738
14778
|
active = false,
|
|
14739
14779
|
tabStopId,
|
|
14780
|
+
children,
|
|
14740
14781
|
...itemProps
|
|
14741
14782
|
} = props;
|
|
14742
14783
|
const autoId = useId();
|
|
@@ -14744,7 +14785,7 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14744
14785
|
const context = useRovingFocusContext(ITEM_NAME$3, __scopeRovingFocusGroup);
|
|
14745
14786
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
14746
14787
|
const getItems = useCollection$3(__scopeRovingFocusGroup);
|
|
14747
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
14788
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
14748
14789
|
React.useEffect(() => {
|
|
14749
14790
|
if (focusable) {
|
|
14750
14791
|
onFocusableItemAdd();
|
|
@@ -14759,7 +14800,7 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14759
14800
|
focusable,
|
|
14760
14801
|
active,
|
|
14761
14802
|
children: /* @__PURE__ */ jsx$1(
|
|
14762
|
-
Primitive.span,
|
|
14803
|
+
Primitive$1.span,
|
|
14763
14804
|
{
|
|
14764
14805
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
14765
14806
|
"data-orientation": context.orientation,
|
|
@@ -14790,7 +14831,8 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14790
14831
|
}
|
|
14791
14832
|
setTimeout(() => focusFirst$1(candidateNodes));
|
|
14792
14833
|
}
|
|
14793
|
-
})
|
|
14834
|
+
}),
|
|
14835
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
14794
14836
|
}
|
|
14795
14837
|
)
|
|
14796
14838
|
}
|
|
@@ -14833,7 +14875,7 @@ var Root$3 = RovingFocusGroup;
|
|
|
14833
14875
|
var Item$1 = RovingFocusGroupItem;
|
|
14834
14876
|
|
|
14835
14877
|
var TABS_NAME = "Tabs";
|
|
14836
|
-
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
|
|
14878
|
+
var [createTabsContext, createTabsScope] = createContextScope$1(TABS_NAME, [
|
|
14837
14879
|
createRovingFocusGroupScope
|
|
14838
14880
|
]);
|
|
14839
14881
|
var useRovingFocusGroupScope$1 = createRovingFocusGroupScope();
|
|
@@ -14854,7 +14896,8 @@ var Tabs$1 = React.forwardRef(
|
|
|
14854
14896
|
const [value, setValue] = useControllableState({
|
|
14855
14897
|
prop: valueProp,
|
|
14856
14898
|
onChange: onValueChange,
|
|
14857
|
-
defaultProp: defaultValue
|
|
14899
|
+
defaultProp: defaultValue ?? "",
|
|
14900
|
+
caller: TABS_NAME
|
|
14858
14901
|
});
|
|
14859
14902
|
return /* @__PURE__ */ jsx$1(
|
|
14860
14903
|
TabsProvider,
|
|
@@ -14867,7 +14910,7 @@ var Tabs$1 = React.forwardRef(
|
|
|
14867
14910
|
dir: direction,
|
|
14868
14911
|
activationMode,
|
|
14869
14912
|
children: /* @__PURE__ */ jsx$1(
|
|
14870
|
-
Primitive.div,
|
|
14913
|
+
Primitive$1.div,
|
|
14871
14914
|
{
|
|
14872
14915
|
dir: direction,
|
|
14873
14916
|
"data-orientation": orientation,
|
|
@@ -14895,7 +14938,7 @@ var TabsList = React.forwardRef(
|
|
|
14895
14938
|
dir: context.dir,
|
|
14896
14939
|
loop,
|
|
14897
14940
|
children: /* @__PURE__ */ jsx$1(
|
|
14898
|
-
Primitive.div,
|
|
14941
|
+
Primitive$1.div,
|
|
14899
14942
|
{
|
|
14900
14943
|
role: "tablist",
|
|
14901
14944
|
"aria-orientation": context.orientation,
|
|
@@ -14925,7 +14968,7 @@ var TabsTrigger = React.forwardRef(
|
|
|
14925
14968
|
focusable: !disabled,
|
|
14926
14969
|
active: isSelected,
|
|
14927
14970
|
children: /* @__PURE__ */ jsx$1(
|
|
14928
|
-
Primitive.button,
|
|
14971
|
+
Primitive$1.button,
|
|
14929
14972
|
{
|
|
14930
14973
|
type: "button",
|
|
14931
14974
|
role: "tab",
|
|
@@ -14974,7 +15017,7 @@ var TabsContent = React.forwardRef(
|
|
|
14974
15017
|
return () => cancelAnimationFrame(rAF);
|
|
14975
15018
|
}, []);
|
|
14976
15019
|
return /* @__PURE__ */ jsx$1(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx$1(
|
|
14977
|
-
Primitive.div,
|
|
15020
|
+
Primitive$1.div,
|
|
14978
15021
|
{
|
|
14979
15022
|
"data-state": isSelected ? "active" : "inactive",
|
|
14980
15023
|
"data-orientation": context.orientation,
|
|
@@ -15012,15 +15055,15 @@ const Tabs = ({ tabs, defaultActiveTab, activeTab, onTabSelect, extraClassNames,
|
|
|
15012
15055
|
return;
|
|
15013
15056
|
onTabSelect && onTabSelect(tabId);
|
|
15014
15057
|
};
|
|
15015
|
-
return (jsxs(Root2$2, { className: `tw
|
|
15016
|
-
? 'tw
|
|
15017
|
-
: '
|
|
15018
|
-
? '
|
|
15019
|
-
: '
|
|
15058
|
+
return (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: [jsx$1(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) => (jsx$1(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
|
|
15059
|
+
? 'tw-border-b-sq-color-dark dark:tw-border-b-sq-color-dark tw-border-b-[3px]'
|
|
15060
|
+
: 'hover:tw-bg-sq-light-gray tw-border-b-[1px] hover:dark:tw-bg-gray-700'}`, "data-testid": tabsTestId, disabled: disabled, value: id, children: jsxs("span", { className: "tw-flex tw-items-center tw-overflow-hidden tw-pb-[3px]", children: [icon && (jsx$1(Icon, { icon: icon, testId: `${id}_tab-icon`, extraClassNames: "tw-text-[0.9375rem] tw-mr-[7px] tw-flex-shrink-0" })), jsx$1("span", { className: `tw-text-[0.875rem] tw-font-medium tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis ${activeTab === id
|
|
15061
|
+
? 'dark:tw-text-sq-dark-text tw-text-gray-500'
|
|
15062
|
+
: 'dark:tw-text-sq-color-dark-dark tw-text-sq-color-dark'} ${tabLabelExtraClassNames}`, children: label })] }) }, `${label}-${id}-${index}`))) }), tabs.map((tab, index) => (jsx$1(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`)))] }));
|
|
15020
15063
|
};
|
|
15021
15064
|
|
|
15022
15065
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
15023
|
-
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
15066
|
+
var [createCollapsibleContext, createCollapsibleScope] = createContextScope$1(COLLAPSIBLE_NAME);
|
|
15024
15067
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
15025
15068
|
var Collapsible = React.forwardRef(
|
|
15026
15069
|
(props, forwardedRef) => {
|
|
@@ -15032,10 +15075,11 @@ var Collapsible = React.forwardRef(
|
|
|
15032
15075
|
onOpenChange,
|
|
15033
15076
|
...collapsibleProps
|
|
15034
15077
|
} = props;
|
|
15035
|
-
const [open
|
|
15078
|
+
const [open, setOpen] = useControllableState({
|
|
15036
15079
|
prop: openProp,
|
|
15037
|
-
defaultProp: defaultOpen,
|
|
15038
|
-
onChange: onOpenChange
|
|
15080
|
+
defaultProp: defaultOpen ?? false,
|
|
15081
|
+
onChange: onOpenChange,
|
|
15082
|
+
caller: COLLAPSIBLE_NAME
|
|
15039
15083
|
});
|
|
15040
15084
|
return /* @__PURE__ */ jsx$1(
|
|
15041
15085
|
CollapsibleProvider,
|
|
@@ -15046,7 +15090,7 @@ var Collapsible = React.forwardRef(
|
|
|
15046
15090
|
open,
|
|
15047
15091
|
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
15048
15092
|
children: /* @__PURE__ */ jsx$1(
|
|
15049
|
-
Primitive.div,
|
|
15093
|
+
Primitive$1.div,
|
|
15050
15094
|
{
|
|
15051
15095
|
"data-state": getState$1(open),
|
|
15052
15096
|
"data-disabled": disabled ? "" : void 0,
|
|
@@ -15065,7 +15109,7 @@ var CollapsibleTrigger = React.forwardRef(
|
|
|
15065
15109
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
15066
15110
|
const context = useCollapsibleContext(TRIGGER_NAME$2, __scopeCollapsible);
|
|
15067
15111
|
return /* @__PURE__ */ jsx$1(
|
|
15068
|
-
Primitive.button,
|
|
15112
|
+
Primitive$1.button,
|
|
15069
15113
|
{
|
|
15070
15114
|
type: "button",
|
|
15071
15115
|
"aria-controls": context.contentId,
|
|
@@ -15127,7 +15171,7 @@ var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
15127
15171
|
}
|
|
15128
15172
|
}, [context.open, present]);
|
|
15129
15173
|
return /* @__PURE__ */ jsx$1(
|
|
15130
|
-
Primitive.div,
|
|
15174
|
+
Primitive$1.div,
|
|
15131
15175
|
{
|
|
15132
15176
|
"data-state": getState$1(context.open),
|
|
15133
15177
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -15154,7 +15198,7 @@ var Content = CollapsibleContent;
|
|
|
15154
15198
|
var ACCORDION_NAME = "Accordion";
|
|
15155
15199
|
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
15156
15200
|
var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(ACCORDION_NAME);
|
|
15157
|
-
var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [
|
|
15201
|
+
var [createAccordionContext, createAccordionScope] = createContextScope$1(ACCORDION_NAME, [
|
|
15158
15202
|
createCollectionScope$2,
|
|
15159
15203
|
createCollapsibleScope
|
|
15160
15204
|
]);
|
|
@@ -15185,14 +15229,15 @@ var AccordionImplSingle = React__default.forwardRef(
|
|
|
15185
15229
|
} = props;
|
|
15186
15230
|
const [value, setValue] = useControllableState({
|
|
15187
15231
|
prop: valueProp,
|
|
15188
|
-
defaultProp: defaultValue,
|
|
15189
|
-
onChange: onValueChange
|
|
15232
|
+
defaultProp: defaultValue ?? "",
|
|
15233
|
+
onChange: onValueChange,
|
|
15234
|
+
caller: ACCORDION_NAME
|
|
15190
15235
|
});
|
|
15191
15236
|
return /* @__PURE__ */ jsx$1(
|
|
15192
15237
|
AccordionValueProvider,
|
|
15193
15238
|
{
|
|
15194
15239
|
scope: props.__scopeAccordion,
|
|
15195
|
-
value: value ? [value] : [],
|
|
15240
|
+
value: React__default.useMemo(() => value ? [value] : [], [value]),
|
|
15196
15241
|
onItemOpen: setValue,
|
|
15197
15242
|
onItemClose: React__default.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
15198
15243
|
children: /* @__PURE__ */ jsx$1(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx$1(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
@@ -15208,10 +15253,11 @@ var AccordionImplMultiple = React__default.forwardRef((props, forwardedRef) => {
|
|
|
15208
15253
|
},
|
|
15209
15254
|
...accordionMultipleProps
|
|
15210
15255
|
} = props;
|
|
15211
|
-
const [value
|
|
15256
|
+
const [value, setValue] = useControllableState({
|
|
15212
15257
|
prop: valueProp,
|
|
15213
|
-
defaultProp: defaultValue,
|
|
15214
|
-
onChange: onValueChange
|
|
15258
|
+
defaultProp: defaultValue ?? [],
|
|
15259
|
+
onChange: onValueChange,
|
|
15260
|
+
caller: ACCORDION_NAME
|
|
15215
15261
|
});
|
|
15216
15262
|
const handleItemOpen = React__default.useCallback(
|
|
15217
15263
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
@@ -15311,7 +15357,7 @@ var AccordionImpl = React__default.forwardRef(
|
|
|
15311
15357
|
direction: dir,
|
|
15312
15358
|
orientation,
|
|
15313
15359
|
children: /* @__PURE__ */ jsx$1(Collection$2.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx$1(
|
|
15314
|
-
Primitive.div,
|
|
15360
|
+
Primitive$1.div,
|
|
15315
15361
|
{
|
|
15316
15362
|
...accordionProps,
|
|
15317
15363
|
"data-orientation": orientation,
|
|
@@ -15372,7 +15418,7 @@ var AccordionHeader = React__default.forwardRef(
|
|
|
15372
15418
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
15373
15419
|
const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
|
|
15374
15420
|
return /* @__PURE__ */ jsx$1(
|
|
15375
|
-
Primitive.h3,
|
|
15421
|
+
Primitive$1.h3,
|
|
15376
15422
|
{
|
|
15377
15423
|
"data-orientation": accordionContext.orientation,
|
|
15378
15424
|
"data-state": getState(itemContext.open),
|
|
@@ -15441,18 +15487,18 @@ var Trigger2 = AccordionTrigger;
|
|
|
15441
15487
|
var Content2$2 = AccordionContent;
|
|
15442
15488
|
|
|
15443
15489
|
const Accordion = ({ accordionItems, defaultValue, value, onItemSelect, disabled, extraClassNames, testId, }) => {
|
|
15444
|
-
return (jsx$1(Root2$1, { className: `tw
|
|
15490
|
+
return (jsx$1(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) => (jsxs(Item, { className: `tw-bg-transparent tw-p-0 tw-flex tw-flex-col tw-w-full`, disabled: disabled, value: item.value, children: [jsx$1(Trigger2, { disabled: disabled, className: `tw-w-full tw-cursor-default focus-visible:tw-outline-none`, children: item.trigger }), jsx$1(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))) }));
|
|
15445
15491
|
};
|
|
15446
15492
|
|
|
15447
|
-
const bgStyles$2 = ['tw
|
|
15493
|
+
const bgStyles$2 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
15448
15494
|
const borderStyles$2 = [
|
|
15449
|
-
'tw
|
|
15450
|
-
'tw
|
|
15451
|
-
'tw
|
|
15452
|
-
'tw
|
|
15453
|
-
'
|
|
15495
|
+
'tw-border-solid',
|
|
15496
|
+
'tw-border',
|
|
15497
|
+
'tw-rounded-popover',
|
|
15498
|
+
'tw-border-sq-disabled-gray',
|
|
15499
|
+
'dark:tw-border-gray-500',
|
|
15454
15500
|
].join(' ');
|
|
15455
|
-
const disabledClasses$2 = ['tw
|
|
15501
|
+
const disabledClasses$2 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
15456
15502
|
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 }) => {
|
|
15457
15503
|
const tooltipData = getQTipData(tooltipProps);
|
|
15458
15504
|
const timeout = useRef(null);
|
|
@@ -15483,12 +15529,12 @@ const ButtonWithPopover = ({ children, trigger, id, hasArrow, extraTriggerClassN
|
|
|
15483
15529
|
};
|
|
15484
15530
|
React.useEffect(() => clearHoverTimeout, []);
|
|
15485
15531
|
const renderContent = () => {
|
|
15486
|
-
return (jsx$1(Content2$3, { sideOffset: placementOffset, align: align, side: placement, onInteractOutside: onInteractOutside, onPointerDownOutside: onPointerDownOutside, alignOffset: isHoverEnabled ? -10 : alignOffset, asChild: true, onClick: () => isCloseOnContentClick && onOpenChange && onOpenChange(false), className: "
|
|
15487
|
-
|
|
15488
|
-
${extraPopoverClassNames || ''}`, children: [hasArrow && (jsx$1(Arrow2$2, { asChild: true, children: jsx$1("div", { className: "tw
|
|
15532
|
+
return (jsx$1(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: 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
|
|
15533
|
+
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
|
|
15534
|
+
${extraPopoverClassNames || ''}`, children: [hasArrow && (jsx$1(Arrow2$2, { asChild: true, children: jsx$1("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] }) }));
|
|
15489
15535
|
};
|
|
15490
15536
|
const renderPopover = (popoverOpenState) => {
|
|
15491
|
-
return (jsxs(Root2$3, { open: popoverOpenState, defaultOpen: false, onOpenChange: onOpenChange, children: [trigger ? (jsx$1(Trigger$3, { id: id, asChild: isTriggerAsChild, className: `
|
|
15537
|
+
return (jsxs(Root2$3, { open: popoverOpenState, defaultOpen: false, onOpenChange: onOpenChange, children: [trigger ? (jsx$1(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: jsx$1("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 }) })) : (jsx$1(Trigger$3, { asChild: true, children: jsx$1("div", {}) })), isPortal ? jsx$1(Portal$2, { children: renderContent() }) : renderContent()] }));
|
|
15492
15538
|
};
|
|
15493
15539
|
return isHoverEnabled ? renderPopover(isHoveredOpen) : renderPopover(isOpen);
|
|
15494
15540
|
};
|
|
@@ -15507,7 +15553,7 @@ var SUB_CLOSE_KEYS = {
|
|
|
15507
15553
|
};
|
|
15508
15554
|
var MENU_NAME = "Menu";
|
|
15509
15555
|
var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(MENU_NAME);
|
|
15510
|
-
var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
|
|
15556
|
+
var [createMenuContext, createMenuScope] = createContextScope$1(MENU_NAME, [
|
|
15511
15557
|
createCollectionScope$1,
|
|
15512
15558
|
createPopperScope,
|
|
15513
15559
|
createRovingFocusGroupScope
|
|
@@ -15631,6 +15677,7 @@ var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
|
15631
15677
|
}
|
|
15632
15678
|
);
|
|
15633
15679
|
});
|
|
15680
|
+
var Slot = createSlot$1("MenuContent.ScrollLock");
|
|
15634
15681
|
var MenuContentImpl = React.forwardRef(
|
|
15635
15682
|
(props, forwardedRef) => {
|
|
15636
15683
|
const {
|
|
@@ -15818,7 +15865,7 @@ var GROUP_NAME$1 = "MenuGroup";
|
|
|
15818
15865
|
var MenuGroup = React.forwardRef(
|
|
15819
15866
|
(props, forwardedRef) => {
|
|
15820
15867
|
const { __scopeMenu, ...groupProps } = props;
|
|
15821
|
-
return /* @__PURE__ */ jsx$1(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
15868
|
+
return /* @__PURE__ */ jsx$1(Primitive$1.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
15822
15869
|
}
|
|
15823
15870
|
);
|
|
15824
15871
|
MenuGroup.displayName = GROUP_NAME$1;
|
|
@@ -15826,7 +15873,7 @@ var LABEL_NAME$1 = "MenuLabel";
|
|
|
15826
15873
|
var MenuLabel = React.forwardRef(
|
|
15827
15874
|
(props, forwardedRef) => {
|
|
15828
15875
|
const { __scopeMenu, ...labelProps } = props;
|
|
15829
|
-
return /* @__PURE__ */ jsx$1(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
15876
|
+
return /* @__PURE__ */ jsx$1(Primitive$1.div, { ...labelProps, ref: forwardedRef });
|
|
15830
15877
|
}
|
|
15831
15878
|
);
|
|
15832
15879
|
MenuLabel.displayName = LABEL_NAME$1;
|
|
@@ -15902,7 +15949,7 @@ var MenuItemImpl = React.forwardRef(
|
|
|
15902
15949
|
disabled,
|
|
15903
15950
|
textValue: textValue ?? textContent,
|
|
15904
15951
|
children: /* @__PURE__ */ jsx$1(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx$1(
|
|
15905
|
-
Primitive.div,
|
|
15952
|
+
Primitive$1.div,
|
|
15906
15953
|
{
|
|
15907
15954
|
role: "menuitem",
|
|
15908
15955
|
"data-highlighted": isFocused ? "" : void 0,
|
|
@@ -16010,7 +16057,7 @@ var MenuItemIndicator = React.forwardRef(
|
|
|
16010
16057
|
{
|
|
16011
16058
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
16012
16059
|
children: /* @__PURE__ */ jsx$1(
|
|
16013
|
-
Primitive.span,
|
|
16060
|
+
Primitive$1.span,
|
|
16014
16061
|
{
|
|
16015
16062
|
...itemIndicatorProps,
|
|
16016
16063
|
ref: forwardedRef,
|
|
@@ -16027,7 +16074,7 @@ var MenuSeparator = React.forwardRef(
|
|
|
16027
16074
|
(props, forwardedRef) => {
|
|
16028
16075
|
const { __scopeMenu, ...separatorProps } = props;
|
|
16029
16076
|
return /* @__PURE__ */ jsx$1(
|
|
16030
|
-
Primitive.div,
|
|
16077
|
+
Primitive$1.div,
|
|
16031
16078
|
{
|
|
16032
16079
|
role: "separator",
|
|
16033
16080
|
"aria-orientation": "horizontal",
|
|
@@ -16268,10 +16315,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
16268
16315
|
const { x, y } = point;
|
|
16269
16316
|
let inside = false;
|
|
16270
16317
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
16271
|
-
const
|
|
16272
|
-
const
|
|
16273
|
-
const
|
|
16274
|
-
const
|
|
16318
|
+
const ii = polygon[i];
|
|
16319
|
+
const jj = polygon[j];
|
|
16320
|
+
const xi = ii.x;
|
|
16321
|
+
const yi = ii.y;
|
|
16322
|
+
const xj = jj.x;
|
|
16323
|
+
const yj = jj.y;
|
|
16275
16324
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
16276
16325
|
if (intersect) inside = !inside;
|
|
16277
16326
|
}
|
|
@@ -16303,7 +16352,7 @@ var SubTrigger = MenuSubTrigger;
|
|
|
16303
16352
|
var SubContent = MenuSubContent;
|
|
16304
16353
|
|
|
16305
16354
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
16306
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
16355
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope$1(
|
|
16307
16356
|
DROPDOWN_MENU_NAME,
|
|
16308
16357
|
[createMenuScope]
|
|
16309
16358
|
);
|
|
@@ -16321,10 +16370,11 @@ var DropdownMenu = (props) => {
|
|
|
16321
16370
|
} = props;
|
|
16322
16371
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16323
16372
|
const triggerRef = React.useRef(null);
|
|
16324
|
-
const [open
|
|
16373
|
+
const [open, setOpen] = useControllableState({
|
|
16325
16374
|
prop: openProp,
|
|
16326
|
-
defaultProp: defaultOpen,
|
|
16327
|
-
onChange: onOpenChange
|
|
16375
|
+
defaultProp: defaultOpen ?? false,
|
|
16376
|
+
onChange: onOpenChange,
|
|
16377
|
+
caller: DROPDOWN_MENU_NAME
|
|
16328
16378
|
});
|
|
16329
16379
|
return /* @__PURE__ */ jsx$1(
|
|
16330
16380
|
DropdownMenuProvider,
|
|
@@ -16349,7 +16399,7 @@ var DropdownMenuTrigger = React.forwardRef(
|
|
|
16349
16399
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
16350
16400
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16351
16401
|
return /* @__PURE__ */ jsx$1(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx$1(
|
|
16352
|
-
Primitive.button,
|
|
16402
|
+
Primitive$1.button,
|
|
16353
16403
|
{
|
|
16354
16404
|
type: "button",
|
|
16355
16405
|
id: context.triggerId,
|
|
@@ -16501,10 +16551,11 @@ DropdownMenuArrow.displayName = ARROW_NAME;
|
|
|
16501
16551
|
var DropdownMenuSub = (props) => {
|
|
16502
16552
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
16503
16553
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16504
|
-
const [open
|
|
16554
|
+
const [open, setOpen] = useControllableState({
|
|
16505
16555
|
prop: openProp,
|
|
16506
|
-
defaultProp: defaultOpen,
|
|
16507
|
-
onChange: onOpenChange
|
|
16556
|
+
defaultProp: defaultOpen ?? false,
|
|
16557
|
+
onChange: onOpenChange,
|
|
16558
|
+
caller: "DropdownMenuSub"
|
|
16508
16559
|
});
|
|
16509
16560
|
return /* @__PURE__ */ jsx$1(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
16510
16561
|
};
|
|
@@ -16553,65 +16604,65 @@ var SubTrigger2 = DropdownMenuSubTrigger;
|
|
|
16553
16604
|
var SubContent2 = DropdownMenuSubContent;
|
|
16554
16605
|
|
|
16555
16606
|
const borderStyles$1 = [
|
|
16556
|
-
'tw
|
|
16557
|
-
'tw
|
|
16558
|
-
'tw
|
|
16559
|
-
'tw
|
|
16560
|
-
'
|
|
16607
|
+
'tw-border-solid',
|
|
16608
|
+
'tw-border',
|
|
16609
|
+
'tw-rounded-popover',
|
|
16610
|
+
'tw-border-sq-disabled-gray',
|
|
16611
|
+
'dark:tw-border-gray-500',
|
|
16561
16612
|
].join(' ');
|
|
16562
|
-
const bgStyles$1 = ['tw
|
|
16563
|
-
const disabledClasses$1 = ['tw
|
|
16613
|
+
const bgStyles$1 = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
16614
|
+
const disabledClasses$1 = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
16564
16615
|
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 }) => {
|
|
16565
16616
|
const tooltipData = getQTipData(tooltipProps);
|
|
16566
|
-
return (jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsx$1(Trigger, { id: id, className: `tw
|
|
16617
|
+
return (jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsx$1(Trigger, { id: id, className: `tw-border-none focus-visible:tw-outline-none focus:tw-outline-none focus-within:tw-outline-none`, disabled: disabled, children: jsx$1("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 }) }), jsx$1(Portal2, { children: jsx$1(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: 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 && (jsx$1(Arrow2, { asChild: true, children: jsx$1("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) => {
|
|
16567
16618
|
const tooltipData = getQTipData(item);
|
|
16568
16619
|
if (item.isLabel) {
|
|
16569
|
-
return (jsxs(Label2, { className: item.itemExtraClassNames, ...tooltipData, children: [item.icon && (jsx$1(Icon, { icon: item.icon, testId: item.iconTestId, type: "text", color: item.iconColor, extraClassNames: "tw
|
|
16620
|
+
return (jsxs(Label2, { className: item.itemExtraClassNames, ...tooltipData, children: [item.icon && (jsx$1(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]" })), jsx$1("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));
|
|
16570
16621
|
}
|
|
16571
16622
|
if (Array.isArray(item.subMenuItems) && item.subMenuItems.length > 0) {
|
|
16572
|
-
return (jsxs(Sub2, { children: [jsxs(SubTrigger2, { id: id, className: `tw
|
|
16573
|
-
? 'tw
|
|
16574
|
-
: 'tw
|
|
16575
|
-
return (jsxs(Item2, { onSelect: subItem.onClick, "data-qtip-text": subItem.tooltip, className: "tw
|
|
16576
|
-
? 'tw
|
|
16577
|
-
: 'tw
|
|
16623
|
+
return (jsxs(Sub2, { children: [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: [jsxs("div", { className: "tw-flex", children: [item.icon && (jsx$1(Icon, { icon: item.icon, extraClassNames: `tw-w-[18px] ${item.disabled
|
|
16624
|
+
? '!tw-text-sq-disabled-gray'
|
|
16625
|
+
: 'tw-text-sq-text-color dark:tw-text-sq-white'} ${item.iconExtraClassNames || ''}` })), jsx$1("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 })] }), jsx$1(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` })] }), jsx$1(Portal2, { children: jsx$1(SubContent2, { className: "focus-visible:tw-outline-none tw-outline-none", children: jsx$1("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) => {
|
|
16626
|
+
return (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 && (jsx$1(Icon, { icon: subItem.iconClass, type: "text", extraClassNames: `tw-w-[18px] ${item.disabled && '!tw-opacity-30'}` })), jsx$1("div", { className: `tw-text-[0.8125rem] tw-ml-1 ${subItem.disabled
|
|
16627
|
+
? 'tw-text-sq-disabled-gray'
|
|
16628
|
+
: 'tw-text-sq-text-color dark:tw-text-sq-white'} tw-not-italic tw-font-normal ${item.labelClasses}`, children: subItem.label })] }, subItem.label + subIndex));
|
|
16578
16629
|
}) }) }) })] }, (item.id || item.icon || '') + index));
|
|
16579
16630
|
}
|
|
16580
16631
|
return (jsxs("div", { ...tooltipData, children: [jsxs(Item2, { "data-customid": item.itemCustomId, onSelect: (e) => {
|
|
16581
16632
|
item.onClick(e);
|
|
16582
|
-
}, className: `tw
|
|
16633
|
+
}, 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 && (jsx$1(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 || ''}` })), jsx$1("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 && (jsx$1(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));
|
|
16583
16634
|
})] }) }) })] }));
|
|
16584
16635
|
};
|
|
16585
16636
|
|
|
16586
|
-
const baseClasses$2 = 'tw
|
|
16587
|
-
' tw
|
|
16588
|
-
const darkTheme$1 = '
|
|
16589
|
-
const lightTheme$1 = 'tw
|
|
16590
|
-
const errorClasses$1 = 'tw
|
|
16591
|
-
const borderColorClasses$1 = 'tw
|
|
16637
|
+
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' +
|
|
16638
|
+
' tw-border-solid tw-border tw-text-sm tw-flex tw-flex-col tw-justify-center tw-items-center';
|
|
16639
|
+
const darkTheme$1 = 'dark:tw-bg-sq-colored-hover-dark dark:tw-text-sq-dark-text';
|
|
16640
|
+
const lightTheme$1 = 'tw-text-sq-text-color tw-bg-sq-colored-hover';
|
|
16641
|
+
const errorClasses$1 = 'tw-border-sq-danger-color';
|
|
16642
|
+
const borderColorClasses$1 = 'tw-border-sq-color-dark';
|
|
16592
16643
|
/**
|
|
16593
16644
|
* Alert.
|
|
16594
16645
|
*/
|
|
16595
16646
|
const Alert = ({ children, dismissible = true, onClose, show = true, variant, testId = 'alert-id', id, extraClassNames, ...tooltipProps }) => {
|
|
16596
16647
|
const appliedTheme = {
|
|
16597
16648
|
theme: `${lightTheme$1} ${darkTheme$1}`,
|
|
16598
|
-
formulaError: 'tw
|
|
16599
|
-
danger: 'tw
|
|
16600
|
-
warning: 'tw
|
|
16601
|
-
gray: 'tw
|
|
16649
|
+
formulaError: 'tw-text-red-800 tw-bg-red-200 !tw-rounded-[4px]',
|
|
16650
|
+
danger: 'tw-text-sq-text-color tw-bg-sq-danger-color',
|
|
16651
|
+
warning: 'tw-bg-sq-bg-warning-color tw-text-sq-text-color',
|
|
16652
|
+
gray: 'tw-bg-sq-light-gray tw-text-sq-text-color dark:tw-bg-sq-worksheetspanel-gray-dark dark:tw-text-sq-dark-text',
|
|
16602
16653
|
};
|
|
16603
16654
|
const appliedBorderTheme = {
|
|
16604
16655
|
theme: borderColorClasses$1,
|
|
16605
16656
|
danger: errorClasses$1,
|
|
16606
|
-
warning: 'tw
|
|
16607
|
-
gray: 'tw
|
|
16608
|
-
formulaError: 'tw
|
|
16657
|
+
warning: 'tw-border-none',
|
|
16658
|
+
gray: 'tw-border-sq-darkish-gray',
|
|
16659
|
+
formulaError: 'tw-border-red-100',
|
|
16609
16660
|
};
|
|
16610
16661
|
const appliedClasses = `${baseClasses$2} ${appliedTheme[variant]} ${extraClassNames} ${appliedBorderTheme[variant]}`;
|
|
16611
16662
|
if (!show) {
|
|
16612
16663
|
return jsx$1("div", {});
|
|
16613
16664
|
}
|
|
16614
|
-
return (jsxs("div", { "data-testid": testId, id: id, className: appliedClasses, children: [children, dismissible && (jsx$1(Icon, { icon: "fc-delete", type: variant.match(/danger|warning|formulaError/) ? 'color' : 'theme', color: variant.match(/danger|warning|formulaError/) ? 'inherit' : undefined, extraClassNames: `tw
|
|
16665
|
+
return (jsxs("div", { "data-testid": testId, id: id, className: appliedClasses, children: [children, dismissible && (jsx$1(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 }))] }));
|
|
16615
16666
|
};
|
|
16616
16667
|
|
|
16617
16668
|
/**
|
|
@@ -16630,40 +16681,47 @@ const Alert = ({ children, dismissible = true, onClose, show = true, variant, te
|
|
|
16630
16681
|
* @param tooltipProps - props to pass to the tooltip
|
|
16631
16682
|
*/
|
|
16632
16683
|
const SvgIcon = ({ onClick, icon, color, type = 'default', extraClassNames, viewBox = '0 0 19 19', id, testId, customId, ...tooltipProps }) => {
|
|
16633
|
-
const appliedClassNames = `${onClick ? 'tw
|
|
16634
|
-
tw
|
|
16684
|
+
const appliedClassNames = `${onClick ? 'tw-cursor-pointer' : ''} ${extraClassNames} focus:tw-outline-none focus-visible:tw-outline-none
|
|
16685
|
+
tw-outline-none`;
|
|
16635
16686
|
const tooltipData = getQTipData(tooltipProps);
|
|
16636
16687
|
const appliedType = type === 'default' ? 'currentColor' : 'rgb(var(--sq-icon))';
|
|
16637
|
-
return (jsx$1("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsx$1("svg", { xmlns: "http://www.w3.org/2000/svg", className: `tw
|
|
16688
|
+
return (jsx$1("div", { onClick: onClick, ...tooltipData, className: `svgContainer ${appliedClassNames}`, children: jsx$1("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: jsx$1("path", { d: getSvgIconPath(icon) }) }) }));
|
|
16638
16689
|
};
|
|
16639
16690
|
|
|
16640
16691
|
const SeeqActionDropdownItem = (item) => {
|
|
16641
16692
|
let renderIcon = jsx$1(Fragment, {});
|
|
16642
16693
|
if (item.icon) {
|
|
16643
|
-
renderIcon = isSvgIcon(item.icon) ? (jsx$1(SvgIcon, { icon: item.icon, extraClassNames:
|
|
16694
|
+
renderIcon = isSvgIcon(item.icon) ? (jsx$1(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' +
|
|
16695
|
+
' dark:tw-text-sq-white tw-text-[22px] tw-text-sq-white ' +
|
|
16696
|
+
item.iconExtraClassNames, ...item })) : (jsx$1(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 ' +
|
|
16697
|
+
item.iconExtraClassNames }));
|
|
16644
16698
|
}
|
|
16645
|
-
return (jsxs("div", { className: "tw
|
|
16699
|
+
return (jsxs("div", { className: "tw-flex-col tw-flex tw-p-[10px] tw-pl-5 tw-w-[600px]", children: [jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end", children: [renderIcon, jsx$1("h4", { className: "tw-text-base tw-font-[600] tw-leading-[20px] mb-0", children: item.display })] }), jsx$1("div", { className: "tw-text-[0.8125rem] tw-font-normal", children: item.text })] }));
|
|
16646
16700
|
};
|
|
16647
16701
|
const ViewWorkbench = (item) => {
|
|
16648
16702
|
let renderIcon = jsx$1(Fragment, {});
|
|
16649
16703
|
if (item.icon) {
|
|
16650
|
-
renderIcon = isSvgIcon(item.icon) ? (jsx$1(SvgIcon, { icon: item.icon, extraClassNames: 'tw
|
|
16704
|
+
renderIcon = isSvgIcon(item.icon) ? (jsx$1(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' +
|
|
16705
|
+
' tw-text-sq-text-color ' +
|
|
16706
|
+
item.iconExtraClassNames, type: "default", ...item })) : (jsx$1(Icon, { icon: item.icon, type: "text", extraClassNames: 'tw-flex tw-justify-center tw-items-center tw-text-[1.25rem] dark:tw-text-sq-white' +
|
|
16707
|
+
' tw-text-sq-text-color ' +
|
|
16708
|
+
item.iconExtraClassNames }));
|
|
16651
16709
|
}
|
|
16652
|
-
return (jsx$1("div", { className: "tw
|
|
16710
|
+
return (jsx$1("div", { className: "tw-flex-col tw-flex tw-p-[10px]", children: jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-end", children: [renderIcon, jsx$1("div", { className: "tw-text-[0.8125rem]", children: item.display })] }) }));
|
|
16653
16711
|
};
|
|
16654
16712
|
const InsertSeeqContent = (item) => {
|
|
16655
|
-
return (jsxs("div", { className: "tw
|
|
16713
|
+
return (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: [jsx$1("h5", { className: "tw-text-[1rem] tw-font-medium tw-text-sq-color-dark tw-leading-[18px]", children: item.display }), jsx$1("div", { className: "tw-text-[0.8125rem] tw-text-sq-text-color dark:tw-text-sq-dark-text !tw-mt-1", children: item.text })] }));
|
|
16656
16714
|
};
|
|
16657
16715
|
|
|
16658
16716
|
const borderStyles = [
|
|
16659
|
-
'tw
|
|
16660
|
-
'tw
|
|
16661
|
-
'tw
|
|
16662
|
-
'tw
|
|
16663
|
-
'
|
|
16717
|
+
'tw-border-solid',
|
|
16718
|
+
'tw-border',
|
|
16719
|
+
'tw-rounded-md',
|
|
16720
|
+
'tw-border-sq-disabled-gray',
|
|
16721
|
+
'dark:tw-border-gray-500',
|
|
16664
16722
|
].join(' ');
|
|
16665
|
-
const bgStyles = ['tw
|
|
16666
|
-
const disabledClasses = ['tw
|
|
16723
|
+
const bgStyles = ['tw-bg-sq-white', 'dark:tw-bg-sq-dark-background'].join(' ');
|
|
16724
|
+
const disabledClasses = ['tw-opacity-50', 'tw-cursor-not-allowed'].join(' ');
|
|
16667
16725
|
const renderItem = (variant, item) => {
|
|
16668
16726
|
switch (variant) {
|
|
16669
16727
|
case 'create-workbench':
|
|
@@ -16678,31 +16736,31 @@ const renderItem = (variant, item) => {
|
|
|
16678
16736
|
};
|
|
16679
16737
|
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 }) => {
|
|
16680
16738
|
const tooltipData = getQTipData(tooltipProps);
|
|
16681
|
-
return (jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsx$1(Trigger, { id: id, "data-testid": id, className: `tw
|
|
16682
|
-
' tw
|
|
16683
|
-
'
|
|
16684
|
-
' forceFont
|
|
16685
|
-
borderStyles, children: [hasArrow && (jsx$1(Arrow2, { asChild: true, children: jsx$1("div", { className: " tw
|
|
16739
|
+
return (jsxs(Root2, { defaultOpen: false, open: isOpen, onOpenChange: onOpenChange, modal: keepFocusInsideDropdown, children: [jsx$1(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: jsx$1("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 }) }), jsx$1(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: jsxs("div", { "data-testid": containerTestId, className: bgStyles +
|
|
16740
|
+
' tw-relative tw-z-[1200] tw-min-w-6 tw-py-2 focus-visible:tw-outline-none tw-outline-none' +
|
|
16741
|
+
' data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out' +
|
|
16742
|
+
' 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 ' +
|
|
16743
|
+
borderStyles, children: [hasArrow && (jsx$1(Arrow2, { asChild: true, children: jsx$1("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) => {
|
|
16686
16744
|
return (jsxs("div", { children: [jsx$1(Item2, { onSelect: (e) => {
|
|
16687
16745
|
item.action(e);
|
|
16688
|
-
}, className: `tw
|
|
16746
|
+
}, 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 && (jsx$1(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));
|
|
16689
16747
|
})] }) })] }));
|
|
16690
16748
|
};
|
|
16691
16749
|
|
|
16692
|
-
const baseClasses$1 = 'tw
|
|
16693
|
-
const errorClasses = 'tw
|
|
16750
|
+
const baseClasses$1 = 'tw-flex tw-outline-none tw-rounded-md tw-w-full tw-relative tw-flex-wrap';
|
|
16751
|
+
const errorClasses = 'tw-border-sq-danger-color';
|
|
16694
16752
|
const borderColorClasses = [
|
|
16695
|
-
'tw
|
|
16696
|
-
'
|
|
16697
|
-
'
|
|
16698
|
-
'
|
|
16699
|
-
'
|
|
16700
|
-
'
|
|
16753
|
+
'tw-border-sq-disabled-gray',
|
|
16754
|
+
'dark:tw-border-sq-dark-disabled-gray',
|
|
16755
|
+
'dark:focus:tw-border-sq-color-dark-dark',
|
|
16756
|
+
'dark:active:tw-border-sq-color-dark-dark',
|
|
16757
|
+
'focus:tw-border-sq-color-dark',
|
|
16758
|
+
'active:tw-border-sq-color-dark',
|
|
16701
16759
|
].join(' ');
|
|
16702
|
-
const fieldBorderRadius = 'tw
|
|
16703
|
-
const fieldClasses = 'tw
|
|
16704
|
-
const darkTheme = '
|
|
16705
|
-
const lightTheme = 'tw
|
|
16760
|
+
const fieldBorderRadius = 'tw-rounded-l-md tw-rounded-r-none';
|
|
16761
|
+
const fieldClasses = 'tw-leading-normal tw-outline-none tw-py-1 tw-px-3' + 'tw-p-1 tw-border-solid tw-border';
|
|
16762
|
+
const darkTheme = 'dark:tw-bg-sq-dark-background dark:tw-text-sq-dark-text disabled:dark:tw-text-sq-dark-text-lighter';
|
|
16763
|
+
const lightTheme = 'tw-text-sq-text-color disabled:tw-text-sq-darkish-gray';
|
|
16706
16764
|
/**
|
|
16707
16765
|
* InputGroup.
|
|
16708
16766
|
*/
|
|
@@ -16712,10 +16770,8 @@ const InputGroup = React__default.forwardRef((props, ref) => {
|
|
|
16712
16770
|
const appliedClasses = `${baseClasses$1} ${extraClassNames}`;
|
|
16713
16771
|
const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${fieldBorderRadius} ${showError ? errorClasses : borderColorClasses} `;
|
|
16714
16772
|
const elementsToAppend = append.filter(Boolean);
|
|
16715
|
-
return (jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsx$1("div", { "data-testid": testId, className: `tw
|
|
16716
|
-
return item?.variant === 'button' ? (jsx$1(Button, { extraClassNames: `$
|
|
16717
|
-
index ? 'tw:-ml-px' : 'tw:ml-0'
|
|
16718
|
-
} tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`, ...item.buttonProps }, index)) : (jsx$1("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));
|
|
16773
|
+
return (jsxs("div", { id: `input-group-${id}`, className: appliedClasses, children: [field ? (jsx$1("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}`, children: field })) : (jsx$1(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) => {
|
|
16774
|
+
return item?.variant === 'button' ? (jsx$1(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)) : (jsx$1("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));
|
|
16719
16775
|
})] }));
|
|
16720
16776
|
});
|
|
16721
16777
|
|
|
@@ -20610,7 +20666,7 @@ function PopChild({ children, isPresent, anchorX, root }) {
|
|
|
20610
20666
|
* styles directly on the DOM node, we might be overwriting
|
|
20611
20667
|
* styles set via the style prop.
|
|
20612
20668
|
*/
|
|
20613
|
-
useInsertionEffect$
|
|
20669
|
+
useInsertionEffect$2(() => {
|
|
20614
20670
|
const { width, height, top, left, right } = size.current;
|
|
20615
20671
|
if (isPresent || !ref.current || !width || !height)
|
|
20616
20672
|
return;
|
|
@@ -21800,7 +21856,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
21800
21856
|
createProjectionNode$1(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
|
|
21801
21857
|
}
|
|
21802
21858
|
const isMounted = useRef(false);
|
|
21803
|
-
useInsertionEffect$
|
|
21859
|
+
useInsertionEffect$2(() => {
|
|
21804
21860
|
/**
|
|
21805
21861
|
* Check the component has already mounted before calling
|
|
21806
21862
|
* `update` unnecessarily. This ensures we skip the initial update.
|
|
@@ -27045,7 +27101,7 @@ function clamp(value, [min, max]) {
|
|
|
27045
27101
|
return Math.min(max, Math.max(min, value));
|
|
27046
27102
|
}
|
|
27047
27103
|
|
|
27048
|
-
// packages/react/use-previous/src/
|
|
27104
|
+
// packages/react/use-previous/src/use-previous.tsx
|
|
27049
27105
|
function usePrevious(value) {
|
|
27050
27106
|
const ref = React.useRef({ value, previous: value });
|
|
27051
27107
|
return React.useMemo(() => {
|
|
@@ -27067,7 +27123,7 @@ var BACK_KEYS = {
|
|
|
27067
27123
|
};
|
|
27068
27124
|
var SLIDER_NAME = "Slider";
|
|
27069
27125
|
var [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);
|
|
27070
|
-
var [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [
|
|
27126
|
+
var [createSliderContext, createSliderScope] = createContextScope$1(SLIDER_NAME, [
|
|
27071
27127
|
createCollectionScope
|
|
27072
27128
|
]);
|
|
27073
27129
|
var [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);
|
|
@@ -27337,7 +27393,7 @@ var SliderImpl = React.forwardRef(
|
|
|
27337
27393
|
} = props;
|
|
27338
27394
|
const context = useSliderContext(SLIDER_NAME, __scopeSlider);
|
|
27339
27395
|
return /* @__PURE__ */ jsx$1(
|
|
27340
|
-
Primitive.span,
|
|
27396
|
+
Primitive$1.span,
|
|
27341
27397
|
{
|
|
27342
27398
|
...sliderProps,
|
|
27343
27399
|
ref: forwardedRef,
|
|
@@ -27384,7 +27440,7 @@ var SliderTrack = React.forwardRef(
|
|
|
27384
27440
|
const { __scopeSlider, ...trackProps } = props;
|
|
27385
27441
|
const context = useSliderContext(TRACK_NAME, __scopeSlider);
|
|
27386
27442
|
return /* @__PURE__ */ jsx$1(
|
|
27387
|
-
Primitive.span,
|
|
27443
|
+
Primitive$1.span,
|
|
27388
27444
|
{
|
|
27389
27445
|
"data-disabled": context.disabled ? "" : void 0,
|
|
27390
27446
|
"data-orientation": context.orientation,
|
|
@@ -27410,7 +27466,7 @@ var SliderRange = React.forwardRef(
|
|
|
27410
27466
|
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
|
|
27411
27467
|
const offsetEnd = 100 - Math.max(...percentages);
|
|
27412
27468
|
return /* @__PURE__ */ jsx$1(
|
|
27413
|
-
Primitive.span,
|
|
27469
|
+
Primitive$1.span,
|
|
27414
27470
|
{
|
|
27415
27471
|
"data-orientation": context.orientation,
|
|
27416
27472
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -27471,7 +27527,7 @@ var SliderThumbImpl = React.forwardRef(
|
|
|
27471
27527
|
},
|
|
27472
27528
|
children: [
|
|
27473
27529
|
/* @__PURE__ */ jsx$1(Collection.ItemSlot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx$1(
|
|
27474
|
-
Primitive.span,
|
|
27530
|
+
Primitive$1.span,
|
|
27475
27531
|
{
|
|
27476
27532
|
role: "slider",
|
|
27477
27533
|
"aria-label": props["aria-label"] || label,
|
|
@@ -27491,7 +27547,7 @@ var SliderThumbImpl = React.forwardRef(
|
|
|
27491
27547
|
}
|
|
27492
27548
|
) }),
|
|
27493
27549
|
isFormControl && /* @__PURE__ */ jsx$1(
|
|
27494
|
-
|
|
27550
|
+
SliderBubbleInput,
|
|
27495
27551
|
{
|
|
27496
27552
|
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
27497
27553
|
form: context.form,
|
|
@@ -27505,23 +27561,36 @@ var SliderThumbImpl = React.forwardRef(
|
|
|
27505
27561
|
}
|
|
27506
27562
|
);
|
|
27507
27563
|
SliderThumb.displayName = THUMB_NAME;
|
|
27508
|
-
var
|
|
27509
|
-
|
|
27510
|
-
|
|
27511
|
-
|
|
27512
|
-
|
|
27513
|
-
const
|
|
27514
|
-
|
|
27515
|
-
|
|
27516
|
-
|
|
27517
|
-
|
|
27518
|
-
const
|
|
27519
|
-
setValue.
|
|
27520
|
-
|
|
27521
|
-
|
|
27522
|
-
|
|
27523
|
-
|
|
27524
|
-
}
|
|
27564
|
+
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
|
27565
|
+
var SliderBubbleInput = React.forwardRef(
|
|
27566
|
+
({ __scopeSlider, value, ...props }, forwardedRef) => {
|
|
27567
|
+
const ref = React.useRef(null);
|
|
27568
|
+
const composedRefs = useComposedRefs$1(ref, forwardedRef);
|
|
27569
|
+
const prevValue = usePrevious(value);
|
|
27570
|
+
React.useEffect(() => {
|
|
27571
|
+
const input = ref.current;
|
|
27572
|
+
if (!input) return;
|
|
27573
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
27574
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
|
|
27575
|
+
const setValue = descriptor.set;
|
|
27576
|
+
if (prevValue !== value && setValue) {
|
|
27577
|
+
const event = new Event("input", { bubbles: true });
|
|
27578
|
+
setValue.call(input, value);
|
|
27579
|
+
input.dispatchEvent(event);
|
|
27580
|
+
}
|
|
27581
|
+
}, [prevValue, value]);
|
|
27582
|
+
return /* @__PURE__ */ jsx$1(
|
|
27583
|
+
Primitive$1.input,
|
|
27584
|
+
{
|
|
27585
|
+
style: { display: "none" },
|
|
27586
|
+
...props,
|
|
27587
|
+
ref: composedRefs,
|
|
27588
|
+
defaultValue: value
|
|
27589
|
+
}
|
|
27590
|
+
);
|
|
27591
|
+
}
|
|
27592
|
+
);
|
|
27593
|
+
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
27525
27594
|
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
27526
27595
|
const nextValues = [...prevValues];
|
|
27527
27596
|
nextValues[atIndex] = nextValue;
|
|
@@ -27589,9 +27658,201 @@ var Thumb = SliderThumb;
|
|
|
27589
27658
|
*/
|
|
27590
27659
|
const Slider = (props) => {
|
|
27591
27660
|
const { onValueChange, onPointerUp, id, value, name, disabled = false, rootExtraClassNames = '', trackExtraClassNames = '', rangeExtraClassNames = '', thumbExtraClassNames = '', step, min, max, } = props;
|
|
27592
|
-
return (jsxs(Root$1, { className: `tw
|
|
27661
|
+
return (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: [jsx$1(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: jsx$1(Range, { className: `tw-absolute tw-h-full tw-rounded-full ${rangeExtraClassNames}` }) }), jsx$1(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 })] }));
|
|
27593
27662
|
};
|
|
27594
27663
|
|
|
27664
|
+
// src/create-context.tsx
|
|
27665
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
27666
|
+
let defaultContexts = [];
|
|
27667
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
27668
|
+
const BaseContext = React.createContext(defaultContext);
|
|
27669
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
27670
|
+
const index = defaultContexts.length;
|
|
27671
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
27672
|
+
const Provider = (props) => {
|
|
27673
|
+
const { scope, children, ...context } = props;
|
|
27674
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
27675
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
27676
|
+
return /* @__PURE__ */ jsx$1(Context.Provider, { value, children });
|
|
27677
|
+
};
|
|
27678
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
27679
|
+
function useContext2(consumerName, scope) {
|
|
27680
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
27681
|
+
const context = React.useContext(Context);
|
|
27682
|
+
if (context) return context;
|
|
27683
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
27684
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
27685
|
+
}
|
|
27686
|
+
return [Provider, useContext2];
|
|
27687
|
+
}
|
|
27688
|
+
const createScope = () => {
|
|
27689
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
27690
|
+
return React.createContext(defaultContext);
|
|
27691
|
+
});
|
|
27692
|
+
return function useScope(scope) {
|
|
27693
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
27694
|
+
return React.useMemo(
|
|
27695
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
27696
|
+
[scope, contexts]
|
|
27697
|
+
);
|
|
27698
|
+
};
|
|
27699
|
+
};
|
|
27700
|
+
createScope.scopeName = scopeName;
|
|
27701
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
27702
|
+
}
|
|
27703
|
+
function composeContextScopes(...scopes) {
|
|
27704
|
+
const baseScope = scopes[0];
|
|
27705
|
+
if (scopes.length === 1) return baseScope;
|
|
27706
|
+
const createScope = () => {
|
|
27707
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
27708
|
+
useScope: createScope2(),
|
|
27709
|
+
scopeName: createScope2.scopeName
|
|
27710
|
+
}));
|
|
27711
|
+
return function useComposedScopes(overrideScopes) {
|
|
27712
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
27713
|
+
const scopeProps = useScope(overrideScopes);
|
|
27714
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
27715
|
+
return { ...nextScopes2, ...currentScope };
|
|
27716
|
+
}, {});
|
|
27717
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
27718
|
+
};
|
|
27719
|
+
};
|
|
27720
|
+
createScope.scopeName = baseScope.scopeName;
|
|
27721
|
+
return createScope;
|
|
27722
|
+
}
|
|
27723
|
+
|
|
27724
|
+
// src/slot.tsx
|
|
27725
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
27726
|
+
var use = React[" use ".trim().toString()];
|
|
27727
|
+
function isPromiseLike(value) {
|
|
27728
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
27729
|
+
}
|
|
27730
|
+
function isLazyComponent(element) {
|
|
27731
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
27732
|
+
}
|
|
27733
|
+
// @__NO_SIDE_EFFECTS__
|
|
27734
|
+
function createSlot(ownerName) {
|
|
27735
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
27736
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
27737
|
+
let { children, ...slotProps } = props;
|
|
27738
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
27739
|
+
children = use(children._payload);
|
|
27740
|
+
}
|
|
27741
|
+
const childrenArray = React.Children.toArray(children);
|
|
27742
|
+
const slottable = childrenArray.find(isSlottable);
|
|
27743
|
+
if (slottable) {
|
|
27744
|
+
const newElement = slottable.props.children;
|
|
27745
|
+
const newChildren = childrenArray.map((child) => {
|
|
27746
|
+
if (child === slottable) {
|
|
27747
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
27748
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
27749
|
+
} else {
|
|
27750
|
+
return child;
|
|
27751
|
+
}
|
|
27752
|
+
});
|
|
27753
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
27754
|
+
}
|
|
27755
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
27756
|
+
});
|
|
27757
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
27758
|
+
return Slot2;
|
|
27759
|
+
}
|
|
27760
|
+
// @__NO_SIDE_EFFECTS__
|
|
27761
|
+
function createSlotClone(ownerName) {
|
|
27762
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
27763
|
+
let { children, ...slotProps } = props;
|
|
27764
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
27765
|
+
children = use(children._payload);
|
|
27766
|
+
}
|
|
27767
|
+
if (React.isValidElement(children)) {
|
|
27768
|
+
const childrenRef = getElementRef(children);
|
|
27769
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
27770
|
+
if (children.type !== React.Fragment) {
|
|
27771
|
+
props2.ref = forwardedRef ? composeRefs$1(forwardedRef, childrenRef) : childrenRef;
|
|
27772
|
+
}
|
|
27773
|
+
return React.cloneElement(children, props2);
|
|
27774
|
+
}
|
|
27775
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
27776
|
+
});
|
|
27777
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
27778
|
+
return SlotClone;
|
|
27779
|
+
}
|
|
27780
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
27781
|
+
function isSlottable(child) {
|
|
27782
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
27783
|
+
}
|
|
27784
|
+
function mergeProps(slotProps, childProps) {
|
|
27785
|
+
const overrideProps = { ...childProps };
|
|
27786
|
+
for (const propName in childProps) {
|
|
27787
|
+
const slotPropValue = slotProps[propName];
|
|
27788
|
+
const childPropValue = childProps[propName];
|
|
27789
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
27790
|
+
if (isHandler) {
|
|
27791
|
+
if (slotPropValue && childPropValue) {
|
|
27792
|
+
overrideProps[propName] = (...args) => {
|
|
27793
|
+
const result = childPropValue(...args);
|
|
27794
|
+
slotPropValue(...args);
|
|
27795
|
+
return result;
|
|
27796
|
+
};
|
|
27797
|
+
} else if (slotPropValue) {
|
|
27798
|
+
overrideProps[propName] = slotPropValue;
|
|
27799
|
+
}
|
|
27800
|
+
} else if (propName === "style") {
|
|
27801
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
27802
|
+
} else if (propName === "className") {
|
|
27803
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
27804
|
+
}
|
|
27805
|
+
}
|
|
27806
|
+
return { ...slotProps, ...overrideProps };
|
|
27807
|
+
}
|
|
27808
|
+
function getElementRef(element) {
|
|
27809
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
27810
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
27811
|
+
if (mayWarn) {
|
|
27812
|
+
return element.ref;
|
|
27813
|
+
}
|
|
27814
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
27815
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
27816
|
+
if (mayWarn) {
|
|
27817
|
+
return element.props.ref;
|
|
27818
|
+
}
|
|
27819
|
+
return element.props.ref || element.ref;
|
|
27820
|
+
}
|
|
27821
|
+
|
|
27822
|
+
// src/primitive.tsx
|
|
27823
|
+
var NODES = [
|
|
27824
|
+
"a",
|
|
27825
|
+
"button",
|
|
27826
|
+
"div",
|
|
27827
|
+
"form",
|
|
27828
|
+
"h2",
|
|
27829
|
+
"h3",
|
|
27830
|
+
"img",
|
|
27831
|
+
"input",
|
|
27832
|
+
"label",
|
|
27833
|
+
"li",
|
|
27834
|
+
"nav",
|
|
27835
|
+
"ol",
|
|
27836
|
+
"p",
|
|
27837
|
+
"select",
|
|
27838
|
+
"span",
|
|
27839
|
+
"svg",
|
|
27840
|
+
"ul"
|
|
27841
|
+
];
|
|
27842
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
27843
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
27844
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
27845
|
+
const { asChild, ...primitiveProps } = props;
|
|
27846
|
+
const Comp = asChild ? Slot : node;
|
|
27847
|
+
if (typeof window !== "undefined") {
|
|
27848
|
+
window[Symbol.for("radix-ui")] = true;
|
|
27849
|
+
}
|
|
27850
|
+
return /* @__PURE__ */ jsx$1(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
27851
|
+
});
|
|
27852
|
+
Node.displayName = `Primitive.${node}`;
|
|
27853
|
+
return { ...primitive, [node]: Node };
|
|
27854
|
+
}, {});
|
|
27855
|
+
|
|
27595
27856
|
var PROGRESS_NAME = "Progress";
|
|
27596
27857
|
var DEFAULT_MAX = 100;
|
|
27597
27858
|
var [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);
|
|
@@ -28878,7 +29139,7 @@ var tinycolor$1 = {exports: {}};
|
|
|
28878
29139
|
var tinycolorExports = tinycolor$1.exports;
|
|
28879
29140
|
var tinycolor = /*@__PURE__*/getDefaultExportFromCjs(tinycolorExports);
|
|
28880
29141
|
|
|
28881
|
-
const baseLabelClasses = 'tw
|
|
29142
|
+
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]';
|
|
28882
29143
|
const ProgressIndicator = (props) => {
|
|
28883
29144
|
const { value, color = undefined, testId, label, extraClasses = '', labelClasses = '', valuesLength, max, index, totalValue, ...tooltipProps } = props;
|
|
28884
29145
|
const tooltipData = getQTipData(tooltipProps);
|
|
@@ -28891,19 +29152,19 @@ const ProgressIndicator = (props) => {
|
|
|
28891
29152
|
if (totalValue >= max) {
|
|
28892
29153
|
// If progress is 100%, round both ends
|
|
28893
29154
|
if (index === 0 && valuesLength === 1) {
|
|
28894
|
-
roundedCorners = 'tw
|
|
29155
|
+
roundedCorners = 'tw-rounded-[15px]';
|
|
28895
29156
|
}
|
|
28896
29157
|
else if (index === 0) {
|
|
28897
|
-
roundedCorners = 'tw
|
|
29158
|
+
roundedCorners = 'tw-rounded-l-[15px]';
|
|
28898
29159
|
}
|
|
28899
29160
|
else if (index === valuesLength - 1) {
|
|
28900
|
-
roundedCorners = 'tw
|
|
29161
|
+
roundedCorners = 'tw-rounded-r-[15px]';
|
|
28901
29162
|
}
|
|
28902
29163
|
}
|
|
28903
29164
|
else {
|
|
28904
29165
|
// Otherwise, only round the leftmost indicator
|
|
28905
29166
|
if (index === 0) {
|
|
28906
|
-
roundedCorners = 'tw
|
|
29167
|
+
roundedCorners = 'tw-rounded-l-[15px]';
|
|
28907
29168
|
}
|
|
28908
29169
|
}
|
|
28909
29170
|
useEffect(() => {
|
|
@@ -28915,13 +29176,13 @@ const ProgressIndicator = (props) => {
|
|
|
28915
29176
|
return () => clearTimeout(timeout);
|
|
28916
29177
|
}, [value]);
|
|
28917
29178
|
const bgColor = color || undefined;
|
|
28918
|
-
const bgClass = color ? '' : 'tw
|
|
29179
|
+
const bgClass = color ? '' : 'tw-bg-sq-color-dark';
|
|
28919
29180
|
const computeTextClass = (elem) => {
|
|
28920
29181
|
const computedStyle = getComputedStyle(elem);
|
|
28921
29182
|
const backgroundColor = computedStyle.backgroundColor;
|
|
28922
29183
|
const textColorClass = tinycolor(backgroundColor).isDark()
|
|
28923
|
-
? 'tw
|
|
28924
|
-
: 'tw
|
|
29184
|
+
? 'tw-text-sq-white dark:tw-text-sq-white'
|
|
29185
|
+
: 'tw-text-sq-text-color dark:tw-text-sq-text-color';
|
|
28925
29186
|
setTextColorClass(textColorClass);
|
|
28926
29187
|
};
|
|
28927
29188
|
useEffect(() => {
|
|
@@ -28929,35 +29190,35 @@ const ProgressIndicator = (props) => {
|
|
|
28929
29190
|
computeTextClass(indicatorElementRef.current);
|
|
28930
29191
|
}
|
|
28931
29192
|
}, [!!indicatorElementRef.current]);
|
|
28932
|
-
return (createElement(Indicator, { className: `tw
|
|
29193
|
+
return (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: {
|
|
28933
29194
|
// Background color will default to the theme color if undefined
|
|
28934
29195
|
backgroundColor: bgColor,
|
|
28935
29196
|
animation: 'width 660ms forwards',
|
|
28936
29197
|
width: `${animatedWidth}%`,
|
|
28937
|
-
} }, label ? (jsx$1("span", { className: `${baseLabelClasses} ${labelClasses} ${textColorClass} ${valuesLength === 1 ? 'tw
|
|
29198
|
+
} }, label ? (jsx$1("span", { className: `${baseLabelClasses} ${labelClasses} ${textColorClass} ${valuesLength === 1 ? 'tw-absolute tw-z-50' : ''}`, children: label })) : undefined));
|
|
28938
29199
|
};
|
|
28939
29200
|
const ProgressBar = ({ values = [], max = 100, containerExtraClasses = '', zeroValueLabel = 'No progress yet', }) => {
|
|
28940
29201
|
const totalValue = values.reduce((acc, { value }) => acc + value, 0);
|
|
28941
|
-
return (jsx$1(Root, { className: `tw
|
|
29202
|
+
return (jsx$1(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) => {
|
|
28942
29203
|
return (createElement(ProgressIndicator, { ...props, max: max, valuesLength: values.length, index: i, totalValue: totalValue, key: i }));
|
|
28943
|
-
})) : (jsx$1("div", { className: `${baseLabelClasses} tw
|
|
29204
|
+
})) : (jsx$1("div", { className: `${baseLabelClasses} tw-mx-auto tw-overflow-hidden`, children: zeroValueLabel })) }));
|
|
28944
29205
|
};
|
|
28945
29206
|
|
|
28946
|
-
const baseClasses = 'tw
|
|
29207
|
+
const baseClasses = 'tw-flex tw-outline-none tw-w-full tw-relative tw-flex-wrap';
|
|
28947
29208
|
const activeClassesByVariantLightTheme = {
|
|
28948
|
-
'outline': 'tw
|
|
28949
|
-
'theme': 'tw
|
|
29209
|
+
'outline': '!tw-bg-sq-disabled-gray tw-border-sq-color-dark',
|
|
29210
|
+
'theme': 'tw-bg-sq-color-highlight',
|
|
28950
29211
|
'danger': '',
|
|
28951
29212
|
'theme-light': '',
|
|
28952
|
-
'no-border': 'tw
|
|
29213
|
+
'no-border': '!tw-bg-sq-disabled-gray',
|
|
28953
29214
|
'warning': '',
|
|
28954
29215
|
};
|
|
28955
29216
|
const activeClassesByVariantDarkTheme = {
|
|
28956
|
-
'outline': 'tw
|
|
28957
|
-
'theme': '
|
|
29217
|
+
'outline': 'dark:!tw-bg-sq-multi-gray-dark dark:tw-border-sq-color-dark',
|
|
29218
|
+
'theme': 'dark:tw-bg-sq-color-highlight',
|
|
28958
29219
|
'danger': '',
|
|
28959
29220
|
'theme-light': '',
|
|
28960
|
-
'no-border': 'tw
|
|
29221
|
+
'no-border': 'dark:!tw-bg-sq-multi-gray-dark',
|
|
28961
29222
|
'warning': '',
|
|
28962
29223
|
};
|
|
28963
29224
|
/**
|
|
@@ -28969,7 +29230,7 @@ const ButtonGroup = (props) => {
|
|
|
28969
29230
|
const appliedClasses = `${baseClasses} ${extraClassNames}`;
|
|
28970
29231
|
return (jsx$1("div", { id: id ? `button-group-${id}` : undefined, "data-testid": testId, className: appliedClasses, ...tooltipData, children: buttons
|
|
28971
29232
|
.filter(Boolean)
|
|
28972
|
-
.map((item, index) => item?.variant === 'button' ? (jsx$1(Button, { ...item.buttonProps, extraClassNames: `tw
|
|
29233
|
+
.map((item, index) => item?.variant === 'button' ? (jsx$1(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
|
|
28973
29234
|
? `${activeClassesByVariantLightTheme[item?.buttonProps?.variant ?? 'outline']} ${activeClassesByVariantDarkTheme[item?.buttonProps?.variant ?? 'outline']} `
|
|
28974
29235
|
: ''} ${item.buttonProps.extraClassNames}`, onClick: () => onChange && onChange(item?.buttonProps?.value) }, index)) : (item?.element)) }));
|
|
28975
29236
|
};
|
|
@@ -28979,7 +29240,7 @@ const ButtonGroup = (props) => {
|
|
|
28979
29240
|
* - Easily create a carousel with custom slides.
|
|
28980
29241
|
* - Supports automatic sliding, navigation arrows, and slide indicators.
|
|
28981
29242
|
*/
|
|
28982
|
-
const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '', onSlide = () => { }, autoSlide, showIndicators = true, continuous = true, interval = 4000, prevIcon = 'fc-arrow-dropdown tw
|
|
29243
|
+
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 = [], }) => {
|
|
28983
29244
|
const [currentIndex, setCurrentIndex] = useState(activeIndex);
|
|
28984
29245
|
const changeSlide = (nextIndex) => {
|
|
28985
29246
|
const newIndex = (nextIndex + carouselItems.length) % carouselItems.length;
|
|
@@ -29046,7 +29307,7 @@ const Carousel = ({ testId = 'carousel-id', activeIndex = 0, extraClassNames = '
|
|
|
29046
29307
|
transition: springTransition,
|
|
29047
29308
|
}),
|
|
29048
29309
|
};
|
|
29049
|
-
return (jsxs("div", { "data-testid": testId, className: `tw
|
|
29310
|
+
return (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: [jsxs("div", { className: "tw-flex tw-items-center tw-w-full tw-h-max tw-gap-1", children: [showArrows && (jsx$1(Button, { icon: prevIcon, size: "lg", variant: "no-border", testId: "carousel-prev", extraClassNames: `${currentIndex === 0 && !continuous ? 'tw-invisible' : ''} ${iconExtraClassNames} tw-animate-fadeIn`, onClick: onBackClick })), jsx$1("div", { className: "tw-h-full tw-w-full tw-overflow-hidden", children: jsx$1(motion.div, { custom: 1, initial: "initial", animate: "animate", exit: "exit", variants: slideVariants, className: "tw-w-full", children: carouselItems[currentIndex] }, currentIndex) }), showArrows && (jsx$1(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 && (jsx$1("div", { className: "tw-flex tw-gap-1 tw-mt-2", children: carouselItems.map((_, i) => (jsx$1("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))) }))] }));
|
|
29050
29311
|
};
|
|
29051
29312
|
|
|
29052
29313
|
const buttonTypes = ['button', 'reset', 'submit', 'link'];
|