@youngonesworks/ui 0.1.134 → 1.0.1
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 +35 -7
- package/dist/globals.css +1 -9
- package/dist/index.cjs +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/styles/base.css +58 -0
- package/dist/styles/index.css +1 -0
- package/dist/styles/typography.css +20 -82
- package/dist/styles/utilities.css +33 -112
- package/dist/styles/variables.css +2 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,27 +28,54 @@ npm install @youngonesworks/ui
|
|
|
28
28
|
- **react-dom**: ^18 || ^19
|
|
29
29
|
- **next**: ^14 || ^15 _(for Next.js projects)_
|
|
30
30
|
|
|
31
|
-
### Tailwind CSS v4 setup
|
|
31
|
+
### Tailwind CSS v4 setup (required for component styles)
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
Component classes (e.g. KebabMenu title, buttons, layout) are Tailwind utilities. Your app must **scan the library’s built output** so Tailwind generates those classes.
|
|
34
|
+
|
|
35
|
+
**1. Import the library CSS** in your main stylesheet (e.g. `app.css` or `globals.css`):
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
@import "tailwindcss";
|
|
39
|
+
@import "@youngonesworks/ui/styles.css";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**2. Add the library to Tailwind’s source** so utilities used by components are generated. In the **same** main CSS file, add:
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
@source "../node_modules/@youngonesworks/ui/dist";
|
|
46
|
+
```
|
|
37
47
|
|
|
38
|
-
|
|
48
|
+
Use the path that resolves to the library from your CSS file (e.g. `../../node_modules/...` if your CSS lives under `src/`).
|
|
49
|
+
|
|
50
|
+
**Example full setup:**
|
|
51
|
+
|
|
52
|
+
```css
|
|
53
|
+
/* app.css or src/globals.css */
|
|
54
|
+
@import "tailwindcss";
|
|
55
|
+
@source "../node_modules/@youngonesworks/ui/dist";
|
|
56
|
+
@import "@youngonesworks/ui/globals.css";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Without `@source`, components like KebabMenu (e.g. the visible title and dropdown styles) will not get their Tailwind styles in the built CSS.
|
|
60
|
+
|
|
61
|
+
### Tailwind CSS v3 (legacy)
|
|
62
|
+
|
|
63
|
+
If you still use Tailwind v3 with `tailwind.config.js`, include the library in `content`:
|
|
39
64
|
|
|
40
65
|
```js
|
|
41
66
|
/** @type {import('tailwindcss').Config} */
|
|
42
67
|
module.exports = {
|
|
43
68
|
content: [
|
|
44
69
|
"./src/**/*.{js,jsx,ts,tsx}",
|
|
45
|
-
"./node_modules/@youngonesworks/ui/**/*.{js,jsx,ts,tsx}",
|
|
70
|
+
"./node_modules/@youngonesworks/ui/dist/**/*.{js,jsx,ts,tsx}",
|
|
46
71
|
],
|
|
47
72
|
theme: { extend: {} },
|
|
48
73
|
plugins: [],
|
|
49
74
|
};
|
|
50
75
|
```
|
|
51
76
|
|
|
77
|
+
Note: use the **dist** folder, because that is what gets published and where the class names appear.
|
|
78
|
+
|
|
52
79
|
## Usage
|
|
53
80
|
|
|
54
81
|
### 🧩 React Components
|
|
@@ -257,3 +284,4 @@ ISC License - see [LICENSE](LICENSE) file for details.
|
|
|
257
284
|
---
|
|
258
285
|
|
|
259
286
|
**Built with ❤️ by YoungOnes** | [Website](https://youngones.work) | [GitHub](https://github.com/youngonesworks)
|
|
287
|
+
````
|
package/dist/globals.css
CHANGED
|
@@ -11,12 +11,4 @@
|
|
|
11
11
|
@import "react-phone-input-2/lib/style.css";
|
|
12
12
|
@import "./styles/editor.css";
|
|
13
13
|
@import "./styles/typography.css";
|
|
14
|
-
|
|
15
|
-
@keyframes spin {
|
|
16
|
-
from {
|
|
17
|
-
transform: rotate(0deg);
|
|
18
|
-
}
|
|
19
|
-
to {
|
|
20
|
-
transform: rotate(360deg);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
14
|
+
@import "./styles/base.css";
|
package/dist/index.cjs
CHANGED
|
@@ -88,17 +88,20 @@ const AccordionItem = ({ controlContent, panelContent, style = "light", border =
|
|
|
88
88
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
89
89
|
onClick: () => setIsActive(!isActive),
|
|
90
90
|
className: `duration-300${isActive ? "rotate-180" : ""}`,
|
|
91
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconChevronDown, {
|
|
91
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconChevronDown, {
|
|
92
|
+
size: 18,
|
|
93
|
+
color: style === "dark" ? "white" : "black"
|
|
94
|
+
})
|
|
92
95
|
}),
|
|
93
96
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
94
97
|
onClick: () => setIsActive(!isActive),
|
|
95
|
-
className: `flex w-full flex-row justify-between ${style === "dark" && "
|
|
98
|
+
className: `flex w-full flex-row justify-between ${style === "dark" && "text-white"} leading-8 text-lg`,
|
|
96
99
|
children: controlContent
|
|
97
100
|
}),
|
|
98
101
|
endContent
|
|
99
102
|
]
|
|
100
103
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
101
|
-
className: `transition-max-height overflow-hidden duration-500 ease-in-out ${isActive ? "max-h-1000" : "max-h-0"} leading-6
|
|
104
|
+
className: `transition-max-height overflow-hidden duration-500 ease-in-out ${isActive ? "max-h-1000" : "max-h-0"} leading-6 text-base`,
|
|
102
105
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
103
106
|
className: "px-4 py-3",
|
|
104
107
|
children: panelContent
|
|
@@ -1628,7 +1631,7 @@ Island.displayName = "Island";
|
|
|
1628
1631
|
const KebabMenu = ({ title, tooltip, content, disabled = false, styleVariant = "default" }) => {
|
|
1629
1632
|
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
1630
1633
|
const menuRef = (0, react.useRef)(null);
|
|
1631
|
-
const defaultStyling = "
|
|
1634
|
+
const defaultStyling = "flex items-center justify-self-end gap-1 bg-transparent py-1 h-9 min-w-9 cursor-pointer px-0";
|
|
1632
1635
|
const handleToggle = () => {
|
|
1633
1636
|
if (!disabled) setIsOpen((prev) => !prev);
|
|
1634
1637
|
};
|
|
@@ -1656,7 +1659,7 @@ const KebabMenu = ({ title, tooltip, content, disabled = false, styleVariant = "
|
|
|
1656
1659
|
disabled,
|
|
1657
1660
|
onClick: handleToggle,
|
|
1658
1661
|
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1659
|
-
className: "hidden md:block",
|
|
1662
|
+
className: "yo-text-small hidden md:block",
|
|
1660
1663
|
children: title
|
|
1661
1664
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconDotsVertical, {
|
|
1662
1665
|
size: 20,
|