@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.js
CHANGED
|
@@ -1946,6 +1946,7 @@ function TabsContent({
|
|
|
1946
1946
|
var DEFAULT_DURATION = 3e3;
|
|
1947
1947
|
var MAX_TOASTS = 5;
|
|
1948
1948
|
function createStore() {
|
|
1949
|
+
const timers = /* @__PURE__ */ new Map();
|
|
1949
1950
|
const store = {
|
|
1950
1951
|
toasts: [],
|
|
1951
1952
|
listeners: [],
|
|
@@ -1960,10 +1961,15 @@ function createStore() {
|
|
|
1960
1961
|
store.toasts = [{ id: toastId, ...item }, ...store.toasts].slice(0, MAX_TOASTS);
|
|
1961
1962
|
}
|
|
1962
1963
|
store.listeners.forEach((l) => l([...store.toasts]));
|
|
1963
|
-
if (item.duration > 0)
|
|
1964
|
+
if (item.duration > 0) {
|
|
1965
|
+
clearTimeout(timers.get(toastId));
|
|
1966
|
+
timers.set(toastId, setTimeout(() => store.remove(toastId), item.duration));
|
|
1967
|
+
}
|
|
1964
1968
|
return toastId;
|
|
1965
1969
|
},
|
|
1966
1970
|
remove(id) {
|
|
1971
|
+
clearTimeout(timers.get(id));
|
|
1972
|
+
timers.delete(id);
|
|
1967
1973
|
store.toasts = store.toasts.filter((t) => t.id !== id);
|
|
1968
1974
|
store.listeners.forEach((l) => l([...store.toasts]));
|
|
1969
1975
|
},
|
|
@@ -2805,7 +2811,8 @@ function Combobox({
|
|
|
2805
2811
|
options.map((option) => /* @__PURE__ */ jsxs(
|
|
2806
2812
|
Command.Item,
|
|
2807
2813
|
{
|
|
2808
|
-
value: option.
|
|
2814
|
+
value: option.value,
|
|
2815
|
+
keywords: [option.label],
|
|
2809
2816
|
disabled: option.disabled,
|
|
2810
2817
|
onSelect: () => {
|
|
2811
2818
|
onValueChange?.(option.value === value ? "" : option.value);
|
|
@@ -3087,9 +3094,10 @@ var Dropzone = ({
|
|
|
3087
3094
|
if (fileRejections.length > 0) {
|
|
3088
3095
|
const message = fileRejections.at(0)?.errors.at(0)?.message;
|
|
3089
3096
|
onError?.(new Error(message));
|
|
3090
|
-
return;
|
|
3091
3097
|
}
|
|
3092
|
-
|
|
3098
|
+
if (acceptedFiles.length > 0) {
|
|
3099
|
+
onDrop?.(acceptedFiles, fileRejections, event);
|
|
3100
|
+
}
|
|
3093
3101
|
},
|
|
3094
3102
|
...props
|
|
3095
3103
|
});
|
|
@@ -3781,18 +3789,14 @@ var ColorPicker = ({
|
|
|
3781
3789
|
className,
|
|
3782
3790
|
...props
|
|
3783
3791
|
}) => {
|
|
3784
|
-
const
|
|
3785
|
-
const
|
|
3786
|
-
const [
|
|
3787
|
-
const [
|
|
3788
|
-
|
|
3789
|
-
);
|
|
3790
|
-
const [lightness, setLightness] = useState(
|
|
3791
|
-
selectedColor.lightness() || defaultColor.lightness() || 50
|
|
3792
|
-
);
|
|
3793
|
-
const [alpha, setAlpha] = useState(selectedColor.alpha() * 100 || defaultColor.alpha() * 100);
|
|
3792
|
+
const baseColor = value !== void 0 ? Color(value) : Color(defaultValue);
|
|
3793
|
+
const [hue, setHue] = useState(baseColor.hue());
|
|
3794
|
+
const [saturation, setSaturation] = useState(baseColor.saturationl());
|
|
3795
|
+
const [lightness, setLightness] = useState(baseColor.lightness());
|
|
3796
|
+
const [alpha, setAlpha] = useState(baseColor.alpha() * 100);
|
|
3794
3797
|
const [mode, setMode] = useState("hex");
|
|
3795
3798
|
const onChangeRef = useRef(onChange);
|
|
3799
|
+
const mounted = useRef(false);
|
|
3796
3800
|
useEffect(() => {
|
|
3797
3801
|
onChangeRef.current = onChange;
|
|
3798
3802
|
});
|
|
@@ -3806,6 +3810,10 @@ var ColorPicker = ({
|
|
|
3806
3810
|
}
|
|
3807
3811
|
}, [value]);
|
|
3808
3812
|
useEffect(() => {
|
|
3813
|
+
if (!mounted.current) {
|
|
3814
|
+
mounted.current = true;
|
|
3815
|
+
return;
|
|
3816
|
+
}
|
|
3809
3817
|
if (onChangeRef.current) {
|
|
3810
3818
|
const color = Color.hsl(hue, saturation, lightness).alpha(alpha / 100);
|
|
3811
3819
|
const rgba = color.rgb().array();
|
|
@@ -4255,7 +4263,7 @@ function NavLinkItem({
|
|
|
4255
4263
|
/* @__PURE__ */ jsxs(
|
|
4256
4264
|
"a",
|
|
4257
4265
|
{
|
|
4258
|
-
href: link.href,
|
|
4266
|
+
href: sanitizeHref(link.href),
|
|
4259
4267
|
onClick: (e) => {
|
|
4260
4268
|
e.preventDefault();
|
|
4261
4269
|
onNavLinkClick?.(link.href);
|
|
@@ -4289,7 +4297,7 @@ function NavLinkItem({
|
|
|
4289
4297
|
children: /* @__PURE__ */ jsx("div", { className: "p-1", children: link.dropdownItems.map((item, i) => /* @__PURE__ */ jsxs(
|
|
4290
4298
|
"a",
|
|
4291
4299
|
{
|
|
4292
|
-
href: item.href,
|
|
4300
|
+
href: sanitizeHref(item.href),
|
|
4293
4301
|
onClick: (e) => {
|
|
4294
4302
|
e.preventDefault();
|
|
4295
4303
|
onNavLinkClick?.(item.href);
|
|
@@ -4359,7 +4367,7 @@ var Navbar = forwardRef(
|
|
|
4359
4367
|
/* @__PURE__ */ jsx(
|
|
4360
4368
|
"a",
|
|
4361
4369
|
{
|
|
4362
|
-
href: link.href,
|
|
4370
|
+
href: sanitizeHref(link.href),
|
|
4363
4371
|
className: "text-muted-foreground hover:text-foreground text-xs transition-colors",
|
|
4364
4372
|
children: link.label
|
|
4365
4373
|
}
|
|
@@ -4857,17 +4865,14 @@ var eventCalendarStyles = `
|
|
|
4857
4865
|
--sx-color-outline-variant: var(--color-border);
|
|
4858
4866
|
--sx-internal-color-text: var(--color-foreground);
|
|
4859
4867
|
font-size: 13px;
|
|
4860
|
-
font-family: inherit;
|
|
4868
|
+
font-family: var(--font-sans, inherit);
|
|
4861
4869
|
}
|
|
4862
4870
|
|
|
4863
4871
|
/* \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 */
|
|
4864
4872
|
.sx-tcce .sx__calendar-wrapper {
|
|
4865
|
-
border-radius:
|
|
4873
|
+
border-radius: var(--border-radius-article, 0.875rem);
|
|
4866
4874
|
border: 1px solid var(--color-border);
|
|
4867
4875
|
overflow: hidden;
|
|
4868
|
-
box-shadow:
|
|
4869
|
-
0 1px 3px rgba(0, 0, 0, 0.04),
|
|
4870
|
-
0 4px 16px rgba(0, 0, 0, 0.06);
|
|
4871
4876
|
}
|
|
4872
4877
|
|
|
4873
4878
|
/* \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 */
|
|
@@ -4876,6 +4881,8 @@ var eventCalendarStyles = `
|
|
|
4876
4881
|
min-height: 52px;
|
|
4877
4882
|
border-bottom: 1px solid var(--color-border);
|
|
4878
4883
|
background: var(--color-background);
|
|
4884
|
+
display: flex;
|
|
4885
|
+
align-items: center;
|
|
4879
4886
|
}
|
|
4880
4887
|
|
|
4881
4888
|
/* Range title \u2014 "June 2026" */
|
|
@@ -4884,34 +4891,38 @@ var eventCalendarStyles = `
|
|
|
4884
4891
|
font-weight: 700;
|
|
4885
4892
|
letter-spacing: -0.02em;
|
|
4886
4893
|
color: var(--color-foreground);
|
|
4894
|
+
font-family: var(--font-heading, inherit);
|
|
4887
4895
|
}
|
|
4888
4896
|
|
|
4889
|
-
/* "Today" button */
|
|
4897
|
+
/* "Today" button \u2014 primary style */
|
|
4890
4898
|
.sx-tcce .sx__today-button {
|
|
4891
4899
|
font-size: 12px;
|
|
4892
|
-
font-weight:
|
|
4893
|
-
height:
|
|
4894
|
-
padding: 0
|
|
4895
|
-
border-radius:
|
|
4896
|
-
border:
|
|
4897
|
-
background: var(--color-
|
|
4898
|
-
color: var(--color-foreground);
|
|
4900
|
+
font-weight: 600;
|
|
4901
|
+
height: 32px;
|
|
4902
|
+
padding: 0 14px;
|
|
4903
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4904
|
+
border: none;
|
|
4905
|
+
background: var(--color-primary);
|
|
4906
|
+
color: var(--color-primary-foreground);
|
|
4899
4907
|
cursor: pointer;
|
|
4900
|
-
transition:
|
|
4908
|
+
transition: opacity 150ms;
|
|
4901
4909
|
}
|
|
4902
4910
|
.sx-tcce .sx__today-button:hover {
|
|
4903
|
-
|
|
4911
|
+
opacity: 0.88;
|
|
4912
|
+
}
|
|
4913
|
+
.sx-tcce .sx__today-button:active {
|
|
4914
|
+
opacity: 0.72;
|
|
4904
4915
|
}
|
|
4905
4916
|
|
|
4906
4917
|
/* Prev / Next arrow buttons */
|
|
4907
4918
|
.sx-tcce .sx__chevron-wrapper {
|
|
4908
|
-
width:
|
|
4909
|
-
height:
|
|
4910
|
-
min-width:
|
|
4911
|
-
border-radius:
|
|
4919
|
+
width: 32px;
|
|
4920
|
+
height: 32px;
|
|
4921
|
+
min-width: 32px;
|
|
4922
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4912
4923
|
border: 1px solid var(--color-border);
|
|
4913
4924
|
background: var(--color-background);
|
|
4914
|
-
transition: background
|
|
4925
|
+
transition: background 150ms;
|
|
4915
4926
|
}
|
|
4916
4927
|
.sx-tcce .sx__chevron-wrapper:hover {
|
|
4917
4928
|
background: var(--color-muted);
|
|
@@ -4932,9 +4943,9 @@ var eventCalendarStyles = `
|
|
|
4932
4943
|
.sx-tcce .sx__view-selection-selected-item {
|
|
4933
4944
|
font-size: 12px;
|
|
4934
4945
|
font-weight: 600;
|
|
4935
|
-
height:
|
|
4936
|
-
padding: 0
|
|
4937
|
-
border-radius:
|
|
4946
|
+
height: 32px;
|
|
4947
|
+
padding: 0 12px;
|
|
4948
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4938
4949
|
background: var(--color-primary);
|
|
4939
4950
|
color: var(--color-primary-foreground);
|
|
4940
4951
|
border: none;
|
|
@@ -4942,9 +4953,11 @@ var eventCalendarStyles = `
|
|
|
4942
4953
|
align-items: center;
|
|
4943
4954
|
gap: 4px;
|
|
4944
4955
|
cursor: pointer;
|
|
4945
|
-
transition: opacity
|
|
4956
|
+
transition: opacity 150ms;
|
|
4946
4957
|
}
|
|
4947
|
-
.sx-tcce .sx__view-selection-selected-item:hover
|
|
4958
|
+
.sx-tcce .sx__view-selection-selected-item:hover,
|
|
4959
|
+
.sx-tcce .sx__view-selection-selected-item:focus,
|
|
4960
|
+
.sx-tcce .sx__view-selection-selected-item:active {
|
|
4948
4961
|
opacity: 0.85;
|
|
4949
4962
|
}
|
|
4950
4963
|
|
|
@@ -4953,14 +4966,13 @@ var eventCalendarStyles = `
|
|
|
4953
4966
|
width: 13px;
|
|
4954
4967
|
height: 13px;
|
|
4955
4968
|
opacity: 0.6;
|
|
4956
|
-
filter: brightness(0) invert(1);
|
|
4969
|
+
filter: brightness(0) invert(1);
|
|
4957
4970
|
}
|
|
4958
4971
|
|
|
4959
4972
|
/* Dropdown list of views */
|
|
4960
4973
|
.sx-tcce .sx__view-selection-items {
|
|
4961
|
-
border-radius:
|
|
4974
|
+
border-radius: var(--border-radius-outline, 0.5rem);
|
|
4962
4975
|
border: 1px solid var(--color-border);
|
|
4963
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
|
4964
4976
|
padding: 4px;
|
|
4965
4977
|
gap: 2px;
|
|
4966
4978
|
background: var(--color-background);
|
|
@@ -4992,18 +5004,17 @@ var eventCalendarStyles = `
|
|
|
4992
5004
|
display: inline-flex;
|
|
4993
5005
|
align-items: center;
|
|
4994
5006
|
gap: 2px;
|
|
4995
|
-
height:
|
|
5007
|
+
height: 32px;
|
|
4996
5008
|
padding: 0 8px;
|
|
4997
5009
|
border: 1px solid var(--color-border);
|
|
4998
|
-
border-radius:
|
|
5010
|
+
border-radius: var(--border-radius-secondary-button, 0.625rem);
|
|
4999
5011
|
background: var(--color-background);
|
|
5000
5012
|
cursor: pointer;
|
|
5001
5013
|
transition: border-color 150ms;
|
|
5014
|
+
overflow: hidden;
|
|
5002
5015
|
}
|
|
5003
5016
|
.sx-tcce .sx__date-input-wrapper:focus-within {
|
|
5004
5017
|
border-color: var(--color-primary);
|
|
5005
|
-
outline: 2px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
|
|
5006
|
-
outline-offset: 0;
|
|
5007
5018
|
}
|
|
5008
5019
|
|
|
5009
5020
|
.sx-tcce .sx__date-input {
|
|
@@ -5028,7 +5039,9 @@ var eventCalendarStyles = `
|
|
|
5028
5039
|
justify-content: center;
|
|
5029
5040
|
background: transparent;
|
|
5030
5041
|
border: none;
|
|
5042
|
+
outline: none;
|
|
5031
5043
|
cursor: pointer;
|
|
5044
|
+
appearance: none;
|
|
5032
5045
|
}
|
|
5033
5046
|
.sx-tcce .sx__date-input-chevron {
|
|
5034
5047
|
width: 12px;
|
|
@@ -5038,9 +5051,8 @@ var eventCalendarStyles = `
|
|
|
5038
5051
|
|
|
5039
5052
|
/* Date picker popup (the calendar that drops when clicking the date input) */
|
|
5040
5053
|
.sx-tcce .sx__date-picker-popup {
|
|
5041
|
-
border-radius:
|
|
5054
|
+
border-radius: var(--border-radius-article, 0.875rem);
|
|
5042
5055
|
border: 1px solid var(--color-border);
|
|
5043
|
-
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
5044
5056
|
overflow: hidden;
|
|
5045
5057
|
font-size: 12px;
|
|
5046
5058
|
background: var(--color-background);
|
|
@@ -5127,6 +5139,7 @@ var eventCalendarStyles = `
|
|
|
5127
5139
|
display: flex;
|
|
5128
5140
|
align-items: center;
|
|
5129
5141
|
justify-content: center;
|
|
5142
|
+
transition: background 150ms;
|
|
5130
5143
|
}
|
|
5131
5144
|
|
|
5132
5145
|
/* Today highlight */
|
|
@@ -5152,6 +5165,7 @@ var eventCalendarStyles = `
|
|
|
5152
5165
|
font-weight: 500;
|
|
5153
5166
|
background-color: transparent !important;
|
|
5154
5167
|
border-inline-start-width: 3px !important;
|
|
5168
|
+
cursor: pointer;
|
|
5155
5169
|
}
|
|
5156
5170
|
.sx-tcce .sx__month-grid-event-time {
|
|
5157
5171
|
font-size: 10px;
|
|
@@ -5178,7 +5192,7 @@ var eventCalendarStyles = `
|
|
|
5178
5192
|
display: flex;
|
|
5179
5193
|
align-items: center;
|
|
5180
5194
|
justify-content: center;
|
|
5181
|
-
transition: background
|
|
5195
|
+
transition: background 150ms;
|
|
5182
5196
|
}
|
|
5183
5197
|
.sx-tcce .sx__week-grid__date--is-today .sx__week-grid__date-number {
|
|
5184
5198
|
background: var(--color-primary) !important;
|
|
@@ -5199,7 +5213,7 @@ var eventCalendarStyles = `
|
|
|
5199
5213
|
}
|
|
5200
5214
|
.sx-tcce .sx__time-grid-event {
|
|
5201
5215
|
border-radius: 6px;
|
|
5202
|
-
|
|
5216
|
+
cursor: pointer;
|
|
5203
5217
|
}
|
|
5204
5218
|
.sx-tcce .sx__time-grid-event-inner {
|
|
5205
5219
|
padding: 4px 7px;
|
|
@@ -5221,11 +5235,8 @@ var eventCalendarStyles = `
|
|
|
5221
5235
|
|
|
5222
5236
|
/* \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 */
|
|
5223
5237
|
.sx-tcce .sx__event-modal {
|
|
5224
|
-
border-radius:
|
|
5238
|
+
border-radius: var(--border-radius-article, 0.875rem);
|
|
5225
5239
|
border: 1px solid var(--color-border);
|
|
5226
|
-
box-shadow:
|
|
5227
|
-
0 4px 12px rgba(0, 0, 0, 0.08),
|
|
5228
|
-
0 12px 32px rgba(0, 0, 0, 0.1);
|
|
5229
5240
|
font-size: 13px;
|
|
5230
5241
|
min-width: 220px;
|
|
5231
5242
|
max-width: 300px;
|
|
@@ -5235,6 +5246,7 @@ var eventCalendarStyles = `
|
|
|
5235
5246
|
font-size: 14px;
|
|
5236
5247
|
font-weight: 700;
|
|
5237
5248
|
letter-spacing: -0.01em;
|
|
5249
|
+
font-family: var(--font-heading, inherit);
|
|
5238
5250
|
}
|
|
5239
5251
|
.sx-tcce .sx__event-modal__time {
|
|
5240
5252
|
font-size: 12px;
|
|
@@ -5351,10 +5363,11 @@ function useEventCalendar({
|
|
|
5351
5363
|
}
|
|
5352
5364
|
});
|
|
5353
5365
|
}
|
|
5366
|
+
const eventsKey = JSON.stringify(events);
|
|
5354
5367
|
useEffect(() => {
|
|
5355
5368
|
eventsMapRef.current = new Map(events.map((e) => [String(e.id), e]));
|
|
5356
5369
|
eventsService.current.set(events.map(toScheduleXEvent));
|
|
5357
|
-
}, [
|
|
5370
|
+
}, [eventsKey]);
|
|
5358
5371
|
useEffect(() => {
|
|
5359
5372
|
const app = calendarApp.current;
|
|
5360
5373
|
if (!app) return;
|