@clubmed/trident-icons 1.4.0-beta.2 → 1.4.0-beta.3
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/CHANGELOG.md +8 -0
- package/hooks/useIconOrientation.js +1 -1
- package/hooks/useIconOrientation.js.map +1 -1
- package/package.json +1 -1
- package/svg/SvgIcon.d.ts +7 -6
- package/svg/SvgIcon.js +25 -25
- package/svg/SvgIcon.js.map +1 -1
- package/svg-use/SvgUseIcon.d.ts +7 -6
- package/svg-use/SvgUseIcon.js +21 -21
- package/svg-use/SvgUseIcon.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# ClubMed React UI components changelog
|
|
2
2
|
|
|
3
|
+
# [1.4.0-beta.3](https://scm.clubmed.com/clubmed/ui/trident-icons/compare/v1.4.0-beta.2...v1.4.0-beta.3) (2025-10-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* remove data-name ([7d3c78c](https://scm.clubmed.com/clubmed/ui/trident-icons/-/commit/7d3c78c219202253831d570437ed23d02bd5445e))
|
|
9
|
+
* update component ([21ab1fb](https://scm.clubmed.com/clubmed/ui/trident-icons/-/commit/21ab1fb6377bf0166e9a5763bd195385af6f3386))
|
|
10
|
+
|
|
3
11
|
# [1.4.0-beta.2](https://scm.clubmed.com/clubmed/ui/trident-icons/compare/v1.4.0-beta.1...v1.4.0-beta.2) (2025-10-10)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -22,7 +22,7 @@ function e({
|
|
|
22
22
|
intrinsicRotation: t = 0,
|
|
23
23
|
intrinsicClassName: i = ""
|
|
24
24
|
}) {
|
|
25
|
-
return s && n[s] && (t = t || n[s].intrinsicRotation
|
|
25
|
+
return s && n[s] && (t = t || n[s].intrinsicRotation, i = i || n[s].intrinsicClassName), {
|
|
26
26
|
intrinsicClassName: i,
|
|
27
27
|
transform: `rotate(${r + t}deg)`,
|
|
28
28
|
rotate: `${r + t}deg`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIconOrientation.js","sources":["../../lib/hooks/useIconOrientation.ts"],"sourcesContent":["export const ORIENTATIONS = {\n left: {\n intrinsicRotation: 180,\n intrinsicClassName: 'rtl:-scale-x-100',\n },\n up: {\n intrinsicRotation: 270,\n intrinsicClassName: '',\n },\n down: {\n intrinsicRotation: 90,\n intrinsicClassName: '',\n },\n right: {\n intrinsicClassName: 'rtl:-scale-x-100',\n intrinsicRotation: 0,\n },\n} as const;\n\nexport type IconOrientations = keyof typeof ORIENTATIONS;\n\nexport interface IconOrientationProps {\n orientation?: IconOrientations;\n rotation?: number;\n intrinsicRotation?: number;\n intrinsicClassName?: string;\n}\n\nexport function useIconOrientation({\n orientation,\n rotation = 0,\n intrinsicRotation = 0,\n intrinsicClassName = '',\n}: IconOrientationProps) {\n if (orientation && ORIENTATIONS[orientation]) {\n intrinsicRotation = intrinsicRotation || ORIENTATIONS[orientation].intrinsicRotation
|
|
1
|
+
{"version":3,"file":"useIconOrientation.js","sources":["../../lib/hooks/useIconOrientation.ts"],"sourcesContent":["export const ORIENTATIONS = {\n left: {\n intrinsicRotation: 180,\n intrinsicClassName: 'rtl:-scale-x-100',\n },\n up: {\n intrinsicRotation: 270,\n intrinsicClassName: '',\n },\n down: {\n intrinsicRotation: 90,\n intrinsicClassName: '',\n },\n right: {\n intrinsicClassName: 'rtl:-scale-x-100',\n intrinsicRotation: 0,\n },\n} as const;\n\nexport type IconOrientations = keyof typeof ORIENTATIONS;\n\nexport interface IconOrientationProps {\n orientation?: IconOrientations;\n rotation?: number;\n intrinsicRotation?: number;\n intrinsicClassName?: string;\n}\n\nexport function useIconOrientation({\n orientation,\n rotation = 0,\n intrinsicRotation = 0,\n intrinsicClassName = '',\n}: IconOrientationProps) {\n if (orientation && ORIENTATIONS[orientation]) {\n intrinsicRotation = intrinsicRotation || ORIENTATIONS[orientation].intrinsicRotation;\n intrinsicClassName = intrinsicClassName || ORIENTATIONS[orientation].intrinsicClassName;\n }\n\n return {\n intrinsicClassName,\n transform: `rotate(${rotation + intrinsicRotation}deg)`,\n rotate: `${rotation + intrinsicRotation}deg`,\n };\n}\n"],"names":["ORIENTATIONS","useIconOrientation","orientation","rotation","intrinsicRotation","intrinsicClassName"],"mappings":"AAAO,MAAMA,IAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB;AAAA,EACA,IAAI;AAAA,IACF,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB;AAAA,EACA,MAAM;AAAA,IACJ,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,EACtB;AAAA,EACA,OAAO;AAAA,IACL,oBAAoB;AAAA,IACpB,mBAAmB;AAAA,EACrB;AACF;AAWO,SAASC,EAAmB;AAAA,EACjC,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,mBAAAC,IAAoB;AAAA,EACpB,oBAAAC,IAAqB;AACvB,GAAyB;AACnB,SAAAH,KAAeF,EAAaE,CAAW,MACrBE,IAAAA,KAAqBJ,EAAaE,CAAW,EAAE,mBAC9CG,IAAAA,KAAsBL,EAAaE,CAAW,EAAE,qBAGhE;AAAA,IACL,oBAAAG;AAAA,IACA,WAAW,UAAUF,IAAWC,CAAiB;AAAA,IACjD,QAAQ,GAAGD,IAAWC,CAAiB;AAAA,EAAA;AAE3C;"}
|
package/package.json
CHANGED
package/svg/SvgIcon.d.ts
CHANGED
|
@@ -4,17 +4,18 @@ type SvgComponent = ComponentType<ComponentProps<'svg'> & {
|
|
|
4
4
|
title?: string;
|
|
5
5
|
}>;
|
|
6
6
|
export interface SvgIconProps extends IconProps {
|
|
7
|
-
element: LazyExoticComponent<SvgComponent>;
|
|
8
|
-
/**
|
|
9
|
-
* default: '0 0 30 30',
|
|
10
|
-
*/
|
|
11
|
-
viewBox?: string;
|
|
12
7
|
/**
|
|
13
8
|
* aspectRatio: 1
|
|
14
9
|
*/
|
|
15
10
|
aspectRatio?: number;
|
|
16
|
-
|
|
11
|
+
element: LazyExoticComponent<SvgComponent>;
|
|
17
12
|
intrinsicClassName?: string;
|
|
13
|
+
intrinsicRotation?: number;
|
|
14
|
+
svgClassName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* default: '0 0 30 30',
|
|
17
|
+
*/
|
|
18
|
+
viewBox?: string;
|
|
18
19
|
}
|
|
19
20
|
export declare function SvgIcon(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
package/svg/SvgIcon.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { Suspense as
|
|
4
|
-
import { useIconOrientation as
|
|
5
|
-
import { omit as
|
|
6
|
-
function
|
|
2
|
+
import { c as u } from "../chunks/index.js";
|
|
3
|
+
import { Suspense as N } from "react";
|
|
4
|
+
import { useIconOrientation as g } from "../hooks/useIconOrientation.js";
|
|
5
|
+
import { omit as x } from "../utils/omit.js";
|
|
6
|
+
function k(e) {
|
|
7
7
|
const {
|
|
8
|
-
|
|
9
|
-
className:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
aspectRatio: i,
|
|
9
|
+
className: o,
|
|
10
|
+
color: s = "inherit",
|
|
11
|
+
element: n,
|
|
12
|
+
name: a,
|
|
13
|
+
style: r,
|
|
14
|
+
svgClassName: m,
|
|
15
15
|
viewBox: c,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
width: l,
|
|
17
|
+
...d
|
|
18
|
+
} = e, { intrinsicClassName: p, rotate: f } = g(e), h = `text-${s}`;
|
|
18
19
|
return /* @__PURE__ */ t(
|
|
19
20
|
"span",
|
|
20
21
|
{
|
|
21
22
|
"aria-hidden": !0,
|
|
22
|
-
...
|
|
23
|
-
className:
|
|
24
|
-
"inline-block shrink-0 align-middle",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
...x(d, ["group", "orientation", "type"]),
|
|
24
|
+
className: u(
|
|
25
|
+
"inline-block w-16 shrink-0 align-middle",
|
|
26
|
+
p,
|
|
27
|
+
h,
|
|
28
|
+
o
|
|
28
29
|
),
|
|
29
|
-
"data-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
children: /* @__PURE__ */ t(u, { children: /* @__PURE__ */ t(s, { viewBox: c }) })
|
|
30
|
+
"data-testid": `icon-${a}`,
|
|
31
|
+
style: { aspectRatio: i, width: l, ...r },
|
|
32
|
+
children: /* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(n, { className: m, style: { rotate: f }, viewBox: c }) })
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
k as SvgIcon
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=SvgIcon.js.map
|
package/svg/SvgIcon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgIcon.js","sources":["../../lib/svg/SvgIcon.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type ComponentProps, type ComponentType, type LazyExoticComponent, Suspense } from 'react';\nimport type { IconProps } from '@/IconsResolver';\nimport { useIconOrientation } from '@/hooks/useIconOrientation';\nimport { omit } from '@/utils/omit';\n\ntype SvgComponent = ComponentType<ComponentProps<'svg'> & { title?: string }>;\n\nexport interface SvgIconProps extends IconProps {\n element: LazyExoticComponent<SvgComponent>;\n /**\n * default: '0 0 30 30',\n */\n viewBox?: string;\n
|
|
1
|
+
{"version":3,"file":"SvgIcon.js","sources":["../../lib/svg/SvgIcon.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport { type ComponentProps, type ComponentType, type LazyExoticComponent, Suspense } from 'react';\nimport type { IconProps } from '@/IconsResolver';\nimport { useIconOrientation } from '@/hooks/useIconOrientation';\nimport { omit } from '@/utils/omit';\n\ntype SvgComponent = ComponentType<ComponentProps<'svg'> & { title?: string }>;\n\nexport interface SvgIconProps extends IconProps {\n /**\n * aspectRatio: 1\n */\n aspectRatio?: number;\n element: LazyExoticComponent<SvgComponent>;\n intrinsicClassName?: string;\n intrinsicRotation?: number;\n svgClassName?: string;\n /**\n * default: '0 0 30 30',\n */\n viewBox?: string;\n}\n\nexport function SvgIcon(props: SvgIconProps) {\n const {\n aspectRatio,\n className,\n color = 'inherit',\n element: SVG,\n name,\n style,\n svgClassName,\n viewBox,\n width,\n ...attrs\n } = props;\n\n const { intrinsicClassName, rotate } = useIconOrientation(props);\n const iconColor = `text-${color}`;\n\n return (\n <span\n aria-hidden={true}\n {...omit(attrs, ['group', 'orientation', 'type'])}\n className={classnames(\n 'inline-block w-16 shrink-0 align-middle',\n intrinsicClassName,\n iconColor,\n className,\n )}\n data-testid={`icon-${name}`}\n style={{ aspectRatio, width: width!, ...style }}\n >\n <Suspense>\n <SVG className={svgClassName} style={{ rotate }} viewBox={viewBox} />\n </Suspense>\n </span>\n );\n}\n"],"names":["SvgIcon","props","aspectRatio","className","color","SVG","name","style","svgClassName","viewBox","width","attrs","intrinsicClassName","rotate","useIconOrientation","iconColor","jsx","omit","classnames","Suspense"],"mappings":";;;;;AAuBO,SAASA,EAAQC,GAAqB;AACrC,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAASC;AAAA,IACT,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAV,GAEE,EAAE,oBAAAW,GAAoB,QAAAC,EAAO,IAAIC,EAAmBb,CAAK,GACzDc,IAAY,QAAQX,CAAK;AAG7B,SAAA,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAa;AAAA,MACZ,GAAGC,EAAKN,GAAO,CAAC,SAAS,eAAe,MAAM,CAAC;AAAA,MAChD,WAAWO;AAAA,QACT;AAAA,QACAN;AAAA,QACAG;AAAA,QACAZ;AAAA,MACF;AAAA,MACA,eAAa,QAAQG,CAAI;AAAA,MACzB,OAAO,EAAE,aAAAJ,GAAa,OAAAQ,GAAe,GAAGH,EAAM;AAAA,MAE9C,UAAA,gBAAAS,EAACG,GACC,EAAA,UAAA,gBAAAH,EAACX,GAAI,EAAA,WAAWG,GAAc,OAAO,EAAE,QAAAK,EAAU,GAAA,SAAAJ,EAAA,CAAkB,EACrE,CAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/svg-use/SvgUseIcon.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { IconProps } from '../IconsResolver';
|
|
2
2
|
export interface SvgUseIconProps extends IconProps {
|
|
3
|
+
/**
|
|
4
|
+
* default: 1
|
|
5
|
+
*/
|
|
6
|
+
aspectRatio?: number;
|
|
7
|
+
intrinsicClassName?: string;
|
|
8
|
+
intrinsicRotation?: number;
|
|
9
|
+
svgClassName?: string;
|
|
3
10
|
url: string;
|
|
4
11
|
/**
|
|
5
12
|
* default: '0 0 30 30',
|
|
6
13
|
*/
|
|
7
14
|
viewBox?: string;
|
|
8
|
-
/**
|
|
9
|
-
* aspectRatio: 1
|
|
10
|
-
*/
|
|
11
|
-
aspectRatio?: number;
|
|
12
|
-
intrinsicRotation?: number;
|
|
13
|
-
intrinsicClassName?: string;
|
|
14
15
|
}
|
|
15
16
|
export declare function SvgUseIcon(props: SvgUseIconProps): import("react/jsx-runtime").JSX.Element;
|
package/svg-use/SvgUseIcon.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { useIconOrientation as
|
|
2
|
+
import { c as h } from "../chunks/index.js";
|
|
3
|
+
import { useIconOrientation as g } from "../hooks/useIconOrientation.js";
|
|
4
4
|
import { omit as x } from "../utils/omit.js";
|
|
5
|
-
function
|
|
5
|
+
function w(e) {
|
|
6
6
|
const {
|
|
7
|
+
aspectRatio: i,
|
|
8
|
+
className: s,
|
|
9
|
+
color: o = "inherit",
|
|
7
10
|
name: n,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
...l
|
|
16
|
-
} = i, { intrinsicClassName: d, transform: p } = h(i), f = `text-${r}`;
|
|
11
|
+
style: a,
|
|
12
|
+
svgClassName: r,
|
|
13
|
+
url: c,
|
|
14
|
+
viewBox: l,
|
|
15
|
+
width: m,
|
|
16
|
+
...d
|
|
17
|
+
} = e, { intrinsicClassName: p, rotate: u } = g(e), f = `text-${o}`;
|
|
17
18
|
return /* @__PURE__ */ t(
|
|
18
19
|
"span",
|
|
19
20
|
{
|
|
20
21
|
"aria-hidden": !0,
|
|
21
|
-
...x(
|
|
22
|
-
className:
|
|
23
|
-
"inline-block shrink-0 align-middle",
|
|
24
|
-
|
|
22
|
+
...x(d, ["group", "orientation", "type"]),
|
|
23
|
+
className: h(
|
|
24
|
+
"inline-block w-16 shrink-0 align-middle",
|
|
25
|
+
p,
|
|
25
26
|
f,
|
|
26
|
-
|
|
27
|
+
s
|
|
27
28
|
),
|
|
28
|
-
"data-name": "Icon",
|
|
29
29
|
"data-testid": `icon-${n}`,
|
|
30
|
-
style: {
|
|
31
|
-
children: /* @__PURE__ */ t("svg", { viewBox:
|
|
30
|
+
style: { aspectRatio: i, width: m, ...a },
|
|
31
|
+
children: /* @__PURE__ */ t("svg", { className: r, style: { rotate: u }, viewBox: l, children: /* @__PURE__ */ t("use", { xlinkHref: c }) })
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
w as SvgUseIcon
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=SvgUseIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgUseIcon.js","sources":["../../lib/svg-use/SvgUseIcon.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { IconProps } from '@/IconsResolver';\nimport { useIconOrientation } from '@/hooks/useIconOrientation';\nimport { omit } from '@/utils/omit';\n\nexport interface SvgUseIconProps extends IconProps {\n
|
|
1
|
+
{"version":3,"file":"SvgUseIcon.js","sources":["../../lib/svg-use/SvgUseIcon.tsx"],"sourcesContent":["import classnames from 'classnames';\nimport type { IconProps } from '@/IconsResolver';\nimport { useIconOrientation } from '@/hooks/useIconOrientation';\nimport { omit } from '@/utils/omit';\n\nexport interface SvgUseIconProps extends IconProps {\n /**\n * default: 1\n */\n aspectRatio?: number;\n intrinsicClassName?: string;\n intrinsicRotation?: number;\n svgClassName?: string;\n url: string;\n /**\n * default: '0 0 30 30',\n */\n viewBox?: string;\n}\n\nexport function SvgUseIcon(props: SvgUseIconProps) {\n const {\n aspectRatio,\n className,\n color = 'inherit',\n name,\n style,\n svgClassName,\n url,\n viewBox,\n width,\n ...attrs\n } = props;\n const { intrinsicClassName, rotate } = useIconOrientation(props);\n\n const iconColor = `text-${color}`;\n\n return (\n <span\n aria-hidden={true}\n {...omit(attrs, ['group', 'orientation', 'type'])}\n className={classnames(\n 'inline-block w-16 shrink-0 align-middle',\n intrinsicClassName,\n iconColor,\n className,\n )}\n data-testid={`icon-${name}`}\n style={{ aspectRatio, width: width!, ...style }}\n >\n <svg className={svgClassName} style={{ rotate }} viewBox={viewBox}>\n <use xlinkHref={url} />\n </svg>\n </span>\n );\n}\n"],"names":["SvgUseIcon","props","aspectRatio","className","color","name","style","svgClassName","url","viewBox","width","attrs","intrinsicClassName","rotate","useIconOrientation","iconColor","jsx","omit","classnames"],"mappings":";;;;AAoBO,SAASA,EAAWC,GAAwB;AAC3C,QAAA;AAAA,IACJ,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,KAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAV,GACE,EAAE,oBAAAW,GAAoB,QAAAC,EAAO,IAAIC,EAAmBb,CAAK,GAEzDc,IAAY,QAAQX,CAAK;AAG7B,SAAA,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAa;AAAA,MACZ,GAAGC,EAAKN,GAAO,CAAC,SAAS,eAAe,MAAM,CAAC;AAAA,MAChD,WAAWO;AAAA,QACT;AAAA,QACAN;AAAA,QACAG;AAAA,QACAZ;AAAA,MACF;AAAA,MACA,eAAa,QAAQE,CAAI;AAAA,MACzB,OAAO,EAAE,aAAAH,GAAa,OAAAQ,GAAe,GAAGJ,EAAM;AAAA,MAE9C,UAAC,gBAAAU,EAAA,OAAA,EAAI,WAAWT,GAAc,OAAO,EAAE,QAAAM,EAAO,GAAG,SAAAJ,GAC/C,UAAA,gBAAAO,EAAC,OAAI,EAAA,WAAWR,EAAK,CAAA,GACvB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|