@youngonesworks/ui 0.1.124 → 0.1.127
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 +1 -35
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/themeIcon/ThemeIcon.stories.d.ts +1 -1
- package/dist/components/themeIcon/index.d.ts +1 -1
- package/dist/foundation/typography/Typography.stories.d.ts +5 -0
- package/dist/globals.css +2 -0
- package/dist/index.cjs +11 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +12 -40
- package/dist/index.js.map +1 -1
- package/dist/styles/index.d.ts +3 -0
- package/dist/styles/utilities.css +24 -154
- package/dist/styles/variables.css +54 -42
- package/dist/utils/enums.d.ts +3 -3
- package/package.json +1 -1
- package/dist/theme/index.d.ts +0 -4
- package/dist/theme/variables.d.ts +0 -62
package/README.md
CHANGED
|
@@ -88,36 +88,6 @@ function App() {
|
|
|
88
88
|
}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
#### TypeScript CSS Variable Helpers
|
|
92
|
-
|
|
93
|
-
```tsx
|
|
94
|
-
import {
|
|
95
|
-
getCSSVariable,
|
|
96
|
-
setCSSVariable,
|
|
97
|
-
type CSSVariables,
|
|
98
|
-
} from "@youngonesworks/ui/theme";
|
|
99
|
-
|
|
100
|
-
// Get CSS variable values
|
|
101
|
-
const primaryColor = getCSSVariable("--color-primary");
|
|
102
|
-
const fontSize = getCSSVariable("--font-lg-size");
|
|
103
|
-
|
|
104
|
-
// Set CSS variables dynamically
|
|
105
|
-
setCSSVariable("--color-primary", "#ff6b35");
|
|
106
|
-
setCSSVariable("--font-lg-size", "1.25rem");
|
|
107
|
-
|
|
108
|
-
// Type-safe variable names
|
|
109
|
-
const variables: CSSVariables = {
|
|
110
|
-
colors: {
|
|
111
|
-
primary: "#10d1bb",
|
|
112
|
-
secondary: "#6366f1",
|
|
113
|
-
},
|
|
114
|
-
typography: {
|
|
115
|
-
fontLgSize: "1.125rem",
|
|
116
|
-
fontBaseLine: "1.5rem",
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
```
|
|
120
|
-
|
|
121
91
|
### 🔤 Next.js Fonts
|
|
122
92
|
|
|
123
93
|
#### Setup in Next.js App Router
|
|
@@ -171,9 +141,6 @@ export default function RootLayout({ children }) {
|
|
|
171
141
|
// Components
|
|
172
142
|
import { Button, Card, Input } from "@youngonesworks/ui";
|
|
173
143
|
|
|
174
|
-
// CSS Variables (TypeScript helpers)
|
|
175
|
-
import { getCSSVariable, setCSSVariable } from "@youngonesworks/ui/theme";
|
|
176
|
-
|
|
177
144
|
// CSS files (import in CSS/SCSS)
|
|
178
145
|
// @import '@youngonesworks/ui/styles/variables.css';
|
|
179
146
|
// @import '@youngonesworks/ui/styles/utilities.css';
|
|
@@ -281,8 +248,7 @@ Contributions are welcome! Please follow these guidelines:
|
|
|
281
248
|
When adding new CSS variables:
|
|
282
249
|
|
|
283
250
|
1. Add them to `src/styles/variables.css`
|
|
284
|
-
2.
|
|
285
|
-
3. Document them in this README
|
|
251
|
+
2. Document them in this README
|
|
286
252
|
|
|
287
253
|
## License
|
|
288
254
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface IBadgeProps {
|
|
2
|
-
styleVariant?: 'green-light' | 'red' | 'accent-blue' | 'warning' | 'gray' | 'black' | 'dark-gray' | 'purple' | '
|
|
3
|
-
color?: 'dark' | 'gray' | 'red' | '
|
|
2
|
+
styleVariant?: 'green-light' | 'red' | 'accent-blue' | 'warning' | 'gray' | 'black' | 'dark-gray' | 'purple' | 'secondary' | 'secondary-light' | 'gray' | 'white';
|
|
3
|
+
color?: 'dark' | 'gray' | 'red' | 'secondary' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'green' | 'lime' | 'yellow' | 'orange' | 'teal';
|
|
4
4
|
favorite?: boolean;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
className?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
2
|
export interface IThemeIcon extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
3
|
-
styleVariant?: 'black' | 'gray' | '
|
|
3
|
+
styleVariant?: 'black' | 'gray' | 'secondary' | 'secondary-with-background' | 'turquoise' | 'accent-blue' | 'check' | 'warning' | 'error';
|
|
4
4
|
icon: React.ReactNode;
|
|
5
5
|
className?: string;
|
|
6
6
|
adjustedSize?: string | number;
|
package/dist/globals.css
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -233,7 +233,7 @@ let ACTION_ICON_STYLE_VARIANT = /* @__PURE__ */ function(ACTION_ICON_STYLE_VARIA
|
|
|
233
233
|
return ACTION_ICON_STYLE_VARIANT$1;
|
|
234
234
|
}({});
|
|
235
235
|
let THEME_ICON_STYLE_VARIANT = /* @__PURE__ */ function(THEME_ICON_STYLE_VARIANT$1) {
|
|
236
|
-
THEME_ICON_STYLE_VARIANT$1["
|
|
236
|
+
THEME_ICON_STYLE_VARIANT$1["SECONDARY_WITH_BACKGROUND"] = "secondary-with-background";
|
|
237
237
|
return THEME_ICON_STYLE_VARIANT$1;
|
|
238
238
|
}({});
|
|
239
239
|
let COLOR = /* @__PURE__ */ function(COLOR$1) {
|
|
@@ -244,8 +244,8 @@ let COLOR = /* @__PURE__ */ function(COLOR$1) {
|
|
|
244
244
|
COLOR$1["LIGHT_BLUE_DISABLED"] = "light-blue-disabled";
|
|
245
245
|
COLOR$1["GREEN"] = "green";
|
|
246
246
|
COLOR$1["GREEN_LIGHT"] = "green-light";
|
|
247
|
-
COLOR$1["
|
|
248
|
-
COLOR$1["
|
|
247
|
+
COLOR$1["SECONDARY"] = "secondary";
|
|
248
|
+
COLOR$1["SECONDARY_LIGHT"] = "secondary-light";
|
|
249
249
|
COLOR$1["ORANGE"] = "orange";
|
|
250
250
|
COLOR$1["ORANGE_LIGHT"] = "orange-light";
|
|
251
251
|
COLOR$1["ACCENT_BLUE"] = "accent-blue";
|
|
@@ -786,8 +786,8 @@ const Badge = ({ styleVariant = COLOR.ACCENT_BLUE, className, favorite, children
|
|
|
786
786
|
"bg-gray-50 text-black": styleVariant === COLOR.DARK_GRAY,
|
|
787
787
|
"bg-black text-white": styleVariant === COLOR.BLACK,
|
|
788
788
|
"bg-gray-50 text-gray-800": styleVariant === COLOR.GRAY,
|
|
789
|
-
"bg-
|
|
790
|
-
"bg-
|
|
789
|
+
"bg-secondary-light text-secondary": styleVariant === COLOR.SECONDARY_LIGHT,
|
|
790
|
+
"bg-secondary text-white": styleVariant === COLOR.SECONDARY,
|
|
791
791
|
"bg-white text-black": styleVariant === COLOR.WHITE
|
|
792
792
|
}, className),
|
|
793
793
|
...props,
|
|
@@ -1287,7 +1287,7 @@ const Divider = ({ className,...props }) => /* @__PURE__ */ (0, react_jsx_runtim
|
|
|
1287
1287
|
//#endregion
|
|
1288
1288
|
//#region src/components/favouriteButton/index.tsx
|
|
1289
1289
|
const FavouriteButton = (0, react.forwardRef)((props, ref) => {
|
|
1290
|
-
const { onClick, favourite, iconFilled, iconOutline, favouriteTitle, iconColorSelected = "text-
|
|
1290
|
+
const { onClick, favourite, iconFilled, iconOutline, favouriteTitle, iconColorSelected = "text-secondary", iconColor = "text-gray-800", iconSize, className = "", styleVariant = "transparent", children,...rest } = props;
|
|
1291
1291
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionIcon, {
|
|
1292
1292
|
onClick,
|
|
1293
1293
|
"data-component": "favouriteButton",
|
|
@@ -1889,7 +1889,7 @@ const Modal = ({ title, children, withCloseButton = true, opened, additionalClas
|
|
|
1889
1889
|
gradient && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
|
|
1890
1890
|
"data-testid": "modal-gradient",
|
|
1891
1891
|
className: "absolute bottom-0 left-0 mt-8 mb-0 h-2! w-full border-none",
|
|
1892
|
-
style: { backgroundImage: "linear-gradient(90deg, var(--color-light-blue) 0%, var(--color-primary) 50.52%, var(--color-
|
|
1892
|
+
style: { backgroundImage: "linear-gradient(90deg, var(--color-light-blue) 0%, var(--color-primary) 50.52%, var(--color-secondary) 100%)" }
|
|
1893
1893
|
})
|
|
1894
1894
|
]
|
|
1895
1895
|
})
|
|
@@ -2852,7 +2852,7 @@ const TabsBadge = ({ children }) => {
|
|
|
2852
2852
|
const isCircular = typeof children === "number" && children <= 9 || typeof children === "string" && children.length === 1 || false;
|
|
2853
2853
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2854
2854
|
"data-testid": "tabs-badge",
|
|
2855
|
-
className: (0, clsx.default)("bg-
|
|
2855
|
+
className: (0, clsx.default)("bg-secondary h-5 rounded-full text-xs leading-5 font-medium text-white", {
|
|
2856
2856
|
"w-5 text-center": isCircular,
|
|
2857
2857
|
"px-2": !isCircular
|
|
2858
2858
|
}),
|
|
@@ -2955,8 +2955,8 @@ function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, titl
|
|
|
2955
2955
|
const classNames = cn("bg-transparent h-9 w-9 rounded-[5px] grid place-content-center", {
|
|
2956
2956
|
"text-black": styleVariant === COLOR.BLACK,
|
|
2957
2957
|
"text-gray-500": styleVariant === COLOR.GRAY,
|
|
2958
|
-
"text-
|
|
2959
|
-
"bg-gray-50 text-
|
|
2958
|
+
"text-secondary": styleVariant === COLOR.SECONDARY,
|
|
2959
|
+
"bg-gray-50 text-secondary": styleVariant === THEME_ICON_STYLE_VARIANT.SECONDARY_WITH_BACKGROUND,
|
|
2960
2960
|
"text-primary": styleVariant === COLOR.TURQUOISE,
|
|
2961
2961
|
"text-accent-blue": styleVariant === COLOR.ACCENT_BLUE,
|
|
2962
2962
|
"text-check": styleVariant === COLOR.CHECK,
|
|
@@ -3046,7 +3046,7 @@ const TruncatedText = ({ text, limit = 20 }) => {
|
|
|
3046
3046
|
}), text.length > limit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, {
|
|
3047
3047
|
content: text,
|
|
3048
3048
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3049
|
-
className: "text-
|
|
3049
|
+
className: "text-secondary",
|
|
3050
3050
|
"data-testid": "truncated-text-icon",
|
|
3051
3051
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconMessageDots, { stroke: 1 })
|
|
3052
3052
|
})
|
|
@@ -3617,34 +3617,6 @@ const WysiwygEditor = (0, react.forwardRef)(({ id, content, className, placehold
|
|
|
3617
3617
|
})] });
|
|
3618
3618
|
});
|
|
3619
3619
|
|
|
3620
|
-
//#endregion
|
|
3621
|
-
//#region src/theme/variables.ts
|
|
3622
|
-
const CSS_VARIABLE_KEYS = [
|
|
3623
|
-
"--color-primary",
|
|
3624
|
-
"--color-primary-light",
|
|
3625
|
-
"--color-primary-dark",
|
|
3626
|
-
"--color-black",
|
|
3627
|
-
"--color-navy-blue",
|
|
3628
|
-
"--color-white",
|
|
3629
|
-
"--color-accent-blue",
|
|
3630
|
-
"--color-ultra-light-blue",
|
|
3631
|
-
"--color-green",
|
|
3632
|
-
"--color-green-light",
|
|
3633
|
-
"--color-pink",
|
|
3634
|
-
"--color-purple",
|
|
3635
|
-
"--color-orange",
|
|
3636
|
-
"--color-warning",
|
|
3637
|
-
"--color-warning-light",
|
|
3638
|
-
"--color-warning-dark"
|
|
3639
|
-
];
|
|
3640
|
-
const getCSSVariable = (variable) => {
|
|
3641
|
-
if (typeof window !== "undefined") return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
|
|
3642
|
-
return "";
|
|
3643
|
-
};
|
|
3644
|
-
const setCSSVariable = (variable, value) => {
|
|
3645
|
-
if (typeof window !== "undefined") document.documentElement.style.setProperty(variable, value);
|
|
3646
|
-
};
|
|
3647
|
-
|
|
3648
3620
|
//#endregion
|
|
3649
3621
|
exports.AccordionItem = AccordionItem;
|
|
3650
3622
|
exports.AccordionWrapper = AccordionWrapper;
|
|
@@ -3658,7 +3630,6 @@ exports.Badge = Badge;
|
|
|
3658
3630
|
exports.BigBadge = BigBadge;
|
|
3659
3631
|
exports.BreadCrumb = BreadCrumb;
|
|
3660
3632
|
exports.Button = Button;
|
|
3661
|
-
exports.CSS_VARIABLE_KEYS = CSS_VARIABLE_KEYS;
|
|
3662
3633
|
exports.Checkbox = Checkbox;
|
|
3663
3634
|
exports.DatePickerInput = DatePickerInput;
|
|
3664
3635
|
exports.Divider = Divider;
|
|
@@ -3714,6 +3685,4 @@ exports.UnorderedListItem = UnorderedListItem;
|
|
|
3714
3685
|
exports.UnstyledButton = UnstyledButton;
|
|
3715
3686
|
exports.WysiwygEditor = WysiwygEditor;
|
|
3716
3687
|
exports.buttonVariants = buttonVariants;
|
|
3717
|
-
exports.getCSSVariable = getCSSVariable;
|
|
3718
|
-
exports.setCSSVariable = setCSSVariable;
|
|
3719
3688
|
//# sourceMappingURL=index.cjs.map
|