@clubmed/trident-ui 1.0.0-alpha.48 → 1.0.0-alpha.50
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/atoms/Icons/Icon.js +11 -6
- package/atoms/Icons/hooks/useIcon.d.ts +1 -2
- package/contexts/Device.js +1 -0
- package/fonts/Actions/tui-actions.css +6 -6
- package/fonts/Actions/tui-actions.eot +0 -0
- package/fonts/Actions/tui-actions.less +6 -6
- package/fonts/Actions/tui-actions.module.less +6 -6
- package/fonts/Actions/tui-actions.scss +6 -6
- package/fonts/Actions/tui-actions.styl +6 -6
- package/fonts/Actions/tui-actions.ttf +0 -0
- package/fonts/Actions/tui-actions.woff +0 -0
- package/fonts/Actions/tui-actions.woff2 +0 -0
- package/fonts/Activities/tui-activities.css +6 -6
- package/fonts/Activities/tui-activities.eot +0 -0
- package/fonts/Activities/tui-activities.less +6 -6
- package/fonts/Activities/tui-activities.module.less +6 -6
- package/fonts/Activities/tui-activities.scss +6 -6
- package/fonts/Activities/tui-activities.styl +6 -6
- package/fonts/Activities/tui-activities.ttf +0 -0
- package/fonts/Activities/tui-activities.woff +0 -0
- package/fonts/Activities/tui-activities.woff2 +0 -0
- package/fonts/Brand/tui-brand.css +6 -6
- package/fonts/Brand/tui-brand.eot +0 -0
- package/fonts/Brand/tui-brand.less +6 -6
- package/fonts/Brand/tui-brand.module.less +6 -6
- package/fonts/Brand/tui-brand.scss +6 -6
- package/fonts/Brand/tui-brand.styl +6 -6
- package/fonts/Brand/tui-brand.ttf +0 -0
- package/fonts/Brand/tui-brand.woff +0 -0
- package/fonts/Brand/tui-brand.woff2 +0 -0
- package/fonts/Covid/tui-covid.css +6 -6
- package/fonts/Covid/tui-covid.eot +0 -0
- package/fonts/Covid/tui-covid.less +6 -6
- package/fonts/Covid/tui-covid.module.less +6 -6
- package/fonts/Covid/tui-covid.scss +6 -6
- package/fonts/Covid/tui-covid.styl +6 -6
- package/fonts/Covid/tui-covid.ttf +0 -0
- package/fonts/Covid/tui-covid.woff +0 -0
- package/fonts/Covid/tui-covid.woff2 +0 -0
- package/fonts/Food/tui-food.css +6 -6
- package/fonts/Food/tui-food.eot +0 -0
- package/fonts/Food/tui-food.less +6 -6
- package/fonts/Food/tui-food.module.less +6 -6
- package/fonts/Food/tui-food.scss +6 -6
- package/fonts/Food/tui-food.styl +6 -6
- package/fonts/Food/tui-food.ttf +0 -0
- package/fonts/Food/tui-food.woff +0 -0
- package/fonts/Food/tui-food.woff2 +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.css +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.module.less +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.scss +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.styl +6 -6
- package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
- package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
- package/fonts/Places/tui-places.css +6 -6
- package/fonts/Places/tui-places.eot +0 -0
- package/fonts/Places/tui-places.less +6 -6
- package/fonts/Places/tui-places.module.less +6 -6
- package/fonts/Places/tui-places.scss +6 -6
- package/fonts/Places/tui-places.styl +6 -6
- package/fonts/Places/tui-places.ttf +0 -0
- package/fonts/Places/tui-places.woff +0 -0
- package/fonts/Places/tui-places.woff2 +0 -0
- package/fonts/Room/tui-room.css +6 -6
- package/fonts/Room/tui-room.eot +0 -0
- package/fonts/Room/tui-room.less +6 -6
- package/fonts/Room/tui-room.module.less +6 -6
- package/fonts/Room/tui-room.scss +6 -6
- package/fonts/Room/tui-room.styl +6 -6
- package/fonts/Room/tui-room.ttf +0 -0
- package/fonts/Room/tui-room.woff +0 -0
- package/fonts/Room/tui-room.woff2 +0 -0
- package/fonts/Services/tui-services.css +6 -6
- package/fonts/Services/tui-services.eot +0 -0
- package/fonts/Services/tui-services.less +6 -6
- package/fonts/Services/tui-services.module.less +6 -6
- package/fonts/Services/tui-services.scss +6 -6
- package/fonts/Services/tui-services.styl +6 -6
- package/fonts/Services/tui-services.ttf +0 -0
- package/fonts/Services/tui-services.woff +0 -0
- package/fonts/Services/tui-services.woff2 +0 -0
- package/fonts/Socials/tui-socials.css +6 -6
- package/fonts/Socials/tui-socials.eot +0 -0
- package/fonts/Socials/tui-socials.less +6 -6
- package/fonts/Socials/tui-socials.module.less +6 -6
- package/fonts/Socials/tui-socials.scss +6 -6
- package/fonts/Socials/tui-socials.styl +6 -6
- package/fonts/Socials/tui-socials.ttf +0 -0
- package/fonts/Socials/tui-socials.woff +0 -0
- package/fonts/Socials/tui-socials.woff2 +0 -0
- package/fonts/Transports/tui-transports.css +6 -6
- package/fonts/Transports/tui-transports.eot +0 -0
- package/fonts/Transports/tui-transports.less +6 -6
- package/fonts/Transports/tui-transports.module.less +6 -6
- package/fonts/Transports/tui-transports.scss +6 -6
- package/fonts/Transports/tui-transports.styl +6 -6
- package/fonts/Transports/tui-transports.ttf +0 -0
- package/fonts/Transports/tui-transports.woff +0 -0
- package/fonts/Transports/tui-transports.woff2 +0 -0
- package/fonts/Utilities/tui-utilities.css +6 -6
- package/fonts/Utilities/tui-utilities.eot +0 -0
- package/fonts/Utilities/tui-utilities.less +6 -6
- package/fonts/Utilities/tui-utilities.module.less +6 -6
- package/fonts/Utilities/tui-utilities.scss +6 -6
- package/fonts/Utilities/tui-utilities.styl +6 -6
- package/fonts/Utilities/tui-utilities.ttf +0 -0
- package/fonts/Utilities/tui-utilities.woff +0 -0
- package/fonts/Utilities/tui-utilities.woff2 +0 -0
- package/hooks/useKeyboardControls.js +16 -15
- package/molecules/Forms/Checkboxes/index.d.ts +2 -0
- package/molecules/Forms/Checkboxes/index.js +6 -0
- package/molecules/Forms/Password/index.d.ts +2 -0
- package/molecules/Forms/Password/index.js +6 -0
- package/molecules/Forms/{Radio.d.ts → Radios/Radio.d.ts} +1 -1
- package/molecules/Forms/{Radio.js → Radios/Radio.js} +3 -3
- package/molecules/Forms/{RadioGroup.d.ts → Radios/RadioGroup.d.ts} +1 -1
- package/molecules/Forms/{RadioGroup.js → Radios/RadioGroup.js} +2 -2
- package/molecules/Forms/Radios/index.d.ts +2 -0
- package/molecules/Forms/Radios/index.js +6 -0
- package/molecules/Forms/{Switch/Switch.d.ts → Switch.d.ts} +1 -1
- package/molecules/Forms/{Switch/Switch.js → Switch.js} +3 -3
- package/molecules/Loader.js +1 -0
- package/molecules/Tabs/{Header.js → TabsHeader.js} +10 -9
- package/molecules/Tabs/{Heading.js → TabsHeading.js} +1 -0
- package/molecules/Tabs/{Panel.js → TabsPanel.js} +9 -8
- package/molecules/Tabs/context/TabControl.js +20 -19
- package/molecules/Tabs/index.d.ts +5 -0
- package/molecules/Tabs/index.js +12 -0
- package/package.json +29 -7
- package/hooks/__mocks__/useSafeBoop.d.ts +0 -4
- package/hooks/__mocks__/useSafeBoop.js +0 -10
- /package/molecules/Forms/{Checkbox → Checkboxes}/Checkbox.d.ts +0 -0
- /package/molecules/Forms/{Checkbox → Checkboxes}/Checkbox.js +0 -0
- /package/molecules/Tabs/{Body.d.ts → TabsBody.d.ts} +0 -0
- /package/molecules/Tabs/{Body.js → TabsBody.js} +0 -0
- /package/molecules/Tabs/{Header.d.ts → TabsHeader.d.ts} +0 -0
- /package/molecules/Tabs/{Heading.d.ts → TabsHeading.d.ts} +0 -0
- /package/molecules/Tabs/{Panel.d.ts → TabsPanel.d.ts} +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-transports";
|
2
|
-
src: url('tui-transports.eot?t=
|
3
|
-
src: url('tui-transports.eot?t=
|
4
|
-
url("tui-transports.woff2?t=
|
5
|
-
url("tui-transports.woff?t=
|
6
|
-
url('tui-transports.ttf?t=
|
7
|
-
url('tui-transports.svg?t=
|
2
|
+
src: url('tui-transports.eot?t=1715963093749'); /* IE9*/
|
3
|
+
src: url('tui-transports.eot?t=1715963093749#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-transports.woff2?t=1715963093749") format("woff2"),
|
5
|
+
url("tui-transports.woff?t=1715963093749") format("woff"),
|
6
|
+
url('tui-transports.ttf?t=1715963093749') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-transports.svg?t=1715963093749#tui-transports') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-transports-"], [class*=" tui-transports-"] {
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,11 +1,11 @@
|
|
1
1
|
@font-face {
|
2
2
|
font-family: "tui-utilities";
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
src: url('tui-utilities.eot?t=
|
5
|
-
url("tui-utilities.woff2?t=
|
6
|
-
url("tui-utilities.woff?t=
|
7
|
-
url('tui-utilities.ttf?t=
|
8
|
-
url('tui-utilities.svg?t=
|
3
|
+
src: url('tui-utilities.eot?t=1715963093924'); /* IE9*/
|
4
|
+
src: url('tui-utilities.eot?t=1715963093924#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
5
|
+
url("tui-utilities.woff2?t=1715963093924") format("woff2"),
|
6
|
+
url("tui-utilities.woff?t=1715963093924") format("woff"),
|
7
|
+
url('tui-utilities.ttf?t=1715963093924') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
8
|
+
url('tui-utilities.svg?t=1715963093924#tui-utilities') format('svg'); /* iOS 4.1- */
|
9
9
|
}
|
10
10
|
|
11
11
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
Binary file
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1715963093924'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1715963093924#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1715963093924") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1715963093924") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1715963093924') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1715963093924#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1715963093924'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1715963093924#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1715963093924") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1715963093924") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1715963093924') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1715963093924#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1715963093924'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1715963093924#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1715963093924") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1715963093924") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1715963093924') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1715963093924#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {font-family: "tui-utilities";
|
2
|
-
src: url('tui-utilities.eot?t=
|
3
|
-
src: url('tui-utilities.eot?t=
|
4
|
-
url("tui-utilities.woff2?t=
|
5
|
-
url("tui-utilities.woff?t=
|
6
|
-
url('tui-utilities.ttf?t=
|
7
|
-
url('tui-utilities.svg?t=
|
2
|
+
src: url('tui-utilities.eot?t=1715963093924'); /* IE9*/
|
3
|
+
src: url('tui-utilities.eot?t=1715963093924#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
4
|
+
url("tui-utilities.woff2?t=1715963093924") format("woff2"),
|
5
|
+
url("tui-utilities.woff?t=1715963093924") format("woff"),
|
6
|
+
url('tui-utilities.ttf?t=1715963093924') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
|
7
|
+
url('tui-utilities.svg?t=1715963093924#tui-utilities') format('svg'); /* iOS 4.1- */
|
8
8
|
}
|
9
9
|
|
10
10
|
[class^="tui-utilities-"], [class*=" tui-utilities-"] {
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,28 +1,29 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
"use client";
|
2
|
+
import { CODE as o, KEY as t } from "./keyboard.constants.js";
|
3
|
+
const D = (e) => e.key === t.ENTER || e.key === t.SPACE || e.key === t.SPACEBAR || e.code === o.ENTER || e.code === o.SPACE, u = () => {
|
3
4
|
}, n = ({
|
4
|
-
up:
|
5
|
-
down:
|
6
|
-
left:
|
7
|
-
right: d =
|
8
|
-
start:
|
9
|
-
end:
|
10
|
-
activate:
|
5
|
+
up: e = u,
|
6
|
+
down: c = u,
|
7
|
+
left: f = u,
|
8
|
+
right: d = u,
|
9
|
+
start: i = u,
|
10
|
+
end: E = u,
|
11
|
+
activate: R = u
|
11
12
|
}) => (r) => {
|
12
13
|
if (D(r))
|
13
|
-
return
|
14
|
+
return R();
|
14
15
|
if (r.code === o.HOME)
|
15
|
-
return r.preventDefault(),
|
16
|
+
return r.preventDefault(), i();
|
16
17
|
if (r.code === o.END)
|
17
|
-
return r.preventDefault(),
|
18
|
+
return r.preventDefault(), E();
|
18
19
|
if (r.code === o.ARROW_UP)
|
19
|
-
return r.preventDefault(),
|
20
|
+
return r.preventDefault(), e();
|
20
21
|
if (r.code === o.ARROW_DOWN)
|
21
|
-
return r.preventDefault(),
|
22
|
+
return r.preventDefault(), c();
|
22
23
|
if (r.code === o.ARROW_RIGHT)
|
23
24
|
return r.preventDefault(), d();
|
24
25
|
if (r.code === o.ARROW_LEFT)
|
25
|
-
return r.preventDefault(),
|
26
|
+
return r.preventDefault(), f();
|
26
27
|
};
|
27
28
|
export {
|
28
29
|
n as useKeyboardControls
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { c as y } from "
|
3
|
-
import { useValue as w } from "
|
4
|
-
import "
|
2
|
+
import { c as y } from "../../../index-Cu0xwYjD.js";
|
3
|
+
import { useValue as w } from "../../../hooks/useValue.js";
|
4
|
+
import "../../../controls-l0sNRNKZ.js";
|
5
5
|
let k = 0;
|
6
6
|
function R({
|
7
7
|
id: o = "radio-" + k++,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
2
|
-
import { FormControlProps } from '
|
2
|
+
import { FormControlProps } from '../FormControl.js';
|
3
3
|
export interface RadioGroupProps<Value = string> extends Pick<FormControlProps<Value>, 'id' | 'name' | 'value' | 'onChange' | 'disabled' | 'readOnly' | 'tabIndex' | 'description' | 'validationStatus' | 'errorMessage'>, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
4
4
|
}
|
5
5
|
export declare function RadioGroup<Value = string>({ id, name, children, value: initialValue, defaultValue, onChange, disabled, readOnly, tabIndex, ...rest }: RadioGroupProps<Value>): import("react/jsx-runtime").JSX.Element;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
2
2
|
import { Children as v, isValidElement as x, cloneElement as V } from "react";
|
3
|
-
import { useValue as C } from "
|
4
|
-
import { c as E } from "
|
3
|
+
import { useValue as C } from "../../../hooks/useValue.js";
|
4
|
+
import { c as E } from "../../../index-Cu0xwYjD.js";
|
5
5
|
let N = 0;
|
6
6
|
function I({
|
7
7
|
id: o = "radio-group-" + N++,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
2
|
-
import { c as m } from "
|
3
|
-
import { useValue as x } from "
|
4
|
-
import "
|
2
|
+
import { c as m } from "../../index-Cu0xwYjD.js";
|
3
|
+
import { useValue as x } from "../../hooks/useValue.js";
|
4
|
+
import "../../controls-l0sNRNKZ.js";
|
5
5
|
let f = 0;
|
6
6
|
function d({
|
7
7
|
id: a = `switch-${++f}`,
|
package/molecules/Loader.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
import {
|
1
|
+
"use client";
|
2
|
+
import { jsx as r, jsxs as w } from "react/jsx-runtime";
|
3
|
+
import { c as l } from "../../index-Cu0xwYjD.js";
|
3
4
|
import { useRef as f, useEffect as v } from "react";
|
4
5
|
import { a as b, b as h } from "../../react-spring_web.modern-BPtZcx1z.js";
|
5
6
|
import { useActiveTabControl as L } from "./hooks/tabControl.js";
|
@@ -22,31 +23,31 @@ const k = ({
|
|
22
23
|
});
|
23
24
|
}, [c, e, o]);
|
24
25
|
const x = { "--active-tab": m };
|
25
|
-
return /* @__PURE__ */
|
26
|
+
return /* @__PURE__ */ r(
|
26
27
|
h.div,
|
27
28
|
{
|
28
29
|
ref: t,
|
29
30
|
"data-name": "TabsHeader",
|
30
|
-
className:
|
31
|
+
className: l(
|
31
32
|
"scrollbar-hide relative flex max-w-full overflow-x-scroll py-20",
|
32
33
|
n
|
33
34
|
),
|
34
35
|
scrollLeft: c,
|
35
|
-
children: /* @__PURE__ */ w("div", { role: "tablist", className:
|
36
|
-
/* @__PURE__ */
|
36
|
+
children: /* @__PURE__ */ w("div", { role: "tablist", className: l("flex flex-row"), style: x, children: [
|
37
|
+
/* @__PURE__ */ r(
|
37
38
|
"div",
|
38
39
|
{
|
39
40
|
ref: a,
|
40
|
-
className:
|
41
|
+
className: l("shrink-0", {
|
41
42
|
"w-16 lg:w-[max(calc((100vw-1212px)/2),116px)] xl:w-[max(calc((100vw-1212px)/2),156px)]": !s
|
42
43
|
})
|
43
44
|
}
|
44
45
|
),
|
45
46
|
i,
|
46
|
-
/* @__PURE__ */
|
47
|
+
/* @__PURE__ */ r(
|
47
48
|
"div",
|
48
49
|
{
|
49
|
-
className:
|
50
|
+
className: l("shrink-0", {
|
50
51
|
"w-16 lg:w-[max(calc((100vw-1212px)/2),116px)] xl:w-[max(calc((100vw-1212px)/2),156px)]": !s
|
51
52
|
})
|
52
53
|
}
|
@@ -1,6 +1,7 @@
|
|
1
|
+
"use client";
|
1
2
|
import { jsx as p } from "react/jsx-runtime";
|
2
3
|
import { c as d } from "../../index-Cu0xwYjD.js";
|
3
|
-
import { useRef as
|
4
|
+
import { useRef as l, useEffect as f } from "react";
|
4
5
|
import { a as b, b as u } from "../../react-spring_web.modern-BPtZcx1z.js";
|
5
6
|
import { useActiveTab as y } from "./hooks/tabControl.js";
|
6
7
|
const r = {
|
@@ -12,32 +13,32 @@ const r = {
|
|
12
13
|
pointerEvents: "auto",
|
13
14
|
display: "block"
|
14
15
|
}, R = ({
|
15
|
-
value:
|
16
|
+
value: e,
|
16
17
|
className: i,
|
17
18
|
onSelect: s,
|
18
19
|
children: c
|
19
20
|
}) => {
|
20
|
-
const o =
|
21
|
+
const o = l(!1), t = y() === e, [m, a] = b(() => ({
|
21
22
|
from: t ? n : r
|
22
23
|
}));
|
23
|
-
return
|
24
|
+
return f(() => {
|
24
25
|
if (!o.current) {
|
25
26
|
o.current = !0;
|
26
27
|
return;
|
27
28
|
}
|
28
|
-
|
29
|
+
a.start({
|
29
30
|
to: {
|
30
31
|
...t ? n : r,
|
31
32
|
display: "block"
|
32
33
|
},
|
33
34
|
onRest: () => {
|
34
|
-
|
35
|
+
a.start({
|
35
36
|
to: { display: t ? "block" : "none" },
|
36
37
|
immediate: !0
|
37
38
|
});
|
38
39
|
}
|
39
|
-
}), t && (s == null || s({ value:
|
40
|
-
}, [t,
|
40
|
+
}), t && (s == null || s({ value: e }));
|
41
|
+
}, [t, a, e, s]), /* @__PURE__ */ p(
|
41
42
|
u.div,
|
42
43
|
{
|
43
44
|
"data-name": "Tab",
|
@@ -1,37 +1,38 @@
|
|
1
|
+
"use client";
|
1
2
|
import { jsx as l } from "react/jsx-runtime";
|
2
3
|
import { createContext as c, useReducer as v, useMemo as u, useCallback as x } from "react";
|
3
4
|
const C = (e) => {
|
4
|
-
const
|
5
|
+
const t = Math.max(Math.min(e.min, e.max), 0), r = Math.max(Math.min(e.max, 1 / 0), t);
|
5
6
|
return {
|
6
|
-
min:
|
7
|
-
max:
|
8
|
-
clamp: (n) => Math.max(Math.min(n,
|
7
|
+
min: t,
|
8
|
+
max: r,
|
9
|
+
clamp: (n) => Math.max(Math.min(n, r), t)
|
9
10
|
};
|
10
11
|
}, g = (e) => {
|
11
|
-
const { clamp:
|
12
|
-
return
|
12
|
+
const { clamp: t } = C(e);
|
13
|
+
return t(e.value);
|
13
14
|
}, P = (e) => {
|
14
|
-
const { min:
|
15
|
+
const { min: t, max: r, clamp: n } = C(e);
|
15
16
|
return (a, o) => {
|
16
17
|
switch (o.type) {
|
17
18
|
case "update":
|
18
19
|
return n(o.payload);
|
19
20
|
case "next":
|
20
|
-
return a + 1 <=
|
21
|
+
return a + 1 <= r ? a + 1 : t;
|
21
22
|
case "previous":
|
22
|
-
return a - 1 >=
|
23
|
+
return a - 1 >= t ? a - 1 : r;
|
23
24
|
case "start":
|
24
|
-
return r;
|
25
|
-
case "end":
|
26
25
|
return t;
|
26
|
+
case "end":
|
27
|
+
return r;
|
27
28
|
}
|
28
29
|
};
|
29
|
-
}, R = (e,
|
30
|
-
switch (
|
30
|
+
}, R = (e, t) => {
|
31
|
+
switch (t.type) {
|
31
32
|
case "register":
|
32
|
-
return new Map(e.set(
|
33
|
+
return new Map(e.set(t.payload.value, t.payload.ref));
|
33
34
|
case "unregister":
|
34
|
-
return e.delete(
|
35
|
+
return e.delete(t.payload.value) ? new Map(e) : e;
|
35
36
|
}
|
36
37
|
}, h = c({ value: 0 });
|
37
38
|
h.displayName = "ActiveTabContext";
|
@@ -53,13 +54,13 @@ const b = c({
|
|
53
54
|
b.displayName = "TabControlContext";
|
54
55
|
const A = ({
|
55
56
|
min: e = 0,
|
56
|
-
max:
|
57
|
-
selected:
|
57
|
+
max: t,
|
58
|
+
selected: r = e,
|
58
59
|
children: n
|
59
60
|
}) => {
|
60
61
|
const [a, o] = v(
|
61
|
-
P({ min: e, max:
|
62
|
-
{ value:
|
62
|
+
P({ min: e, max: t }),
|
63
|
+
{ value: r, min: e, max: t },
|
63
64
|
g
|
64
65
|
), [i, d] = v(R, /* @__PURE__ */ new Map()), M = u(() => ({ value: a }), [a]), f = u(() => ({ refs: i }), [i]), p = x(
|
65
66
|
(s, w) => {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Tabs as e } from "./Tabs.js";
|
2
|
+
import { TabsBody as b } from "./TabsBody.js";
|
3
|
+
import { TabsHeader as m } from "./TabsHeader.js";
|
4
|
+
import { TabsHeading as s } from "./TabsHeading.js";
|
5
|
+
import { TabsPanel as x } from "./TabsPanel.js";
|
6
|
+
export {
|
7
|
+
e as Tabs,
|
8
|
+
b as TabsBody,
|
9
|
+
m as TabsHeader,
|
10
|
+
s as TabsHeading,
|
11
|
+
x as TabsPanel
|
12
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@clubmed/trident-ui",
|
3
|
-
"version": "1.0.0-alpha.
|
3
|
+
"version": "1.0.0-alpha.50",
|
4
4
|
"type": "module",
|
5
5
|
"description": "Shared ClubMed React UI components",
|
6
6
|
"keywords": [
|
@@ -31,6 +31,11 @@
|
|
31
31
|
"import": "./atoms/Icons/index.js",
|
32
32
|
"default": "./atoms/Icons/index.js"
|
33
33
|
},
|
34
|
+
"./atoms/Icons/fonts": {
|
35
|
+
"types": "./atoms/Icons/fonts/index.d.ts",
|
36
|
+
"import": "./atoms/Icons/fonts/index.js",
|
37
|
+
"default": "./atoms/Icons/fonts/index.js"
|
38
|
+
},
|
34
39
|
"./atoms/Icons/svg": {
|
35
40
|
"types": "./atoms/Icons/svg/index.d.ts",
|
36
41
|
"import": "./atoms/Icons/svg/index.js",
|
@@ -41,10 +46,25 @@
|
|
41
46
|
"import": "./atoms/Icons/svg-use/index.js",
|
42
47
|
"default": "./atoms/Icons/svg-use/index.js"
|
43
48
|
},
|
44
|
-
"./
|
45
|
-
"types": "./
|
46
|
-
"import": "./
|
47
|
-
"default": "./
|
49
|
+
"./molecules/Tabs": {
|
50
|
+
"types": "./molecules/Tabs/index.d.ts",
|
51
|
+
"import": "./molecules/Tabs/index.js",
|
52
|
+
"default": "./molecules/Tabs/index.js"
|
53
|
+
},
|
54
|
+
"./molecules/Forms/Checkboxes": {
|
55
|
+
"types": "./molecules/Forms/Checkboxes/index.d.ts",
|
56
|
+
"import": "./molecules/Forms/Checkboxes/index.js",
|
57
|
+
"default": "./molecules/Forms/Checkboxes/index.js"
|
58
|
+
},
|
59
|
+
"./molecules/Forms/Password": {
|
60
|
+
"types": "./molecules/Forms/Password/index.d.ts",
|
61
|
+
"import": "./molecules/Forms/Password/index.js",
|
62
|
+
"default": "./molecules/Forms/Password/index.js"
|
63
|
+
},
|
64
|
+
"./molecules/Forms/Radios": {
|
65
|
+
"types": "./molecules/Forms/Radios/index.d.ts",
|
66
|
+
"import": "./molecules/Forms/Radios/index.js",
|
67
|
+
"default": "./molecules/Forms/Radios/index.js"
|
48
68
|
},
|
49
69
|
"./fonts/*": "./fonts/*",
|
50
70
|
"./atoms/*": {
|
@@ -77,7 +97,7 @@
|
|
77
97
|
"predev": "npm run build:icons",
|
78
98
|
"dev": "storybook dev -p 6006",
|
79
99
|
"prebuild": "npm run build:icons",
|
80
|
-
"build": "vite build && npm run build:icons font",
|
100
|
+
"build": "vite build && npm run build:icons font && npm run build:exports",
|
81
101
|
"build:storybook": "npm run build:icons && storybook build",
|
82
102
|
"lint": "eslint . --report-unused-disable-directives",
|
83
103
|
"lint:fix": "eslint . --fix",
|
@@ -86,7 +106,8 @@
|
|
86
106
|
"test:dev": "vitest watch",
|
87
107
|
"test:update": "vitest -u",
|
88
108
|
"prepare": "husky",
|
89
|
-
"build:icons": "NODE_NO_WARNINGS=1 node --loader ts-node/esm ./tools/icons/index.ts"
|
109
|
+
"build:icons": "NODE_NO_WARNINGS=1 node --loader ts-node/esm ./tools/icons/index.ts",
|
110
|
+
"build:exports": "NODE_NO_WARNINGS=1 node --loader ts-node/esm tools/exports-builder/index.ts"
|
90
111
|
},
|
91
112
|
"peerDependencies": {
|
92
113
|
"react": ">=17.0.2",
|
@@ -149,6 +170,7 @@
|
|
149
170
|
"react": "^18.2.0",
|
150
171
|
"react-dom": "^18.2.0",
|
151
172
|
"react-syntax-highlighter": "^15.5.0",
|
173
|
+
"rollup-preserve-directives": "^1.1.1",
|
152
174
|
"storybook": "8.0.8",
|
153
175
|
"svgtofont": "^4.2.0",
|
154
176
|
"tailwindcss": "^3.3.5",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|