@orioncactuscorp/ui 1.9.2 → 1.11.0
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 +119 -54
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.js +169 -177
- package/dist/components/ActionArea/ActionAreaLayout.js +20 -24
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/Cell/Cell.js +57 -58
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +50 -51
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Menu/Menu.module.scss.js +20 -22
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +585 -575
- package/dist/components/Modal/bottomSheetGeometry.js +46 -33
- package/dist/components/Modal/modalScrollArbitration.js +71 -49
- package/dist/components/Modal/snapPoints.js +42 -38
- package/dist/components/Modal/useModalContentBlockTransition.js +49 -44
- package/dist/components/Modal/useModalDrag.js +937 -854
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +197 -200
- package/dist/components/Select/Select.js +31 -34
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.js +208 -0
- package/dist/components/Tabs/Tabs.module.scss.js +27 -0
- package/dist/components/Tabs.d.ts +6 -0
- package/dist/components/Tabs.js +8 -0
- package/dist/components/TextArea/TextArea.js +57 -58
- package/dist/components/TextInput/TextInput.js +30 -33
- package/dist/components/Tooltip/Tooltip.css +1 -1
- package/dist/foundations/color.theme.dark.css +1 -1
- package/dist/foundations/color.theme.light.css +1 -1
- package/dist/foundations/focus.css +1 -0
- package/dist/foundations/reset.css +1 -1
- package/dist/foundations.css +4 -3
- package/dist/index.js +69 -64
- package/dist/react/motion.js +31 -35
- package/dist/reset.css +1 -1
- package/dist/styles.css +14 -12
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts.map +1 -1
- package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/types.d.ts +10 -0
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/types.d.ts +16 -0
- package/dist/ui/src/components/Checkbox/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts +13 -0
- package/dist/ui/src/components/Modal/bottomSheetGeometry.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts +3 -1
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +8 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts +27 -10
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/Radio/types.d.ts +16 -0
- package/dist/ui/src/components/Radio/types.d.ts.map +1 -1
- package/dist/ui/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/ui/src/components/Select/Select.d.ts.map +1 -1
- package/dist/ui/src/components/Switch/types.d.ts +10 -0
- package/dist/ui/src/components/Switch/types.d.ts.map +1 -1
- package/dist/ui/src/components/Tabs/Tabs.d.ts +7 -0
- package/dist/ui/src/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/ui/src/components/Tabs/index.d.ts +3 -0
- package/dist/ui/src/components/Tabs/index.d.ts.map +1 -0
- package/dist/ui/src/components/Tabs/types.d.ts +26 -0
- package/dist/ui/src/components/Tabs/types.d.ts.map +1 -0
- package/dist/ui/src/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/ui/src/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +2 -0
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/react/motion/index.d.ts.map +1 -1
- package/dist/ui/src/utils/mergeRefs.d.ts +13 -0
- package/dist/ui/src/utils/mergeRefs.d.ts.map +1 -0
- package/dist/utils/mergeRefs.js +24 -0
- package/dist/vscode/oc-ui-vars.css +13 -0
- package/docs/editor-setup.md +42 -0
- package/docs/motion.md +665 -0
- package/docs/responsive-foundation-profile.md +230 -0
- package/docs/scss-helpers.md +189 -0
- package/docs/selector-contract.md +260 -0
- package/docs/spring.md +382 -0
- package/docs/stability.md +62 -0
- package/docs/tokens.md +559 -0
- package/package.json +9 -4
- package/src/scss/foundations/color-theme.test.ts +14 -0
- package/src/scss/foundations/color.theme.dark.scss +1 -0
- package/src/scss/foundations/color.theme.light.scss +1 -0
- package/src/scss/foundations/focus.scss +4 -0
- package/src/scss/foundations/focus.test.ts +48 -0
- package/src/scss/foundations/reset.scss +9 -4
- package/src/scss/foundations/reset.test.ts +32 -0
- package/src/scss/index.scss +2 -0
- package/src/scss/mixins/_focus.scss +11 -0
- package/src/scss/mixins/_focus.test.ts +58 -0
|
@@ -1,63 +1,60 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import { useRef as o } from "react";
|
|
4
|
-
import
|
|
5
|
-
import { useFieldContext as
|
|
6
|
-
import { useFieldControlOverlayMetrics as
|
|
7
|
-
import
|
|
4
|
+
import x from "@orioncactuscorp/icons/orioncactus/ChevronUpDown";
|
|
5
|
+
import { useFieldContext as y } from "../Field/Field.js";
|
|
6
|
+
import { useFieldControlOverlayMetrics as C } from "../Field/useFieldControlOverlayMetrics.js";
|
|
7
|
+
import { mergeRefs as z } from "../../utils/mergeRefs.js";
|
|
8
|
+
import d from "./Select.module.scss.js";
|
|
8
9
|
function M({
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
10
|
+
children: f,
|
|
11
|
+
className: p = "",
|
|
11
12
|
invalid: t = !1,
|
|
12
|
-
id:
|
|
13
|
-
leading:
|
|
14
|
-
placeholder:
|
|
15
|
-
ref:
|
|
16
|
-
trailing:
|
|
17
|
-
...
|
|
13
|
+
id: m,
|
|
14
|
+
leading: r,
|
|
15
|
+
placeholder: n,
|
|
16
|
+
ref: u,
|
|
17
|
+
trailing: i,
|
|
18
|
+
...v
|
|
18
19
|
}) {
|
|
19
|
-
const
|
|
20
|
-
|
|
20
|
+
const h = o(null), l = o(null), c = o(null), a = o(null), R = y(), g = m ?? R?.controlId;
|
|
21
|
+
return C({
|
|
21
22
|
metrics: [
|
|
22
23
|
{
|
|
23
24
|
property: "--oc-select-leading-content-size",
|
|
24
|
-
ref:
|
|
25
|
+
ref: c
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
property: "--oc-select-trailing-content-size",
|
|
28
|
-
ref:
|
|
29
|
+
ref: a
|
|
29
30
|
}
|
|
30
31
|
],
|
|
31
|
-
surfaceRef:
|
|
32
|
-
})
|
|
33
|
-
const g = (r) => {
|
|
34
|
-
R.current = r, typeof n == "function" ? n(r) : n && (n.current = r);
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ e(
|
|
32
|
+
surfaceRef: l
|
|
33
|
+
}), /* @__PURE__ */ e(
|
|
37
34
|
"div",
|
|
38
35
|
{
|
|
39
|
-
className: `${
|
|
36
|
+
className: `${d.select} ${t ? d.invalid : ""} ${p}`.trim(),
|
|
40
37
|
"data-invalid": t ? "" : void 0,
|
|
41
38
|
"data-oc-component": "select",
|
|
42
39
|
"data-oc-invalid": t ? "true" : void 0,
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ s("div", { ref: l, "data-oc-part": "content", children: [
|
|
41
|
+
r ? /* @__PURE__ */ e("span", { ref: c, "data-oc-part": "leading-content", children: r }) : null,
|
|
42
|
+
/* @__PURE__ */ s(
|
|
46
43
|
"select",
|
|
47
44
|
{
|
|
48
|
-
...
|
|
49
|
-
ref:
|
|
50
|
-
id:
|
|
45
|
+
...v,
|
|
46
|
+
ref: z(h, u),
|
|
47
|
+
id: g,
|
|
51
48
|
"aria-invalid": t || void 0,
|
|
52
49
|
"data-oc-part": "select",
|
|
53
50
|
children: [
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
n ? /* @__PURE__ */ e("option", { value: "", disabled: !0, children: n }) : null,
|
|
52
|
+
f
|
|
56
53
|
]
|
|
57
54
|
}
|
|
58
55
|
),
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ e("span", { "data-oc-part": "indicator", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
56
|
+
i ? /* @__PURE__ */ e("span", { ref: a, "data-oc-part": "trailing-content", children: i }) : null,
|
|
57
|
+
/* @__PURE__ */ e("span", { "data-oc-part": "indicator", "aria-hidden": "true", children: /* @__PURE__ */ e(x, { size: "custom" }) })
|
|
61
58
|
] })
|
|
62
59
|
}
|
|
63
60
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.oc-Switch-module__switch__PKzsW{font-size:calc(var(--oc-typo-size-body2) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body2) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body2);display:inline-flex;position:relative;align-items:flex-start;gap:.5em;opacity:1;color:var(--oc-color-theme-label-normal);transition:opacity calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1.5) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Switch-module__switch__PKzsW{transition-property:opacity;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * 1.5);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Switch-module__switch__PKzsW{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.oc-Switch-module__switch__PKzsW:has([data-oc-part=input]:disabled){opacity:var(--oc-color-global-opacity-43);cursor:not-allowed}.oc-Switch-module__switch__PKzsW{--oc-switch-track-width: 2.5rem;--oc-switch-track-height: 1.5rem;--oc-switch-thumb-size: 1rem;--oc-switch-thumb-translate: 1rem;--oc-switch-thumb-translate-checked: var(--oc-switch-thumb-translate);--oc-switch-track-color: var(--oc-color-theme-fill-normal);--oc-switch-track-z-index: var(--oc-zindex-1);--oc-switch-interaction-z-index: var(--oc-zindex-2);--oc-switch-thumb-z-index: calc(var(--oc-switch-interaction-z-index) + 1)}.oc-Switch-module__switch__PKzsW:dir(rtl){--oc-switch-thumb-translate-checked: calc(var(--oc-switch-thumb-translate) * -1)}.oc-Switch-module__small__LEHKf{font-size:calc(var(--oc-typo-size-body2) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body2) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body2);--oc-switch-control-size: var(--oc-typo-height-body2);--oc-switch-content-height: var(--oc-typo-height-body2);--oc-switch-track-width: 2rem;--oc-switch-track-height: 1.25rem;--oc-switch-thumb-size: .875rem;--oc-switch-thumb-translate: .75rem}.oc-Switch-module__medium__rpPKx{font-size:calc(var(--oc-typo-size-body1) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body1) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body1);--oc-switch-control-size: var(--oc-typo-height-body1);--oc-switch-content-height: var(--oc-typo-height-body1)}.oc-Switch-module__switch__PKzsW [data-oc-part=input]{position:absolute;opacity:0;pointer-events:none;inline-size:0;block-size:0}.oc-Switch-module__switch__PKzsW [data-oc-part=container]{display:flex;position:relative;flex-shrink:0;align-items:center;isolation:isolate;overflow:hidden;border-radius:var(--oc-atomic-radius-max);padding-block:calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);inline-size:var(--oc-switch-track-width);block-size:var(--oc-switch-control-size);--oc-interaction-inset-y: calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);--oc-interaction-z-index: var(--oc-switch-interaction-z-index);--oc-interaction-radius: var(--oc-atomic-radius-max)}.oc-Switch-module__switch__PKzsW [data-oc-part=thumb]{position:absolute;z-index:var(--oc-switch-thumb-z-index);inset-block-start:calc((var(--oc-switch-control-size) - var(--oc-switch-thumb-size)) / 2);inset-inline-start:calc((var(--oc-switch-track-height) - var(--oc-switch-thumb-size)) / 2);transform:translate(0);border-radius:var(--oc-atomic-radius-max);background-color:var(--oc-color-theme-static-white);inline-size:var(--oc-switch-thumb-size);block-size:var(--oc-switch-thumb-size);transition:transform calc(.561s * var(--oc-motion-duration-factor) * var(--oc-motion-pace-quick) * 1) linear(0 0%,.0045 .83%,.0168 1.67%,.0356 2.5%,.0593 3.33%,.0871 4.17%,.1178 5%,.1507 5.83%,.1852 6.67%,.2207 7.5%,.2566 8.33%,.2926 9.17%,.3283 10%,.3635 10.83%,.398 11.67%,.4316 12.5%,.4642 13.33%,.4957 14.17%,.5259 15%,.5549 15.83%,.5826 16.67%,.609 17.5%,.6341 18.33%,.6579 19.17%,.6805 20%,.7018 20.83%,.722 21.67%,.7409 22.5%,.7588 23.33%,.7756 24.17%,.7913 25%,.8061 25.83%,.8199 26.67%,.8328 27.5%,.8449 28.33%,.8562 29.17%,.8667 30%,.8765 30.83%,.8857 31.67%,.8942 32.5%,.9021 33.33%,.9095 34.17%,.9163 35%,.9227 35.83%,.9286 36.67%,.934 37.5%,.9391 38.33%,.9438 39.17%,.9481 40%,.9522 40.83%,.9559 41.67%,.9594 42.5%,.9625 43.33%,.9655 44.17%,.9682 45%,.9707 45.83%,.9731 46.67%,.9752 47.5%,.9772 48.33%,.979 49.17%,.9807 50%,.9822 50.83%,.9837 51.67%,.985 52.5%,.9862 53.33%,.9873 54.17%,.9883 55%,.9893 55.83%,.9902 56.67%,.991 57.5%,.9917 58.33%,.9924 59.17%,.993 60%,.9936 60.83%,.9941 61.67%,.9946 62.5%,.995 63.33%,.9955 64.17%,.9958 65%,.9962 65.83%,.9965 66.67%,.9968 67.5%,.9971 68.33%,.9973 69.17%,.9975 70%,.9977 70.83%,.9979 71.67%,.9981 72.5%,.9983 73.33%,.9984 74.17%,.9985 75%,.9987 75.83%,.9988 76.67%,.9989 77.5%,.999 78.33%,.9991 79.17%,.9991 80%,.9992 80.83%,.9993 81.67%,.9993 82.5%,.9994 83.33%,.9994 84.17%,.9995 85%,.9995 85.83%,.9996 86.67%,.9996 87.5%,.9996 88.33%,.9997 89.17%,.9997 90%,.9997 90.83%,.9998 91.67%,.9998 92.5%,.9998 93.33%,.9998 94.17%,.9998 95%,.9998 95.83%,.9999 96.67%,.9999 97.5%,.9999 98.33%,.9999 99.17%,1 100%)}@media(prefers-reduced-motion:reduce){.oc-Switch-module__switch__PKzsW [data-oc-part=thumb]{transition-duration:calc(var(--oc-motion-duration-move) * var(--oc-motion-duration-factor-preserve) * var(--oc-motion-pace-quick) * 1);transition-timing-function:var(--oc-motion-timing-move)}}.oc-Switch-module__switch__PKzsW [data-oc-part=thumb]{pointer-events:none}.oc-Switch-module__switch__PKzsW [data-oc-part=container]>[data-oc-component=interaction]{inset-block:calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);inset-inline:0;inline-size:100%;block-size:var(--oc-switch-track-height)}.oc-Switch-module__switch__PKzsW [data-oc-part=container]:before{position:absolute;z-index:var(--oc-switch-track-z-index);inset-block:calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);inset-inline:0;border-radius:inherit;background-color:var(--oc-switch-track-color);content:"";transition:background-color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Switch-module__switch__PKzsW [data-oc-part=container]:before{transition-property:background-color;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * 1);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Switch-module__switch__PKzsW [data-oc-part=content]{display:flex;flex:1;align-items:flex-start;min-inline-size:0;padding-block:calc((var(--oc-switch-control-size) - var(--oc-switch-content-height)) / 2)}.oc-Switch-module__switch__PKzsW [data-oc-part=label]{-webkit-user-select:none;user-select:none}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:checked+[data-oc-part=container]{--oc-switch-track-color: var(--oc-color-theme-primary-normal)}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:checked+[data-oc-part=container] [data-oc-part=thumb]{transform:translate(var(--oc-switch-thumb-translate-checked))}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:disabled+[data-oc-part=container]{--oc-switch-track-color: var(--oc-color-theme-fill-alternative)}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:focus-visible+[data-oc-part=container]{outline:
|
|
1
|
+
.oc-Switch-module__switch__PKzsW{font-size:calc(var(--oc-typo-size-body2) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body2) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body2);display:inline-flex;position:relative;align-items:flex-start;gap:.5em;opacity:1;color:var(--oc-color-theme-label-normal);transition:opacity calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1.5) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Switch-module__switch__PKzsW{transition-property:opacity;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * 1.5);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Switch-module__switch__PKzsW{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.oc-Switch-module__switch__PKzsW:has([data-oc-part=input]:disabled){opacity:var(--oc-color-global-opacity-43);cursor:not-allowed}.oc-Switch-module__switch__PKzsW{--oc-switch-track-width: 2.5rem;--oc-switch-track-height: 1.5rem;--oc-switch-thumb-size: 1rem;--oc-switch-thumb-translate: 1rem;--oc-switch-thumb-translate-checked: var(--oc-switch-thumb-translate);--oc-switch-track-color: var(--oc-color-theme-fill-normal);--oc-switch-track-z-index: var(--oc-zindex-1);--oc-switch-interaction-z-index: var(--oc-zindex-2);--oc-switch-thumb-z-index: calc(var(--oc-switch-interaction-z-index) + 1)}.oc-Switch-module__switch__PKzsW:dir(rtl){--oc-switch-thumb-translate-checked: calc(var(--oc-switch-thumb-translate) * -1)}.oc-Switch-module__small__LEHKf{font-size:calc(var(--oc-typo-size-body2) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body2) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body2);--oc-switch-control-size: var(--oc-typo-height-body2);--oc-switch-content-height: var(--oc-typo-height-body2);--oc-switch-track-width: 2rem;--oc-switch-track-height: 1.25rem;--oc-switch-thumb-size: .875rem;--oc-switch-thumb-translate: .75rem}.oc-Switch-module__medium__rpPKx{font-size:calc(var(--oc-typo-size-body1) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body1) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body1);--oc-switch-control-size: var(--oc-typo-height-body1);--oc-switch-content-height: var(--oc-typo-height-body1)}.oc-Switch-module__switch__PKzsW [data-oc-part=input]{position:absolute;opacity:0;pointer-events:none;inline-size:0;block-size:0}.oc-Switch-module__switch__PKzsW [data-oc-part=container]{display:flex;position:relative;flex-shrink:0;align-items:center;isolation:isolate;overflow:hidden;border-radius:var(--oc-atomic-radius-max);padding-block:calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);inline-size:var(--oc-switch-track-width);block-size:var(--oc-switch-control-size);--oc-interaction-inset-y: calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);--oc-interaction-z-index: var(--oc-switch-interaction-z-index);--oc-interaction-radius: var(--oc-atomic-radius-max)}.oc-Switch-module__switch__PKzsW [data-oc-part=thumb]{position:absolute;z-index:var(--oc-switch-thumb-z-index);inset-block-start:calc((var(--oc-switch-control-size) - var(--oc-switch-thumb-size)) / 2);inset-inline-start:calc((var(--oc-switch-track-height) - var(--oc-switch-thumb-size)) / 2);transform:translate(0);border-radius:var(--oc-atomic-radius-max);background-color:var(--oc-color-theme-static-white);inline-size:var(--oc-switch-thumb-size);block-size:var(--oc-switch-thumb-size);transition:transform calc(.561s * var(--oc-motion-duration-factor) * var(--oc-motion-pace-quick) * 1) linear(0 0%,.0045 .83%,.0168 1.67%,.0356 2.5%,.0593 3.33%,.0871 4.17%,.1178 5%,.1507 5.83%,.1852 6.67%,.2207 7.5%,.2566 8.33%,.2926 9.17%,.3283 10%,.3635 10.83%,.398 11.67%,.4316 12.5%,.4642 13.33%,.4957 14.17%,.5259 15%,.5549 15.83%,.5826 16.67%,.609 17.5%,.6341 18.33%,.6579 19.17%,.6805 20%,.7018 20.83%,.722 21.67%,.7409 22.5%,.7588 23.33%,.7756 24.17%,.7913 25%,.8061 25.83%,.8199 26.67%,.8328 27.5%,.8449 28.33%,.8562 29.17%,.8667 30%,.8765 30.83%,.8857 31.67%,.8942 32.5%,.9021 33.33%,.9095 34.17%,.9163 35%,.9227 35.83%,.9286 36.67%,.934 37.5%,.9391 38.33%,.9438 39.17%,.9481 40%,.9522 40.83%,.9559 41.67%,.9594 42.5%,.9625 43.33%,.9655 44.17%,.9682 45%,.9707 45.83%,.9731 46.67%,.9752 47.5%,.9772 48.33%,.979 49.17%,.9807 50%,.9822 50.83%,.9837 51.67%,.985 52.5%,.9862 53.33%,.9873 54.17%,.9883 55%,.9893 55.83%,.9902 56.67%,.991 57.5%,.9917 58.33%,.9924 59.17%,.993 60%,.9936 60.83%,.9941 61.67%,.9946 62.5%,.995 63.33%,.9955 64.17%,.9958 65%,.9962 65.83%,.9965 66.67%,.9968 67.5%,.9971 68.33%,.9973 69.17%,.9975 70%,.9977 70.83%,.9979 71.67%,.9981 72.5%,.9983 73.33%,.9984 74.17%,.9985 75%,.9987 75.83%,.9988 76.67%,.9989 77.5%,.999 78.33%,.9991 79.17%,.9991 80%,.9992 80.83%,.9993 81.67%,.9993 82.5%,.9994 83.33%,.9994 84.17%,.9995 85%,.9995 85.83%,.9996 86.67%,.9996 87.5%,.9996 88.33%,.9997 89.17%,.9997 90%,.9997 90.83%,.9998 91.67%,.9998 92.5%,.9998 93.33%,.9998 94.17%,.9998 95%,.9998 95.83%,.9999 96.67%,.9999 97.5%,.9999 98.33%,.9999 99.17%,1 100%)}@media(prefers-reduced-motion:reduce){.oc-Switch-module__switch__PKzsW [data-oc-part=thumb]{transition-duration:calc(var(--oc-motion-duration-move) * var(--oc-motion-duration-factor-preserve) * var(--oc-motion-pace-quick) * 1);transition-timing-function:var(--oc-motion-timing-move)}}.oc-Switch-module__switch__PKzsW [data-oc-part=thumb]{pointer-events:none}.oc-Switch-module__switch__PKzsW [data-oc-part=container]>[data-oc-component=interaction]{inset-block:calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);inset-inline:0;inline-size:100%;block-size:var(--oc-switch-track-height)}.oc-Switch-module__switch__PKzsW [data-oc-part=container]:before{position:absolute;z-index:var(--oc-switch-track-z-index);inset-block:calc((var(--oc-switch-control-size) - var(--oc-switch-track-height)) / 2);inset-inline:0;border-radius:inherit;background-color:var(--oc-switch-track-color);content:"";transition:background-color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Switch-module__switch__PKzsW [data-oc-part=container]:before{transition-property:background-color;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * 1);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Switch-module__switch__PKzsW [data-oc-part=content]{display:flex;flex:1;align-items:flex-start;min-inline-size:0;padding-block:calc((var(--oc-switch-control-size) - var(--oc-switch-content-height)) / 2)}.oc-Switch-module__switch__PKzsW [data-oc-part=label]{-webkit-user-select:none;user-select:none}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:checked+[data-oc-part=container]{--oc-switch-track-color: var(--oc-color-theme-primary-normal)}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:checked+[data-oc-part=container] [data-oc-part=thumb]{transform:translate(var(--oc-switch-thumb-translate-checked))}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:disabled+[data-oc-part=container]{--oc-switch-track-color: var(--oc-color-theme-fill-alternative)}.oc-Switch-module__switch__PKzsW [data-oc-part=input]:focus-visible+[data-oc-part=container]{outline:var(--oc-focus-ring-width) solid var(--oc-color-theme-focus-ring);outline-offset:var(--oc-focus-ring-offset)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@property --oc-tabs-internal-edge-fade-start-size{syntax: "<length>"; inherits: false; initial-value: 0;}@property --oc-tabs-internal-edge-fade-end-size{syntax: "<length>"; inherits: false; initial-value: 0;}.oc-Tabs-module__root__2x4fl{min-width:0;--oc-tabs-list-padding-block: 0px;--oc-tabs-tab-interaction-margin-inline: var(--oc-space-item-padding-xsmall);--oc-tabs-edge-fade-size: 3rem;--oc-tabs-indicator-block-size: .125rem;--oc-tabs-indicator-radius: var(--oc-atomic-radius-max);--oc-tabs-indicator-color: var(--oc-color-theme-label-strong);--oc-tabs-indicator-disabled-color: var(--oc-color-theme-label-disable);--oc-tabs-label-color: var(--oc-color-theme-label-assistive);--oc-tabs-label-hover-color: var(--oc-color-theme-label-alternative);--oc-tabs-label-selected-color: var(--oc-color-theme-label-strong);--oc-tabs-label-disabled-color: var(--oc-color-theme-label-disable)}.oc-Tabs-module__listFrame__TrGoN{display:flex;align-items:stretch;min-width:0}.oc-Tabs-module__scroller__QIrMA{flex:1 1 auto;min-width:0;overflow-x:auto;scroll-padding-inline:calc(var(--oc-tabs-edge-fade-size) + var(--oc-tabs-tab-interaction-margin-inline));scrollbar-width:none;-webkit-mask-image:linear-gradient(to right,transparent 0,black var(--oc-tabs-internal-edge-fade-start-size),black calc(100% - var(--oc-tabs-internal-edge-fade-end-size)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,black var(--oc-tabs-internal-edge-fade-start-size),black calc(100% - var(--oc-tabs-internal-edge-fade-end-size)),transparent 100%);transition:--oc-tabs-internal-edge-fade-start-size calc(var(--oc-motion-duration-fade) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-quick) * 1) var(--oc-motion-timing-fade),--oc-tabs-internal-edge-fade-end-size calc(var(--oc-motion-duration-fade) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-quick) * 1) var(--oc-motion-timing-fade)}@media(prefers-reduced-motion:reduce){.oc-Tabs-module__scroller__QIrMA{transition:none}}.oc-Tabs-module__scroller__QIrMA::-webkit-scrollbar{display:none}.oc-Tabs-module__scroller__QIrMA:where(.oc-Tabs-module__fadeStart__1YF2D){--oc-tabs-internal-edge-fade-start-size: var(--oc-tabs-edge-fade-size)}.oc-Tabs-module__scroller__QIrMA:where(.oc-Tabs-module__fadeEnd__g9-ts){--oc-tabs-internal-edge-fade-end-size: var(--oc-tabs-edge-fade-size)}.oc-Tabs-module__scroller__QIrMA:dir(rtl){-webkit-mask-image:linear-gradient(to right,transparent 0,black var(--oc-tabs-internal-edge-fade-end-size),black calc(100% - var(--oc-tabs-internal-edge-fade-start-size)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,black var(--oc-tabs-internal-edge-fade-end-size),black calc(100% - var(--oc-tabs-internal-edge-fade-start-size)),transparent 100%)}.oc-Tabs-module__list__6iAKX{--_-tabs-default-list-padding-inline: 0px;position:relative;display:flex;align-items:stretch;margin:0;padding-block:var(--oc-tabs-list-padding-block);padding-inline:var(--oc-tabs-list-padding-inline, var(--_-tabs-default-list-padding-inline));overflow-x:clip;column-gap:var(--oc-tabs-list-gap, calc(var(--oc-tabs-tab-interaction-margin-inline) + var(--oc-tabs-tab-interaction-margin-inline)));inline-size:max-content;min-inline-size:100%}.oc-Tabs-module__list__6iAKX[data-oc-padding=true]{--_-tabs-default-list-padding-inline: var(--oc-space-section-padding-viewport-x)}.oc-Tabs-module__list__6iAKX[data-oc-size=large],.oc-Tabs-module__list__6iAKX[data-oc-size=medium]{--_-tabs-default-tab-padding-block: var(--oc-space-item-padding-mini)}.oc-Tabs-module__list__6iAKX[data-oc-size=small]{--_-tabs-default-tab-padding-block: var(--oc-space-item-padding-tiny)}.oc-Tabs-module__list__6iAKX[data-oc-full-width=true]>[data-oc-part=tab]{flex:1 1 0;min-inline-size:0}.oc-Tabs-module__list__6iAKX:has(>[data-oc-part=tab][aria-selected=true][aria-disabled=true])>[data-oc-part=indicator]{background-color:var(--oc-tabs-indicator-disabled-color)}.oc-Tabs-module__tab__LYqhc{position:relative;isolation:isolate;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;appearance:none;margin:0;border:0;background:transparent;padding-block:var(--oc-tabs-tab-padding-block, var(--_-tabs-default-tab-padding-block));padding-inline:0;font:inherit;letter-spacing:inherit;color:var(--oc-tabs-label-color);text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;transition:color calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor) * var(--oc-motion-pace-normal) * 1) var(--oc-motion-timing-feedback)}@media(prefers-reduced-motion:reduce){.oc-Tabs-module__tab__LYqhc{transition-property:color;transition-duration:calc(var(--oc-motion-duration-feedback) * var(--oc-motion-duration-factor-reduced) * var(--oc-motion-pace-normal) * 1);transition-timing-function:var(--oc-motion-timing-feedback)}}.oc-Tabs-module__tab__LYqhc{--oc-interaction-color: transparent;--oc-interaction-inset-x: calc(0px - var(--oc-tabs-tab-interaction-margin-inline))}.oc-Tabs-module__tab__LYqhc[aria-selected=true]{color:var(--oc-tabs-label-selected-color)}.oc-Tabs-module__tab__LYqhc[aria-disabled=true]{color:var(--oc-tabs-label-disabled-color);cursor:not-allowed}.oc-Tabs-module__tab__LYqhc[aria-disabled=true]>[data-oc-component=interaction]{pointer-events:none}@media(hover:hover){.oc-Tabs-module__tab__LYqhc:hover:not([aria-selected=true],[aria-disabled=true]){color:var(--oc-tabs-label-hover-color)}.oc-Tabs-module__tab__LYqhc:hover:not([aria-disabled=true])>[data-oc-component=interaction]{opacity:var(--oc-interaction-opacity-hover);transform:scale(1)}}.oc-Tabs-module__tab__LYqhc:active:not([aria-disabled=true])>[data-oc-component=interaction]{opacity:var(--oc-interaction-opacity-active);transform:scale(1)}:where(.oc-Tabs-module__list__6iAKX[data-oc-size=large]){font-size:calc(var(--oc-typo-size-headline2) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-headline2) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-headline2);font-weight:var(--oc-typo-weight-headline2-bold)}:where(.oc-Tabs-module__list__6iAKX[data-oc-size=medium]){font-size:calc(var(--oc-typo-size-body1) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body1) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body1);font-weight:var(--oc-typo-weight-body1-bold)}:where(.oc-Tabs-module__list__6iAKX[data-oc-size=small]){font-size:calc(var(--oc-typo-size-body2) * var(--oc-typo-size-factor, 1));line-height:calc(var(--oc-typo-height-body2) * var(--oc-typo-size-factor, 1));letter-spacing:var(--oc-typo-spacing-body2);font-weight:var(--oc-typo-weight-body2-bold)}.oc-Tabs-module__label__dkYH9{position:relative;z-index:2;overflow:hidden;min-width:0;text-overflow:ellipsis}.oc-Tabs-module__indicator__b8TYY{position:absolute;inset-block-end:var(--oc-tabs-list-padding-block);left:0;z-index:2;inline-size:var(--active-tab-width);block-size:var(--oc-tabs-indicator-block-size);background-color:var(--oc-tabs-indicator-color);border-radius:var(--oc-tabs-indicator-radius);transform:translate(var(--active-tab-left));pointer-events:none;transition:transform calc(.561s * var(--oc-motion-duration-factor) * var(--oc-motion-pace-quick) * 1) linear(0 0%,.0045 .83%,.0168 1.67%,.0356 2.5%,.0593 3.33%,.0871 4.17%,.1178 5%,.1507 5.83%,.1852 6.67%,.2207 7.5%,.2566 8.33%,.2926 9.17%,.3283 10%,.3635 10.83%,.398 11.67%,.4316 12.5%,.4642 13.33%,.4957 14.17%,.5259 15%,.5549 15.83%,.5826 16.67%,.609 17.5%,.6341 18.33%,.6579 19.17%,.6805 20%,.7018 20.83%,.722 21.67%,.7409 22.5%,.7588 23.33%,.7756 24.17%,.7913 25%,.8061 25.83%,.8199 26.67%,.8328 27.5%,.8449 28.33%,.8562 29.17%,.8667 30%,.8765 30.83%,.8857 31.67%,.8942 32.5%,.9021 33.33%,.9095 34.17%,.9163 35%,.9227 35.83%,.9286 36.67%,.934 37.5%,.9391 38.33%,.9438 39.17%,.9481 40%,.9522 40.83%,.9559 41.67%,.9594 42.5%,.9625 43.33%,.9655 44.17%,.9682 45%,.9707 45.83%,.9731 46.67%,.9752 47.5%,.9772 48.33%,.979 49.17%,.9807 50%,.9822 50.83%,.9837 51.67%,.985 52.5%,.9862 53.33%,.9873 54.17%,.9883 55%,.9893 55.83%,.9902 56.67%,.991 57.5%,.9917 58.33%,.9924 59.17%,.993 60%,.9936 60.83%,.9941 61.67%,.9946 62.5%,.995 63.33%,.9955 64.17%,.9958 65%,.9962 65.83%,.9965 66.67%,.9968 67.5%,.9971 68.33%,.9973 69.17%,.9975 70%,.9977 70.83%,.9979 71.67%,.9981 72.5%,.9983 73.33%,.9984 74.17%,.9985 75%,.9987 75.83%,.9988 76.67%,.9989 77.5%,.999 78.33%,.9991 79.17%,.9991 80%,.9992 80.83%,.9993 81.67%,.9993 82.5%,.9994 83.33%,.9994 84.17%,.9995 85%,.9995 85.83%,.9996 86.67%,.9996 87.5%,.9996 88.33%,.9997 89.17%,.9997 90%,.9997 90.83%,.9998 91.67%,.9998 92.5%,.9998 93.33%,.9998 94.17%,.9998 95%,.9998 95.83%,.9999 96.67%,.9999 97.5%,.9999 98.33%,.9999 99.17%,1 100%),inline-size calc(.561s * var(--oc-motion-duration-factor) * var(--oc-motion-pace-quick) * 1) linear(0 0%,.0045 .83%,.0168 1.67%,.0356 2.5%,.0593 3.33%,.0871 4.17%,.1178 5%,.1507 5.83%,.1852 6.67%,.2207 7.5%,.2566 8.33%,.2926 9.17%,.3283 10%,.3635 10.83%,.398 11.67%,.4316 12.5%,.4642 13.33%,.4957 14.17%,.5259 15%,.5549 15.83%,.5826 16.67%,.609 17.5%,.6341 18.33%,.6579 19.17%,.6805 20%,.7018 20.83%,.722 21.67%,.7409 22.5%,.7588 23.33%,.7756 24.17%,.7913 25%,.8061 25.83%,.8199 26.67%,.8328 27.5%,.8449 28.33%,.8562 29.17%,.8667 30%,.8765 30.83%,.8857 31.67%,.8942 32.5%,.9021 33.33%,.9095 34.17%,.9163 35%,.9227 35.83%,.9286 36.67%,.934 37.5%,.9391 38.33%,.9438 39.17%,.9481 40%,.9522 40.83%,.9559 41.67%,.9594 42.5%,.9625 43.33%,.9655 44.17%,.9682 45%,.9707 45.83%,.9731 46.67%,.9752 47.5%,.9772 48.33%,.979 49.17%,.9807 50%,.9822 50.83%,.9837 51.67%,.985 52.5%,.9862 53.33%,.9873 54.17%,.9883 55%,.9893 55.83%,.9902 56.67%,.991 57.5%,.9917 58.33%,.9924 59.17%,.993 60%,.9936 60.83%,.9941 61.67%,.9946 62.5%,.995 63.33%,.9955 64.17%,.9958 65%,.9962 65.83%,.9965 66.67%,.9968 67.5%,.9971 68.33%,.9973 69.17%,.9975 70%,.9977 70.83%,.9979 71.67%,.9981 72.5%,.9983 73.33%,.9984 74.17%,.9985 75%,.9987 75.83%,.9988 76.67%,.9989 77.5%,.999 78.33%,.9991 79.17%,.9991 80%,.9992 80.83%,.9993 81.67%,.9993 82.5%,.9994 83.33%,.9994 84.17%,.9995 85%,.9995 85.83%,.9996 86.67%,.9996 87.5%,.9996 88.33%,.9997 89.17%,.9997 90%,.9997 90.83%,.9998 91.67%,.9998 92.5%,.9998 93.33%,.9998 94.17%,.9998 95%,.9998 95.83%,.9999 96.67%,.9999 97.5%,.9999 98.33%,.9999 99.17%,1 100%)}@media(prefers-reduced-motion:reduce){.oc-Tabs-module__indicator__b8TYY{transition:none;transform:none}}@media(prefers-reduced-motion:reduce){.oc-Tabs-module__indicator__b8TYY{left:var(--active-tab-left)}}.oc-Tabs-module__trailing__qkYPl{position:relative;z-index:3;display:inline-flex;flex:none;align-items:center}.oc-Tabs-module__panel__0OUR6{min-width:0}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs as _, jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { useState as O, useMemo as M, useCallback as C, useEffect as P } from "react";
|
|
4
|
+
import { Tabs as v } from "@base-ui-components/react/tabs";
|
|
5
|
+
import { DirectionProvider as z } from "@base-ui-components/react/direction-provider";
|
|
6
|
+
import j from "../Interaction/Interaction.js";
|
|
7
|
+
import { mergeRefs as D } from "../../utils/mergeRefs.js";
|
|
8
|
+
import o from "./Tabs.module.scss.js";
|
|
9
|
+
const h = 1, T = {
|
|
10
|
+
inlineStart: !1,
|
|
11
|
+
inlineEnd: !1
|
|
12
|
+
};
|
|
13
|
+
function S(...e) {
|
|
14
|
+
return e.filter(Boolean).join(" ");
|
|
15
|
+
}
|
|
16
|
+
function H(e, n) {
|
|
17
|
+
if (!e || !n) return T;
|
|
18
|
+
const a = e.getBoundingClientRect(), t = n.getBoundingClientRect(), i = t.left < a.left - h, l = t.right > a.right + h;
|
|
19
|
+
return getComputedStyle(e).direction === "rtl" ? { inlineStart: l, inlineEnd: i } : { inlineStart: i, inlineEnd: l };
|
|
20
|
+
}
|
|
21
|
+
function k(e, n) {
|
|
22
|
+
return e.inlineStart === n.inlineStart && e.inlineEnd === n.inlineEnd ? e : n;
|
|
23
|
+
}
|
|
24
|
+
function q(e, n) {
|
|
25
|
+
const a = e.getBoundingClientRect(), t = n.parentElement?.getBoundingClientRect(), i = n.getBoundingClientRect(), l = getComputedStyle(e), s = !!(t && t.left < a.left - h), c = !!(t && t.right > a.right + h), d = s && Number.parseFloat(l.scrollPaddingLeft) || 0, u = c && Number.parseFloat(l.scrollPaddingRight) || 0;
|
|
26
|
+
let r = 0;
|
|
27
|
+
i.left < a.left + d ? r = i.left - (a.left + d) : i.right > a.right - u && (r = i.right - (a.right - u)), !(Math.abs(r) <= h) && e.scrollBy({
|
|
28
|
+
left: r,
|
|
29
|
+
behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function U({
|
|
33
|
+
children: e,
|
|
34
|
+
className: n = "",
|
|
35
|
+
defaultValue: a,
|
|
36
|
+
dir: t,
|
|
37
|
+
onValueChange: i,
|
|
38
|
+
ref: l,
|
|
39
|
+
value: s,
|
|
40
|
+
...c
|
|
41
|
+
}) {
|
|
42
|
+
const d = C(
|
|
43
|
+
(r, p) => {
|
|
44
|
+
typeof r == "string" && i?.(r, p);
|
|
45
|
+
},
|
|
46
|
+
[i]
|
|
47
|
+
), u = /* @__PURE__ */ m(
|
|
48
|
+
v.Root,
|
|
49
|
+
{
|
|
50
|
+
...c,
|
|
51
|
+
ref: l,
|
|
52
|
+
className: S(o.root, n),
|
|
53
|
+
value: s,
|
|
54
|
+
defaultValue: a ?? null,
|
|
55
|
+
onValueChange: d,
|
|
56
|
+
dir: t,
|
|
57
|
+
"data-oc-component": "tabs",
|
|
58
|
+
children: e
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
return t === "ltr" || t === "rtl" ? /* @__PURE__ */ m(z, { direction: t, children: u }) : u;
|
|
62
|
+
}
|
|
63
|
+
function Y(e) {
|
|
64
|
+
const {
|
|
65
|
+
activateOnFocus: n = !0,
|
|
66
|
+
"aria-orientation": a,
|
|
67
|
+
children: t,
|
|
68
|
+
className: i = "",
|
|
69
|
+
fullWidth: l = !1,
|
|
70
|
+
loopFocus: s = !0,
|
|
71
|
+
padding: c = !1,
|
|
72
|
+
ref: d,
|
|
73
|
+
role: u,
|
|
74
|
+
size: r = "medium",
|
|
75
|
+
tabIndex: p,
|
|
76
|
+
trailing: L,
|
|
77
|
+
...E
|
|
78
|
+
} = e, [f, F] = O(null), [b, A] = O(null), [B, x] = O(T), w = M(
|
|
79
|
+
() => D(F, d),
|
|
80
|
+
[d]
|
|
81
|
+
), N = C(() => {
|
|
82
|
+
x(
|
|
83
|
+
(g) => k(
|
|
84
|
+
g,
|
|
85
|
+
H(b, f)
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
}, [f, b]), R = C(() => {
|
|
89
|
+
if (!f || !b) return;
|
|
90
|
+
const g = f.querySelector("[data-active]");
|
|
91
|
+
g && q(b, g), N();
|
|
92
|
+
}, [f, b, N]);
|
|
93
|
+
return P(() => {
|
|
94
|
+
if (!f || !b) return;
|
|
95
|
+
const g = requestAnimationFrame(R), I = typeof MutationObserver > "u" ? void 0 : new MutationObserver(R), y = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(R);
|
|
96
|
+
return I?.observe(f, {
|
|
97
|
+
attributes: !0,
|
|
98
|
+
attributeFilter: ["data-active"],
|
|
99
|
+
subtree: !0
|
|
100
|
+
}), y?.observe(b), y?.observe(f), () => {
|
|
101
|
+
cancelAnimationFrame(g), I?.disconnect(), y?.disconnect();
|
|
102
|
+
};
|
|
103
|
+
}, [f, b, R]), /* @__PURE__ */ _("div", { className: o.listFrame, children: [
|
|
104
|
+
/* @__PURE__ */ m(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
ref: A,
|
|
108
|
+
className: S(
|
|
109
|
+
o.scroller,
|
|
110
|
+
B.inlineStart && o.fadeStart,
|
|
111
|
+
B.inlineEnd && o.fadeEnd
|
|
112
|
+
),
|
|
113
|
+
"data-oc-part": "scroller",
|
|
114
|
+
onScroll: N,
|
|
115
|
+
children: /* @__PURE__ */ _(
|
|
116
|
+
v.List,
|
|
117
|
+
{
|
|
118
|
+
...E,
|
|
119
|
+
ref: w,
|
|
120
|
+
className: S(o.list, i),
|
|
121
|
+
activateOnFocus: n,
|
|
122
|
+
loopFocus: s,
|
|
123
|
+
"data-oc-part": "list",
|
|
124
|
+
"data-oc-size": r,
|
|
125
|
+
"data-oc-full-width": l ? "true" : "false",
|
|
126
|
+
"data-oc-padding": c ? "true" : "false",
|
|
127
|
+
children: [
|
|
128
|
+
t,
|
|
129
|
+
/* @__PURE__ */ m(
|
|
130
|
+
v.Indicator,
|
|
131
|
+
{
|
|
132
|
+
className: o.indicator,
|
|
133
|
+
renderBeforeHydration: !0,
|
|
134
|
+
"data-oc-part": "indicator"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
L ? /* @__PURE__ */ m("div", { className: o.trailing, "data-oc-part": "trailing", children: L }) : null
|
|
143
|
+
] });
|
|
144
|
+
}
|
|
145
|
+
function Z(e) {
|
|
146
|
+
const {
|
|
147
|
+
"aria-controls": n,
|
|
148
|
+
"aria-disabled": a,
|
|
149
|
+
"aria-selected": t,
|
|
150
|
+
children: i,
|
|
151
|
+
className: l = "",
|
|
152
|
+
disabled: s = !1,
|
|
153
|
+
ref: c,
|
|
154
|
+
role: d,
|
|
155
|
+
tabIndex: u,
|
|
156
|
+
value: r,
|
|
157
|
+
...p
|
|
158
|
+
} = e;
|
|
159
|
+
return /* @__PURE__ */ _(
|
|
160
|
+
v.Tab,
|
|
161
|
+
{
|
|
162
|
+
...p,
|
|
163
|
+
ref: c,
|
|
164
|
+
className: S(o.tab, l),
|
|
165
|
+
value: r,
|
|
166
|
+
disabled: s,
|
|
167
|
+
"data-oc-part": "tab",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ m("span", { className: o.label, "data-oc-part": "label", children: i }),
|
|
170
|
+
/* @__PURE__ */ m(j, { self: !0 })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function $(e) {
|
|
176
|
+
const {
|
|
177
|
+
"aria-labelledby": n,
|
|
178
|
+
children: a,
|
|
179
|
+
className: t = "",
|
|
180
|
+
hidden: i,
|
|
181
|
+
id: l,
|
|
182
|
+
keepMounted: s = !1,
|
|
183
|
+
ref: c,
|
|
184
|
+
role: d,
|
|
185
|
+
tabIndex: u,
|
|
186
|
+
value: r,
|
|
187
|
+
...p
|
|
188
|
+
} = e;
|
|
189
|
+
return /* @__PURE__ */ m(
|
|
190
|
+
v.Panel,
|
|
191
|
+
{
|
|
192
|
+
...p,
|
|
193
|
+
ref: c,
|
|
194
|
+
className: S(o.panel, t),
|
|
195
|
+
value: r,
|
|
196
|
+
keepMounted: s,
|
|
197
|
+
"data-oc-part": "panel",
|
|
198
|
+
children: a
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
export {
|
|
203
|
+
Y as TabsList,
|
|
204
|
+
$ as TabsPanel,
|
|
205
|
+
U as TabsRoot,
|
|
206
|
+
Z as TabsTab,
|
|
207
|
+
U as default
|
|
208
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './Tabs.css';const o = "oc-Tabs-module__root__2x4fl", _ = "oc-Tabs-module__listFrame__TrGoN", a = "oc-Tabs-module__scroller__QIrMA", t = "oc-Tabs-module__fadeStart__1YF2D", l = "oc-Tabs-module__fadeEnd__g9-ts", s = "oc-Tabs-module__list__6iAKX", e = "oc-Tabs-module__tab__LYqhc", c = "oc-Tabs-module__label__dkYH9", d = "oc-Tabs-module__indicator__b8TYY", n = "oc-Tabs-module__trailing__qkYPl", r = "oc-Tabs-module__panel__0OUR6", i = {
|
|
2
|
+
root: o,
|
|
3
|
+
listFrame: _,
|
|
4
|
+
scroller: a,
|
|
5
|
+
fadeStart: t,
|
|
6
|
+
fadeEnd: l,
|
|
7
|
+
list: s,
|
|
8
|
+
tab: e,
|
|
9
|
+
label: c,
|
|
10
|
+
indicator: d,
|
|
11
|
+
trailing: n,
|
|
12
|
+
panel: r
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
i as default,
|
|
16
|
+
l as fadeEnd,
|
|
17
|
+
t as fadeStart,
|
|
18
|
+
d as indicator,
|
|
19
|
+
c as label,
|
|
20
|
+
s as list,
|
|
21
|
+
_ as listFrame,
|
|
22
|
+
r as panel,
|
|
23
|
+
o as root,
|
|
24
|
+
a as scroller,
|
|
25
|
+
e as tab,
|
|
26
|
+
n as trailing
|
|
27
|
+
};
|
|
@@ -1,98 +1,97 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useFieldContext as
|
|
5
|
-
import { useFieldControlOverlayMetrics as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { jsx as r, jsxs as F } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as d, useCallback as G, useEffect as J } from "react";
|
|
4
|
+
import { useFieldContext as K } from "../Field/Field.js";
|
|
5
|
+
import { useFieldControlOverlayMetrics as L } from "../Field/useFieldControlOverlayMetrics.js";
|
|
6
|
+
import { mergeRefs as Q } from "../../utils/mergeRefs.js";
|
|
7
|
+
import $ from "./TextArea.module.scss.js";
|
|
8
|
+
function _({
|
|
9
|
+
className: N = "",
|
|
10
|
+
containerClassName: z = "",
|
|
11
|
+
containerStyle: A,
|
|
12
|
+
invalid: s = !1,
|
|
13
|
+
leading: o,
|
|
14
|
+
minRows: n = 2,
|
|
15
|
+
maxRows: a,
|
|
16
|
+
id: M,
|
|
17
|
+
ref: S,
|
|
17
18
|
value: h,
|
|
18
|
-
defaultValue:
|
|
19
|
+
defaultValue: u,
|
|
19
20
|
onChange: j,
|
|
20
|
-
placeholder:
|
|
21
|
+
placeholder: f,
|
|
21
22
|
style: B,
|
|
22
23
|
trailing: e,
|
|
23
24
|
...E
|
|
24
25
|
}) {
|
|
25
|
-
const
|
|
26
|
-
|
|
26
|
+
const g = d(null), i = d(null), m = d(null), I = K(), P = M ?? I?.controlId, O = o && e ? "space-between" : e ? "end" : "start";
|
|
27
|
+
L({
|
|
27
28
|
metrics: [
|
|
28
29
|
{
|
|
29
30
|
dimension: "block",
|
|
30
31
|
property: "--oc-text-area-supporting-content-size",
|
|
31
|
-
ref:
|
|
32
|
+
ref: m
|
|
32
33
|
}
|
|
33
34
|
],
|
|
34
|
-
surfaceRef:
|
|
35
|
+
surfaceRef: i
|
|
35
36
|
});
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
}, l = J(() => {
|
|
39
|
-
const t = m.current;
|
|
37
|
+
const c = G(() => {
|
|
38
|
+
const t = g.current;
|
|
40
39
|
if (!t) return;
|
|
41
|
-
const
|
|
42
|
-
t.style.height = `${
|
|
43
|
-
const
|
|
44
|
-
|
|
40
|
+
const l = window.getComputedStyle(t), x = Number.parseFloat(l.lineHeight) || 0, y = (Number.parseFloat(l.paddingBlockStart) || 0) + (Number.parseFloat(l.paddingBlockEnd) || 0), p = x * n + y, H = a ? x * a + y : void 0, v = (k) => {
|
|
41
|
+
t.style.height = `${k}px`;
|
|
42
|
+
const D = t.offsetHeight || k;
|
|
43
|
+
i.current?.style.setProperty(
|
|
45
44
|
"--oc-text-area-control-block-size",
|
|
46
|
-
`${
|
|
45
|
+
`${D}px`
|
|
47
46
|
);
|
|
48
|
-
},
|
|
47
|
+
}, C = t.style.height;
|
|
49
48
|
if (t.style.height = "0px", t.scrollHeight <= 0) {
|
|
50
|
-
|
|
49
|
+
p > 0 ? v(p) : C ? t.style.height = C : t.style.removeProperty("height");
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
60
|
-
j?.(t),
|
|
52
|
+
const b = Math.max(t.scrollHeight, p), q = H ? Math.min(b, H) : b;
|
|
53
|
+
v(q);
|
|
54
|
+
}, [a, n]);
|
|
55
|
+
J(() => {
|
|
56
|
+
c();
|
|
57
|
+
}, [u, n, f, c, h]);
|
|
58
|
+
const T = (t) => {
|
|
59
|
+
j?.(t), c();
|
|
61
60
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ r(
|
|
63
62
|
"div",
|
|
64
63
|
{
|
|
65
|
-
className: `${
|
|
64
|
+
className: `${$.textArea} ${s ? $.invalid : ""} ${z}`.trim(),
|
|
66
65
|
"data-oc-component": "text-area",
|
|
67
|
-
"data-oc-invalid":
|
|
68
|
-
style:
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
66
|
+
"data-oc-invalid": s ? "true" : void 0,
|
|
67
|
+
style: A,
|
|
68
|
+
children: /* @__PURE__ */ F("div", { ref: i, "data-oc-part": "content", children: [
|
|
69
|
+
/* @__PURE__ */ r(
|
|
71
70
|
"textarea",
|
|
72
71
|
{
|
|
73
72
|
...E,
|
|
74
|
-
ref:
|
|
75
|
-
className:
|
|
73
|
+
ref: Q(g, S),
|
|
74
|
+
className: N,
|
|
76
75
|
id: P,
|
|
77
76
|
value: h,
|
|
78
|
-
defaultValue:
|
|
79
|
-
placeholder:
|
|
80
|
-
rows:
|
|
81
|
-
"aria-invalid":
|
|
77
|
+
defaultValue: u,
|
|
78
|
+
placeholder: f,
|
|
79
|
+
rows: n,
|
|
80
|
+
"aria-invalid": s || void 0,
|
|
82
81
|
"data-oc-part": "textarea",
|
|
83
|
-
onChange:
|
|
82
|
+
onChange: T,
|
|
84
83
|
style: B
|
|
85
84
|
}
|
|
86
85
|
),
|
|
87
|
-
|
|
86
|
+
o || e ? /* @__PURE__ */ F(
|
|
88
87
|
"div",
|
|
89
88
|
{
|
|
90
|
-
ref:
|
|
89
|
+
ref: m,
|
|
91
90
|
"data-oc-align": O,
|
|
92
91
|
"data-oc-part": "supporting-content",
|
|
93
92
|
children: [
|
|
94
|
-
|
|
95
|
-
e ? /* @__PURE__ */
|
|
93
|
+
o ? /* @__PURE__ */ r("span", { "data-oc-part": "leading-content", children: o }) : null,
|
|
94
|
+
e ? /* @__PURE__ */ r("span", { "data-oc-part": "trailing-content", children: e }) : null
|
|
96
95
|
]
|
|
97
96
|
}
|
|
98
97
|
) : null
|
|
@@ -101,5 +100,5 @@ function Z({
|
|
|
101
100
|
);
|
|
102
101
|
}
|
|
103
102
|
export {
|
|
104
|
-
|
|
103
|
+
_ as default
|
|
105
104
|
};
|