@bizapps/design-system-testing 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +71 -58
- package/dist/main.cjs.map +1 -1
- package/dist/main.js +71 -58
- package/dist/main.js.map +1 -1
- package/package.json +26 -2
package/dist/main.cjs
CHANGED
|
@@ -1951,6 +1951,7 @@ function TabsContent({
|
|
|
1951
1951
|
var DEFAULT_DURATION = 3e3;
|
|
1952
1952
|
var MAX_TOASTS = 5;
|
|
1953
1953
|
function createStore() {
|
|
1954
|
+
const timers = /* @__PURE__ */ new Map();
|
|
1954
1955
|
const store = {
|
|
1955
1956
|
toasts: [],
|
|
1956
1957
|
listeners: [],
|
|
@@ -1965,10 +1966,15 @@ function createStore() {
|
|
|
1965
1966
|
store.toasts = [{ id: toastId, ...item }, ...store.toasts].slice(0, MAX_TOASTS);
|
|
1966
1967
|
}
|
|
1967
1968
|
store.listeners.forEach((l) => l([...store.toasts]));
|
|
1968
|
-
if (item.duration > 0)
|
|
1969
|
+
if (item.duration > 0) {
|
|
1970
|
+
clearTimeout(timers.get(toastId));
|
|
1971
|
+
timers.set(toastId, setTimeout(() => store.remove(toastId), item.duration));
|
|
1972
|
+
}
|
|
1969
1973
|
return toastId;
|
|
1970
1974
|
},
|
|
1971
1975
|
remove(id) {
|
|
1976
|
+
clearTimeout(timers.get(id));
|
|
1977
|
+
timers.delete(id);
|
|
1972
1978
|
store.toasts = store.toasts.filter((t) => t.id !== id);
|
|
1973
1979
|
store.listeners.forEach((l) => l([...store.toasts]));
|
|
1974
1980
|
},
|
|
@@ -2810,7 +2816,8 @@ function Combobox({
|
|
|
2810
2816
|
options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2811
2817
|
cmdk.Command.Item,
|
|
2812
2818
|
{
|
|
2813
|
-
value: option.
|
|
2819
|
+
value: option.value,
|
|
2820
|
+
keywords: [option.label],
|
|
2814
2821
|
disabled: option.disabled,
|
|
2815
2822
|
onSelect: () => {
|
|
2816
2823
|
onValueChange?.(option.value === value ? "" : option.value);
|
|
@@ -3092,9 +3099,10 @@ var Dropzone = ({
|
|
|
3092
3099
|
if (fileRejections.length > 0) {
|
|
3093
3100
|
const message = fileRejections.at(0)?.errors.at(0)?.message;
|
|
3094
3101
|
onError?.(new Error(message));
|
|
3095
|
-
return;
|
|
3096
3102
|
}
|
|
3097
|
-
|
|
3103
|
+
if (acceptedFiles.length > 0) {
|
|
3104
|
+
onDrop?.(acceptedFiles, fileRejections, event);
|
|
3105
|
+
}
|
|
3098
3106
|
},
|
|
3099
3107
|
...props
|
|
3100
3108
|
});
|
|
@@ -3786,18 +3794,14 @@ var ColorPicker = ({
|
|
|
3786
3794
|
className,
|
|
3787
3795
|
...props
|
|
3788
3796
|
}) => {
|
|
3789
|
-
const
|
|
3790
|
-
const
|
|
3791
|
-
const [
|
|
3792
|
-
const [
|
|
3793
|
-
|
|
3794
|
-
);
|
|
3795
|
-
const [lightness, setLightness] = react.useState(
|
|
3796
|
-
selectedColor.lightness() || defaultColor.lightness() || 50
|
|
3797
|
-
);
|
|
3798
|
-
const [alpha, setAlpha] = react.useState(selectedColor.alpha() * 100 || defaultColor.alpha() * 100);
|
|
3797
|
+
const baseColor = value !== void 0 ? Color__default.default(value) : Color__default.default(defaultValue);
|
|
3798
|
+
const [hue, setHue] = react.useState(baseColor.hue());
|
|
3799
|
+
const [saturation, setSaturation] = react.useState(baseColor.saturationl());
|
|
3800
|
+
const [lightness, setLightness] = react.useState(baseColor.lightness());
|
|
3801
|
+
const [alpha, setAlpha] = react.useState(baseColor.alpha() * 100);
|
|
3799
3802
|
const [mode, setMode] = react.useState("hex");
|
|
3800
3803
|
const onChangeRef = react.useRef(onChange);
|
|
3804
|
+
const mounted = react.useRef(false);
|
|
3801
3805
|
react.useEffect(() => {
|
|
3802
3806
|
onChangeRef.current = onChange;
|
|
3803
3807
|
});
|
|
@@ -3811,6 +3815,10 @@ var ColorPicker = ({
|
|
|
3811
3815
|
}
|
|
3812
3816
|
}, [value]);
|
|
3813
3817
|
react.useEffect(() => {
|
|
3818
|
+
if (!mounted.current) {
|
|
3819
|
+
mounted.current = true;
|
|
3820
|
+
return;
|
|
3821
|
+
}
|
|
3814
3822
|
if (onChangeRef.current) {
|
|
3815
3823
|
const color = Color__default.default.hsl(hue, saturation, lightness).alpha(alpha / 100);
|
|
3816
3824
|
const rgba = color.rgb().array();
|
|
@@ -4260,7 +4268,7 @@ function NavLinkItem({
|
|
|
4260
4268
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4261
4269
|
"a",
|
|
4262
4270
|
{
|
|
4263
|
-
href: link.href,
|
|
4271
|
+
href: sanitizeHref(link.href),
|
|
4264
4272
|
onClick: (e) => {
|
|
4265
4273
|
e.preventDefault();
|
|
4266
4274
|
onNavLinkClick?.(link.href);
|
|
@@ -4294,7 +4302,7 @@ function NavLinkItem({
|
|
|
4294
4302
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1", children: link.dropdownItems.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4295
4303
|
"a",
|
|
4296
4304
|
{
|
|
4297
|
-
href: item.href,
|
|
4305
|
+
href: sanitizeHref(item.href),
|
|
4298
4306
|
onClick: (e) => {
|
|
4299
4307
|
e.preventDefault();
|
|
4300
4308
|
onNavLinkClick?.(item.href);
|
|
@@ -4364,7 +4372,7 @@ var Navbar = react.forwardRef(
|
|
|
4364
4372
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4365
4373
|
"a",
|
|
4366
4374
|
{
|
|
4367
|
-
href: link.href,
|
|
4375
|
+
href: sanitizeHref(link.href),
|
|
4368
4376
|
className: "text-muted-foreground hover:text-foreground text-xs transition-colors",
|
|
4369
4377
|
children: link.label
|
|
4370
4378
|
}
|
|
@@ -4862,17 +4870,14 @@ var eventCalendarStyles = `
|
|
|
4862
4870
|
--sx-color-outline-variant: var(--color-border);
|
|
4863
4871
|
--sx-internal-color-text: var(--color-foreground);
|
|
4864
4872
|
font-size: 13px;
|
|
4865
|
-
font-family: inherit;
|
|
4873
|
+
font-family: var(--font-sans, inherit);
|
|
4866
4874
|
}
|
|
4867
4875
|
|
|
4868
4876
|
/* \u2500\u2500 Outer wrapper \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
4869
4877
|
.sx-tcce .sx__calendar-wrapper {
|
|
4870
|
-
border-radius:
|
|
4878
|
+
border-radius: var(--border-radius-article, 0.875rem);
|
|
4871
4879
|
border: 1px solid var(--color-border);
|
|
4872
4880
|
overflow: hidden;
|
|
4873
|
-
box-shadow:
|
|
4874
|
-
0 1px 3px rgba(0, 0, 0, 0.04),
|
|
4875
|
-
0 4px 16px rgba(0, 0, 0, 0.06);
|
|
4876
4881
|
}
|
|
4877
4882
|
|
|
4878
4883
|
/* \u2500\u2500 Header bar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
@@ -4881,6 +4886,8 @@ var eventCalendarStyles = `
|
|
|
4881
4886
|
min-height: 52px;
|
|
4882
4887
|
border-bottom: 1px solid var(--color-border);
|
|
4883
4888
|
background: var(--color-background);
|
|
4889
|
+
display: flex;
|
|
4890
|
+
align-items: center;
|
|
4884
4891
|
}
|
|
4885
4892
|
|
|
4886
4893
|
/* Range title \u2014 "June 2026" */
|
|
@@ -4889,34 +4896,38 @@ var eventCalendarStyles = `
|
|
|
4889
4896
|
font-weight: 700;
|
|
4890
4897
|
letter-spacing: -0.02em;
|
|
4891
4898
|
color: var(--color-foreground);
|
|
4899
|
+
font-family: var(--font-heading, inherit);
|
|
4892
4900
|
}
|
|
4893
4901
|
|
|
4894
|
-
/* "Today" button */
|
|
4902
|
+
/* "Today" button \u2014 primary style */
|
|
4895
4903
|
.sx-tcce .sx__today-button {
|
|
4896
4904
|
font-size: 12px;
|
|
4897
|
-
font-weight:
|
|
4898
|
-
height:
|
|
4899
|
-
padding: 0
|
|
4900
|
-
border-radius:
|
|
4901
|
-
border:
|
|
4902
|
-
background: var(--color-
|
|
4903
|
-
color: var(--color-foreground);
|
|
4905
|
+
font-weight: 600;
|
|
4906
|
+
height: 32px;
|
|
4907
|
+
padding: 0 14px;
|
|
4908
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4909
|
+
border: none;
|
|
4910
|
+
background: var(--color-primary);
|
|
4911
|
+
color: var(--color-primary-foreground);
|
|
4904
4912
|
cursor: pointer;
|
|
4905
|
-
transition:
|
|
4913
|
+
transition: opacity 150ms;
|
|
4906
4914
|
}
|
|
4907
4915
|
.sx-tcce .sx__today-button:hover {
|
|
4908
|
-
|
|
4916
|
+
opacity: 0.88;
|
|
4917
|
+
}
|
|
4918
|
+
.sx-tcce .sx__today-button:active {
|
|
4919
|
+
opacity: 0.72;
|
|
4909
4920
|
}
|
|
4910
4921
|
|
|
4911
4922
|
/* Prev / Next arrow buttons */
|
|
4912
4923
|
.sx-tcce .sx__chevron-wrapper {
|
|
4913
|
-
width:
|
|
4914
|
-
height:
|
|
4915
|
-
min-width:
|
|
4916
|
-
border-radius:
|
|
4924
|
+
width: 32px;
|
|
4925
|
+
height: 32px;
|
|
4926
|
+
min-width: 32px;
|
|
4927
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4917
4928
|
border: 1px solid var(--color-border);
|
|
4918
4929
|
background: var(--color-background);
|
|
4919
|
-
transition: background
|
|
4930
|
+
transition: background 150ms;
|
|
4920
4931
|
}
|
|
4921
4932
|
.sx-tcce .sx__chevron-wrapper:hover {
|
|
4922
4933
|
background: var(--color-muted);
|
|
@@ -4937,9 +4948,9 @@ var eventCalendarStyles = `
|
|
|
4937
4948
|
.sx-tcce .sx__view-selection-selected-item {
|
|
4938
4949
|
font-size: 12px;
|
|
4939
4950
|
font-weight: 600;
|
|
4940
|
-
height:
|
|
4941
|
-
padding: 0
|
|
4942
|
-
border-radius:
|
|
4951
|
+
height: 32px;
|
|
4952
|
+
padding: 0 12px;
|
|
4953
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4943
4954
|
background: var(--color-primary);
|
|
4944
4955
|
color: var(--color-primary-foreground);
|
|
4945
4956
|
border: none;
|
|
@@ -4947,9 +4958,11 @@ var eventCalendarStyles = `
|
|
|
4947
4958
|
align-items: center;
|
|
4948
4959
|
gap: 4px;
|
|
4949
4960
|
cursor: pointer;
|
|
4950
|
-
transition: opacity
|
|
4961
|
+
transition: opacity 150ms;
|
|
4951
4962
|
}
|
|
4952
|
-
.sx-tcce .sx__view-selection-selected-item:hover
|
|
4963
|
+
.sx-tcce .sx__view-selection-selected-item:hover,
|
|
4964
|
+
.sx-tcce .sx__view-selection-selected-item:focus,
|
|
4965
|
+
.sx-tcce .sx__view-selection-selected-item:active {
|
|
4953
4966
|
opacity: 0.85;
|
|
4954
4967
|
}
|
|
4955
4968
|
|
|
@@ -4958,14 +4971,13 @@ var eventCalendarStyles = `
|
|
|
4958
4971
|
width: 13px;
|
|
4959
4972
|
height: 13px;
|
|
4960
4973
|
opacity: 0.6;
|
|
4961
|
-
filter: brightness(0) invert(1);
|
|
4974
|
+
filter: brightness(0) invert(1);
|
|
4962
4975
|
}
|
|
4963
4976
|
|
|
4964
4977
|
/* Dropdown list of views */
|
|
4965
4978
|
.sx-tcce .sx__view-selection-items {
|
|
4966
|
-
border-radius:
|
|
4979
|
+
border-radius: var(--border-radius-outline, 0.5rem);
|
|
4967
4980
|
border: 1px solid var(--color-border);
|
|
4968
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
|
4969
4981
|
padding: 4px;
|
|
4970
4982
|
gap: 2px;
|
|
4971
4983
|
background: var(--color-background);
|
|
@@ -4997,18 +5009,17 @@ var eventCalendarStyles = `
|
|
|
4997
5009
|
display: inline-flex;
|
|
4998
5010
|
align-items: center;
|
|
4999
5011
|
gap: 2px;
|
|
5000
|
-
height:
|
|
5012
|
+
height: 32px;
|
|
5001
5013
|
padding: 0 8px;
|
|
5002
5014
|
border: 1px solid var(--color-border);
|
|
5003
|
-
border-radius:
|
|
5015
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
5004
5016
|
background: var(--color-background);
|
|
5005
5017
|
cursor: pointer;
|
|
5006
5018
|
transition: border-color 150ms;
|
|
5019
|
+
overflow: hidden;
|
|
5007
5020
|
}
|
|
5008
5021
|
.sx-tcce .sx__date-input-wrapper:focus-within {
|
|
5009
5022
|
border-color: var(--color-primary);
|
|
5010
|
-
outline: 2px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
|
|
5011
|
-
outline-offset: 0;
|
|
5012
5023
|
}
|
|
5013
5024
|
|
|
5014
5025
|
.sx-tcce .sx__date-input {
|
|
@@ -5033,7 +5044,9 @@ var eventCalendarStyles = `
|
|
|
5033
5044
|
justify-content: center;
|
|
5034
5045
|
background: transparent;
|
|
5035
5046
|
border: none;
|
|
5047
|
+
outline: none;
|
|
5036
5048
|
cursor: pointer;
|
|
5049
|
+
appearance: none;
|
|
5037
5050
|
}
|
|
5038
5051
|
.sx-tcce .sx__date-input-chevron {
|
|
5039
5052
|
width: 12px;
|
|
@@ -5043,9 +5056,8 @@ var eventCalendarStyles = `
|
|
|
5043
5056
|
|
|
5044
5057
|
/* Date picker popup (the calendar that drops when clicking the date input) */
|
|
5045
5058
|
.sx-tcce .sx__date-picker-popup {
|
|
5046
|
-
border-radius:
|
|
5059
|
+
border-radius: var(--border-radius-article, 0.875rem);
|
|
5047
5060
|
border: 1px solid var(--color-border);
|
|
5048
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
5049
5061
|
overflow: hidden;
|
|
5050
5062
|
font-size: 12px;
|
|
5051
5063
|
background: var(--color-background);
|
|
@@ -5132,6 +5144,7 @@ var eventCalendarStyles = `
|
|
|
5132
5144
|
display: flex;
|
|
5133
5145
|
align-items: center;
|
|
5134
5146
|
justify-content: center;
|
|
5147
|
+
transition: background 150ms;
|
|
5135
5148
|
}
|
|
5136
5149
|
|
|
5137
5150
|
/* Today highlight */
|
|
@@ -5157,6 +5170,7 @@ var eventCalendarStyles = `
|
|
|
5157
5170
|
font-weight: 500;
|
|
5158
5171
|
background-color: transparent !important;
|
|
5159
5172
|
border-inline-start-width: 3px !important;
|
|
5173
|
+
cursor: pointer;
|
|
5160
5174
|
}
|
|
5161
5175
|
.sx-tcce .sx__month-grid-event-time {
|
|
5162
5176
|
font-size: 10px;
|
|
@@ -5183,7 +5197,7 @@ var eventCalendarStyles = `
|
|
|
5183
5197
|
display: flex;
|
|
5184
5198
|
align-items: center;
|
|
5185
5199
|
justify-content: center;
|
|
5186
|
-
transition: background
|
|
5200
|
+
transition: background 150ms;
|
|
5187
5201
|
}
|
|
5188
5202
|
.sx-tcce .sx__week-grid__date--is-today .sx__week-grid__date-number {
|
|
5189
5203
|
background: var(--color-primary) !important;
|
|
@@ -5204,7 +5218,7 @@ var eventCalendarStyles = `
|
|
|
5204
5218
|
}
|
|
5205
5219
|
.sx-tcce .sx__time-grid-event {
|
|
5206
5220
|
border-radius: 6px;
|
|
5207
|
-
|
|
5221
|
+
cursor: pointer;
|
|
5208
5222
|
}
|
|
5209
5223
|
.sx-tcce .sx__time-grid-event-inner {
|
|
5210
5224
|
padding: 4px 7px;
|
|
@@ -5226,11 +5240,8 @@ var eventCalendarStyles = `
|
|
|
5226
5240
|
|
|
5227
5241
|
/* \u2500\u2500 Event modal \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
5228
5242
|
.sx-tcce .sx__event-modal {
|
|
5229
|
-
border-radius:
|
|
5243
|
+
border-radius: var(--border-radius-article, 0.875rem);
|
|
5230
5244
|
border: 1px solid var(--color-border);
|
|
5231
|
-
box-shadow:
|
|
5232
|
-
0 4px 12px rgba(0, 0, 0, 0.08),
|
|
5233
|
-
0 12px 32px rgba(0, 0, 0, 0.1);
|
|
5234
5245
|
font-size: 13px;
|
|
5235
5246
|
min-width: 220px;
|
|
5236
5247
|
max-width: 300px;
|
|
@@ -5240,6 +5251,7 @@ var eventCalendarStyles = `
|
|
|
5240
5251
|
font-size: 14px;
|
|
5241
5252
|
font-weight: 700;
|
|
5242
5253
|
letter-spacing: -0.01em;
|
|
5254
|
+
font-family: var(--font-heading, inherit);
|
|
5243
5255
|
}
|
|
5244
5256
|
.sx-tcce .sx__event-modal__time {
|
|
5245
5257
|
font-size: 12px;
|
|
@@ -5356,10 +5368,11 @@ function useEventCalendar({
|
|
|
5356
5368
|
}
|
|
5357
5369
|
});
|
|
5358
5370
|
}
|
|
5371
|
+
const eventsKey = JSON.stringify(events);
|
|
5359
5372
|
react.useEffect(() => {
|
|
5360
5373
|
eventsMapRef.current = new Map(events.map((e) => [String(e.id), e]));
|
|
5361
5374
|
eventsService$1.current.set(events.map(toScheduleXEvent));
|
|
5362
|
-
}, [
|
|
5375
|
+
}, [eventsKey]);
|
|
5363
5376
|
react.useEffect(() => {
|
|
5364
5377
|
const app = calendarApp.current;
|
|
5365
5378
|
if (!app) return;
|