@pibit.ai/cure-design-system 0.6.14 → 0.6.16
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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -39
- package/dist/patterns/empty-state/circle-pattern.d.ts +5 -0
- package/dist/patterns/empty-state/circle-pattern.d.ts.map +1 -0
- package/dist/patterns/empty-state/circle-pattern.js +162 -0
- package/dist/patterns/empty-state/empty-state.d.ts +29 -0
- package/dist/patterns/empty-state/empty-state.d.ts.map +1 -0
- package/dist/patterns/empty-state/empty-state.js +73 -0
- package/dist/patterns/empty-state/index.d.ts +2 -0
- package/dist/patterns/empty-state/index.d.ts.map +1 -0
- package/dist/patterns/tabs/index.d.ts +2 -0
- package/dist/patterns/tabs/index.d.ts.map +1 -0
- package/dist/patterns/tabs/tabs.d.ts +42 -0
- package/dist/patterns/tabs/tabs.d.ts.map +1 -0
- package/dist/patterns/tabs/tabs.js +217 -0
- package/dist/primitives/featured-icon/featured-icon.d.ts +14 -0
- package/dist/primitives/featured-icon/featured-icon.d.ts.map +1 -0
- package/dist/primitives/featured-icon/featured-icon.js +136 -0
- package/dist/primitives/featured-icon/index.d.ts +2 -0
- package/dist/primitives/featured-icon/index.d.ts.map +1 -0
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import { TabListProps as AriaTabListProps, TabProps as AriaTabProps, TabRenderProps as AriaTabRenderProps, TabPanel as AriaTabPanel, Tabs as AriaTabs } from 'react-aria-components';
|
|
3
|
+
type Orientation = "horizontal" | "vertical";
|
|
4
|
+
type HorizontalTypes = "button-brand" | "button-gray" | "button-border" | "button-minimal" | "underline" | "button-curved";
|
|
5
|
+
type VerticalTypes = "button-brand" | "button-gray" | "button-border" | "button-minimal" | "line";
|
|
6
|
+
type TabTypeColors<T> = T extends "horizontal" ? HorizontalTypes : VerticalTypes;
|
|
7
|
+
declare const sizes: Record<"xs" | "sm" | "md", Partial<Record<HorizontalTypes | VerticalTypes, string>>>;
|
|
8
|
+
export interface TabListComponentProps<T extends object, K extends Orientation> extends AriaTabListProps<T> {
|
|
9
|
+
/** The size of the tab list. */
|
|
10
|
+
size?: keyof typeof sizes;
|
|
11
|
+
/** The type of the tab list. */
|
|
12
|
+
type?: TabTypeColors<K>;
|
|
13
|
+
/** The orientation of the tab list. */
|
|
14
|
+
orientation?: K;
|
|
15
|
+
/** The items of the tab list. */
|
|
16
|
+
items: T[];
|
|
17
|
+
/** Whether the tab list is full width. */
|
|
18
|
+
fullWidth?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const TabList: <T extends Orientation>({ size, type, orientation: orientationProp, fullWidth, className, children, items, ...otherProps }: TabListComponentProps<TabComponentProps, T>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const TabPanel: (props: ComponentPropsWithRef<typeof AriaTabPanel>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export interface TabComponentProps extends AriaTabProps {
|
|
23
|
+
/** The label of the tab. */
|
|
24
|
+
label?: ReactNode;
|
|
25
|
+
/** The children of the tab. */
|
|
26
|
+
children?: ReactNode | ((props: AriaTabRenderProps) => ReactNode);
|
|
27
|
+
/** The badge displayed next to the label. */
|
|
28
|
+
badge?: number | string;
|
|
29
|
+
/** The badge displayed before the label. */
|
|
30
|
+
leadingBadge?: number | string;
|
|
31
|
+
/** The class name for the badge. */
|
|
32
|
+
badgeClassName?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const Tab: (props: TabComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const Tabs: {
|
|
36
|
+
({ className, ...props }: ComponentPropsWithRef<typeof AriaTabs>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
Panel: (props: ComponentPropsWithRef<typeof AriaTabPanel>) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
List: <T extends Orientation>({ size, type, orientation: orientationProp, fullWidth, className, children, items, ...otherProps }: TabListComponentProps<TabComponentProps, T>) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
Item: (props: TabComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/patterns/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,cAAc,IAAI,kBAAkB,EACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EAGjB,MAAM,uBAAuB,CAAC;AAY/B,KAAK,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAG7C,KAAK,eAAe,GAChB,cAAc,GACd,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,WAAW,GACX,eAAe,CAAC;AACpB,KAAK,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAClG,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AAsDjF,QAAA,MAAM,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,GAAG,aAAa,EAAE,MAAM,CAAC,CAAC,CA2B/F,CAAC;AA0CF,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,WAAW,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IACzG,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,gCAAgC;IAChC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACxB,uCAAuC;IACvC,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,iCAAiC;IACjC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAYD,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,WAAW,EAAE,oGAS5C,qBAAqB,CAAC,iBAAiB,EAAE,CAAC,CAAC,4CAoC7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,qBAAqB,CAAC,OAAO,YAAY,CAAC,4CAYzE,CAAC;AAEF,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,4BAA4B;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;IAClE,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,GAAG,GAAI,OAAO,iBAAiB,4CA8C3C,CAAC;AAEF,eAAO,MAAM,IAAI;8BAA6B,qBAAqB,CAAC,OAAO,QAAQ,CAAC;mBA3EpD,qBAAqB,CAAC,OAAO,YAAY,CAAC;WA/ClD,CAAC,SAAS,WAAW,sGAS1C,qBAAqB,CAAC,iBAAiB,EAAE,CAAC,CAAC;kBAiEnB,iBAAiB;CAgE3C,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsx as b, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as _, useContext as v, Fragment as T } from "react";
|
|
3
|
+
import { Tabs as w, useSlottedContext as z, TabsContext as N, TabList as C, Tab as B, TabPanel as L } from "react-aria-components";
|
|
4
|
+
import { cx as e } from "../../utils/cn.js";
|
|
5
|
+
import { Badge as p } from "../../primitives/badge/badge.js";
|
|
6
|
+
const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) => ({
|
|
7
|
+
"button-brand": e(
|
|
8
|
+
"outline-focus-ring",
|
|
9
|
+
t && "outline-2 -outline-offset-2",
|
|
10
|
+
n && "bg-brand-primary_alt text-[var(--color-brand-600)]",
|
|
11
|
+
o && "text-[var(--color-brand-600)]"
|
|
12
|
+
),
|
|
13
|
+
"button-gray": e(
|
|
14
|
+
"outline-focus-ring",
|
|
15
|
+
o && "bg-primary_hover text-secondary",
|
|
16
|
+
t && "outline-2 -outline-offset-2",
|
|
17
|
+
n && "bg-active text-secondary"
|
|
18
|
+
),
|
|
19
|
+
"button-border": e(
|
|
20
|
+
"outline-focus-ring",
|
|
21
|
+
(n || o) && "bg-primary_alt text-secondary shadow-sm",
|
|
22
|
+
t && "outline-2 -outline-offset-2"
|
|
23
|
+
),
|
|
24
|
+
"button-minimal": e(
|
|
25
|
+
"rounded-lg outline-focus-ring",
|
|
26
|
+
o && "text-secondary",
|
|
27
|
+
t && "outline-2 -outline-offset-2",
|
|
28
|
+
n && "bg-primary_alt text-secondary shadow-xs ring-1 ring-primary ring-inset"
|
|
29
|
+
),
|
|
30
|
+
underline: e(
|
|
31
|
+
"rounded-none outline-focus-ring",
|
|
32
|
+
n && "border-b-2 border-[var(--color-brand-600)] text-[var(--color-brand-600)]",
|
|
33
|
+
o && "text-[var(--color-brand-600)] border-transparent",
|
|
34
|
+
!a && "hover:border-[var(--color-brand-600)] hover:text-[var(--color-brand-600)]",
|
|
35
|
+
t && "outline-2 -outline-offset-2"
|
|
36
|
+
),
|
|
37
|
+
line: e(
|
|
38
|
+
"rounded-none border-l-2 border-transparent outline-focus-ring",
|
|
39
|
+
n && "border-fg-brand-primary_alt text-brand-secondary",
|
|
40
|
+
o && "text-brand-secondary",
|
|
41
|
+
t && "outline-2 -outline-offset-2"
|
|
42
|
+
),
|
|
43
|
+
"button-curved": e(
|
|
44
|
+
"rounded-none rounded-t-xl outline-focus-ring relative text-xs font-medium transition-all duration-200 ease-out",
|
|
45
|
+
"before:absolute before:-left-3 before:bottom-0 before:size-3 before:rounded-br-lg before:transition-shadow before:duration-200 before:ease-out",
|
|
46
|
+
"after:absolute after:-right-3 after:bottom-0 after:size-3 after:rounded-bl-lg after:transition-shadow after:duration-200 after:ease-out",
|
|
47
|
+
t && "outline-2 -outline-offset-2",
|
|
48
|
+
n && "bg-primary text-brand-tertiary z-10 font-semibold",
|
|
49
|
+
n && "before:shadow-[4px_4px_0_0_var(--color-bg-primary)]",
|
|
50
|
+
n && "after:shadow-[-4px_4px_0_0_var(--color-bg-primary)]",
|
|
51
|
+
!n && "before:shadow-[4px_4px_0_0_transparent] after:shadow-[-4px_4px_0_0_transparent]",
|
|
52
|
+
!n && !a && o && "bg-primary_hover text-primary"
|
|
53
|
+
)
|
|
54
|
+
}), j = {
|
|
55
|
+
xs: {
|
|
56
|
+
"button-brand": "text-xs font-semibold px-2",
|
|
57
|
+
"button-gray": "text-xs font-semibold px-2",
|
|
58
|
+
"button-border": "text-xs font-semibold px-2",
|
|
59
|
+
"button-minimal": "text-xs font-semibold px-2",
|
|
60
|
+
underline: "text-xs font-semibold px-1.5 pt-0",
|
|
61
|
+
line: "text-xs font-semibold pl-2.5 pr-2.5"
|
|
62
|
+
},
|
|
63
|
+
sm: {
|
|
64
|
+
"button-brand": "text-sm font-semibold py-2 px-3",
|
|
65
|
+
"button-gray": "text-sm font-semibold py-2 px-3",
|
|
66
|
+
"button-border": "text-sm font-semibold py-2 px-3",
|
|
67
|
+
"button-minimal": "text-sm font-semibold py-2 px-3",
|
|
68
|
+
underline: "text-sm font-semibold px-1 pb-2.5 pt-0",
|
|
69
|
+
line: "text-sm font-semibold pl-2.5 pr-3 py-0.5",
|
|
70
|
+
"button-curved": "py-2 px-4"
|
|
71
|
+
},
|
|
72
|
+
md: {
|
|
73
|
+
"button-brand": "text-md font-semibold py-2.5 px-3",
|
|
74
|
+
"button-gray": "text-md font-semibold py-2.5 px-3",
|
|
75
|
+
"button-border": "text-md font-semibold py-2.5 px-3",
|
|
76
|
+
"button-minimal": "text-md font-semibold py-2.5 px-3",
|
|
77
|
+
underline: "text-md font-semibold px-1 pb-2.5 pt-0",
|
|
78
|
+
line: "text-md font-semibold pr-3.5 pl-3 py-1",
|
|
79
|
+
"button-curved": "py-2.5 px-5"
|
|
80
|
+
}
|
|
81
|
+
}, $ = ({ size: t, fullWidth: n }) => ({
|
|
82
|
+
"button-brand": "gap-1",
|
|
83
|
+
"button-gray": "gap-1",
|
|
84
|
+
"button-border": e(
|
|
85
|
+
"gap-1 rounded-[10px] bg-secondary_alt p-1 ring-1 ring-secondary ring-inset",
|
|
86
|
+
t === "md" && "rounded-xl p-1.5"
|
|
87
|
+
),
|
|
88
|
+
"button-minimal": "gap-0.5 rounded-lg bg-secondary_alt ring-1 ring-inset ring-secondary",
|
|
89
|
+
underline: e("gap-3", n && "w-full gap-4"),
|
|
90
|
+
line: "gap-2",
|
|
91
|
+
"button-curved": "gap-0"
|
|
92
|
+
});
|
|
93
|
+
function I(t) {
|
|
94
|
+
return t.some((n) => {
|
|
95
|
+
if (!("badge" in n)) return !1;
|
|
96
|
+
const o = n.badge;
|
|
97
|
+
return o != null && String(o).length > 0;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const k = {
|
|
101
|
+
xs: "!min-h-8",
|
|
102
|
+
sm: "!min-h-9",
|
|
103
|
+
md: "!min-h-10"
|
|
104
|
+
}, g = ({ isSelected: t, isHovered: n }) => ({
|
|
105
|
+
"button-brand": t || n ? "brand" : "gray",
|
|
106
|
+
"button-gray": "gray",
|
|
107
|
+
"button-border": "gray",
|
|
108
|
+
"button-minimal": "gray",
|
|
109
|
+
underline: t || n ? "brand" : "gray",
|
|
110
|
+
line: t || n ? "brand" : "gray",
|
|
111
|
+
"button-curved": "gray"
|
|
112
|
+
}), c = _({
|
|
113
|
+
size: "sm",
|
|
114
|
+
type: "button-brand",
|
|
115
|
+
reserveBadgeSlot: !1
|
|
116
|
+
}), A = ({
|
|
117
|
+
size: t = "sm",
|
|
118
|
+
type: n = "button-brand",
|
|
119
|
+
orientation: o,
|
|
120
|
+
fullWidth: a,
|
|
121
|
+
className: d,
|
|
122
|
+
children: m,
|
|
123
|
+
items: u,
|
|
124
|
+
...r
|
|
125
|
+
}) => {
|
|
126
|
+
const i = z(N), s = o ?? (i == null ? void 0 : i.orientation) ?? "horizontal", l = s === "horizontal" && n === "underline" && I(u);
|
|
127
|
+
return /* @__PURE__ */ b(c.Provider, { value: { size: t, type: n, orientation: s, fullWidth: a, reserveBadgeSlot: l }, children: /* @__PURE__ */ b(
|
|
128
|
+
C,
|
|
129
|
+
{
|
|
130
|
+
...r,
|
|
131
|
+
items: u,
|
|
132
|
+
className: (f) => e(
|
|
133
|
+
"group flex",
|
|
134
|
+
$({
|
|
135
|
+
size: t,
|
|
136
|
+
fullWidth: a
|
|
137
|
+
})[n],
|
|
138
|
+
s === "vertical" && "w-max flex-col",
|
|
139
|
+
// Only horizontal tabs with underline type have bottom border
|
|
140
|
+
s === "horizontal" && n === "underline" && "relative before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-border-secondary",
|
|
141
|
+
typeof d == "function" ? d(f) : d
|
|
142
|
+
),
|
|
143
|
+
children: m ?? ((f) => /* @__PURE__ */ b(y, { ...f, children: f.children }))
|
|
144
|
+
}
|
|
145
|
+
) });
|
|
146
|
+
}, M = (t) => /* @__PURE__ */ b(
|
|
147
|
+
L,
|
|
148
|
+
{
|
|
149
|
+
...t,
|
|
150
|
+
className: (n) => e(
|
|
151
|
+
"outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
152
|
+
typeof t.className == "function" ? t.className(n) : t.className
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
), y = (t) => {
|
|
156
|
+
const { label: n, children: o, badge: a, leadingBadge: d, badgeClassName: m, ...u } = t, { size: r = "sm", type: i = "button-brand", fullWidth: s } = v(c);
|
|
157
|
+
return /* @__PURE__ */ b(
|
|
158
|
+
B,
|
|
159
|
+
{
|
|
160
|
+
...u,
|
|
161
|
+
className: (l) => e(
|
|
162
|
+
"z-10 flex h-max cursor-pointer items-center justify-center gap-1 rounded-md whitespace-nowrap text-secondary transition duration-100 ease-linear",
|
|
163
|
+
"group-orientation-vertical:justify-start",
|
|
164
|
+
s && "w-full flex-1",
|
|
165
|
+
k[r],
|
|
166
|
+
j[r][i],
|
|
167
|
+
P(l)[i],
|
|
168
|
+
typeof t.className == "function" ? t.className(l) : t.className
|
|
169
|
+
),
|
|
170
|
+
children: (l) => /* @__PURE__ */ h(T, { children: [
|
|
171
|
+
d && /* @__PURE__ */ b(
|
|
172
|
+
p,
|
|
173
|
+
{
|
|
174
|
+
size: r === "xs" ? "sm" : r,
|
|
175
|
+
type: "pill-color",
|
|
176
|
+
color: g(l)[i],
|
|
177
|
+
className: e("hidden transition-inherit-all md:flex", r === "sm" && "-my-px", m),
|
|
178
|
+
children: d
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
typeof o == "function" ? o(l) : o || n,
|
|
182
|
+
a && /* @__PURE__ */ b(
|
|
183
|
+
p,
|
|
184
|
+
{
|
|
185
|
+
size: r === "xs" ? "sm" : r,
|
|
186
|
+
type: "pill-color",
|
|
187
|
+
color: g(l)[i],
|
|
188
|
+
className: e("hidden transition-inherit-all md:flex", r === "sm" && "-my-px"),
|
|
189
|
+
children: a
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] })
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}, x = ({ className: t, ...n }) => /* @__PURE__ */ b(
|
|
196
|
+
w,
|
|
197
|
+
{
|
|
198
|
+
keyboardActivation: "manual",
|
|
199
|
+
...n,
|
|
200
|
+
className: (o) => e(
|
|
201
|
+
// RAC marks the root `data-focus-visible` whenever anything inside it has keyboard focus, and the
|
|
202
|
+
// design system's global `[data-focus-visible]` outline would ring the whole tab section.
|
|
203
|
+
// The focused tab or control draws its own ring.
|
|
204
|
+
"flex w-full flex-col outline-hidden",
|
|
205
|
+
typeof t == "function" ? t(o) : t
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
x.Panel = M;
|
|
210
|
+
x.List = A;
|
|
211
|
+
x.Item = y;
|
|
212
|
+
export {
|
|
213
|
+
y as Tab,
|
|
214
|
+
A as TabList,
|
|
215
|
+
M as TabPanel,
|
|
216
|
+
x as Tabs
|
|
217
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactNode, Ref } from 'react';
|
|
2
|
+
export interface FeaturedIconProps {
|
|
3
|
+
ref?: Ref<HTMLDivElement>;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
icon?: FC<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}> | ReactNode;
|
|
9
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
10
|
+
color: "brand" | "gray" | "success" | "warning" | "error";
|
|
11
|
+
theme?: "light" | "gradient" | "dark" | "outline" | "modern" | "modern-neue";
|
|
12
|
+
}
|
|
13
|
+
export declare const FeaturedIcon: (props: FeaturedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=featured-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featured-icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/featured-icon/featured-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA6HhD,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1D,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;CAC9E;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAwBpD,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as n } from "react";
|
|
3
|
+
import { cx as f, sortCx as g } from "../../utils/cn.js";
|
|
4
|
+
import { isReactComponent as l } from "../../utils/is-react-component.js";
|
|
5
|
+
const c = {
|
|
6
|
+
sm: "*:data-icon:size-4",
|
|
7
|
+
md: "*:data-icon:size-5",
|
|
8
|
+
lg: "*:data-icon:size-6",
|
|
9
|
+
xl: "*:data-icon:size-7"
|
|
10
|
+
}, s = g({
|
|
11
|
+
light: {
|
|
12
|
+
base: "rounded-full",
|
|
13
|
+
sizes: {
|
|
14
|
+
sm: "size-8",
|
|
15
|
+
md: "size-10",
|
|
16
|
+
lg: "size-12",
|
|
17
|
+
xl: "size-14"
|
|
18
|
+
},
|
|
19
|
+
colors: {
|
|
20
|
+
brand: "bg-brand-secondary text-featured-icon-light-fg-brand",
|
|
21
|
+
gray: "bg-tertiary text-featured-icon-light-fg-gray",
|
|
22
|
+
error: "bg-error-secondary text-featured-icon-light-fg-error",
|
|
23
|
+
warning: "bg-warning-secondary text-featured-icon-light-fg-warning",
|
|
24
|
+
success: "bg-success-secondary text-featured-icon-light-fg-success"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
gradient: {
|
|
28
|
+
base: "rounded-full text-fg-white before:absolute before:inset-0 before:size-full before:rounded-full before:border before:mask-b-from-0% after:absolute after:block after:rounded-full",
|
|
29
|
+
sizes: {
|
|
30
|
+
sm: "size-8 after:size-6 *:data-icon:size-4",
|
|
31
|
+
md: "size-10 after:size-7 *:data-icon:size-4",
|
|
32
|
+
lg: "size-12 after:size-8 *:data-icon:size-5",
|
|
33
|
+
xl: "size-14 after:size-10 *:data-icon:size-5"
|
|
34
|
+
},
|
|
35
|
+
colors: {
|
|
36
|
+
brand: "before:border-utility-brand-200 before:bg-utility-brand-50 after:bg-brand-solid",
|
|
37
|
+
gray: "before:border-utility-gray-200 before:bg-utility-gray-50 after:bg-secondary-solid",
|
|
38
|
+
error: "before:border-utility-error-200 before:bg-utility-error-50 after:bg-error-solid",
|
|
39
|
+
warning: "before:border-utility-warning-200 before:bg-utility-warning-50 after:bg-warning-solid",
|
|
40
|
+
success: "before:border-utility-success-200 before:bg-utility-success-50 after:bg-success-solid"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
dark: {
|
|
44
|
+
base: "text-fg-white shadow-xs-skeumorphic before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0%",
|
|
45
|
+
sizes: {
|
|
46
|
+
sm: "size-8 rounded-md before:rounded-[5px]",
|
|
47
|
+
md: "size-10 rounded-lg before:rounded-[7px]",
|
|
48
|
+
lg: "size-12 rounded-[10px] before:rounded-[9px]",
|
|
49
|
+
xl: "size-14 rounded-xl before:rounded-[11px]"
|
|
50
|
+
},
|
|
51
|
+
colors: {
|
|
52
|
+
brand: "bg-brand-solid before:border-utility-brand-200/12",
|
|
53
|
+
gray: "bg-secondary-solid before:border-utility-gray-200/12",
|
|
54
|
+
error: "bg-error-solid before:border-utility-error-200/12",
|
|
55
|
+
warning: "bg-warning-solid before:border-utility-warning-200/12",
|
|
56
|
+
success: "bg-success-solid before:border-utility-success-200/12"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
modern: {
|
|
60
|
+
base: "bg-primary ",
|
|
61
|
+
sizes: {
|
|
62
|
+
sm: "size-8 rounded-md",
|
|
63
|
+
md: "size-10 rounded-lg",
|
|
64
|
+
lg: "size-12 rounded-[10px]",
|
|
65
|
+
xl: "size-14 rounded-xl"
|
|
66
|
+
},
|
|
67
|
+
colors: {
|
|
68
|
+
brand: "",
|
|
69
|
+
gray: "text-fg-secondary ring-primary",
|
|
70
|
+
error: "",
|
|
71
|
+
warning: "",
|
|
72
|
+
success: ""
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"modern-neue": {
|
|
76
|
+
base: [
|
|
77
|
+
"bg-primary_alt ring-1 ring-inset before:absolute before:inset-1",
|
|
78
|
+
// Shadow
|
|
79
|
+
"before:shadow-[0px_1px_2px_0px_rgba(0,0,0,0.1),0px_3px_3px_0px_rgba(0,0,0,0.09),1px_8px_5px_0px_rgba(0,0,0,0.05),2px_21px_6px_0px_rgba(0,0,0,0),0px_0px_0px_1px_rgba(0,0,0,0.08),1px_13px_5px_0px_rgba(0,0,0,0.01),0px_-2px_2px_0px_rgba(0,0,0,0.13)_inset] before:ring-1 before:ring-secondary_alt"
|
|
80
|
+
].join(" "),
|
|
81
|
+
sizes: {
|
|
82
|
+
sm: "size-8 rounded-[8px] before:rounded-[4px]",
|
|
83
|
+
md: "size-10 rounded-[10px] before:rounded-[6px]",
|
|
84
|
+
lg: "size-12 rounded-[12px] before:rounded-[8px]",
|
|
85
|
+
xl: "size-14 rounded-[14px] before:rounded-[10px]"
|
|
86
|
+
},
|
|
87
|
+
colors: {
|
|
88
|
+
brand: "",
|
|
89
|
+
gray: "text-fg-secondary ring-primary",
|
|
90
|
+
error: "",
|
|
91
|
+
warning: "",
|
|
92
|
+
success: ""
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
outline: {
|
|
96
|
+
base: "before:absolute before:rounded-full before:border-2 after:absolute after:rounded-full after:border-2",
|
|
97
|
+
sizes: {
|
|
98
|
+
sm: "size-4 before:size-6 after:size-8.5",
|
|
99
|
+
md: "size-5 before:size-7 after:size-9.5",
|
|
100
|
+
lg: "size-6 before:size-8 after:size-10.5",
|
|
101
|
+
xl: "size-7 before:size-9 after:size-11.5"
|
|
102
|
+
},
|
|
103
|
+
colors: {
|
|
104
|
+
brand: "text-fg-brand-primary before:border-fg-brand-primary/30 after:border-fg-brand-primary/10",
|
|
105
|
+
gray: "text-fg-tertiary before:border-fg-tertiary/30 after:border-fg-tertiary/10",
|
|
106
|
+
error: "text-fg-error-primary before:border-fg-error-primary/30 after:border-fg-error-primary/10",
|
|
107
|
+
warning: "text-fg-warning-primary before:border-fg-warning-primary/30 after:border-fg-warning-primary/10",
|
|
108
|
+
success: "text-fg-success-primary before:border-fg-success-primary/30 after:border-fg-success-primary/10"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}), y = (r) => {
|
|
112
|
+
const { size: i = "sm", theme: o = "light", color: t = "brand", icon: e, ...d } = r;
|
|
113
|
+
return /* @__PURE__ */ b(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
...d,
|
|
117
|
+
"data-featured-icon": !0,
|
|
118
|
+
className: f(
|
|
119
|
+
"relative flex shrink-0 items-center justify-center",
|
|
120
|
+
c[i],
|
|
121
|
+
s[o].base,
|
|
122
|
+
s[o].sizes[i],
|
|
123
|
+
s[o].colors[t],
|
|
124
|
+
r.className
|
|
125
|
+
),
|
|
126
|
+
children: [
|
|
127
|
+
l(e) && /* @__PURE__ */ a(e, { "data-icon": !0, className: "z-1" }),
|
|
128
|
+
n(e) && /* @__PURE__ */ a("div", { className: "z-1", children: e }),
|
|
129
|
+
r.children
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
export {
|
|
135
|
+
y as FeaturedIcon
|
|
136
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/featured-icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|