@undefine-ui/design-system 2.0.0 → 2.2.0
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 +75 -11
- package/dist/Satoshi-Regular.ttf +0 -0
- package/dist/Satoshi-Regular.woff +0 -0
- package/dist/Satoshi-Regular.woff2 +0 -0
- package/dist/index.cjs +145 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +180 -39
- package/dist/index.js.map +1 -1
- package/dist/satoshi-4X3TX4PE.css +21 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ pnpm add @undefine-ui/design-system
|
|
|
10
10
|
pnpm add @mui/material @mui/x-data-grid @emotion/react @emotion/styled react react-dom react-hook-form
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
**Note**: Fonts (Work Sans and Geist) are bundled with the package and automatically loaded by the `ThemeProvider`. You don't need to install or import `@fontsource` packages separately.
|
|
14
|
+
|
|
13
15
|
## Usage
|
|
14
16
|
|
|
15
17
|
### Providers
|
|
@@ -29,7 +31,7 @@ export function DesignSystemApp({ children }: { children: React.ReactNode }) {
|
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
- `SettingsProvider` exposes the design-system preferences (mode, contrast, fonts, nav layout) through the `useSettings` hook. Provide your own `settings` object if you want different defaults or if you persist user choices.
|
|
32
|
-
- `ThemeProvider` wraps MUI
|
|
34
|
+
- `ThemeProvider` wraps MUI's CssVarsProvider with the Define theme (`createTheme`). It accepts any React children and automatically injects `CssBaseline` and loads the required fonts (Work Sans and Geist).
|
|
33
35
|
- Both providers are exported from the package root so you can colocate them with your router/root layout.
|
|
34
36
|
|
|
35
37
|
### Theming hooks
|
|
@@ -72,9 +74,50 @@ import {
|
|
|
72
74
|
|
|
73
75
|
Storybook (`pnpm dev:storybook`) documents each component and token surface.
|
|
74
76
|
|
|
77
|
+
### Icon library
|
|
78
|
+
|
|
79
|
+
The package includes a comprehensive icon library with 23 SVG icons organized by category.
|
|
80
|
+
|
|
81
|
+
**Available icons:**
|
|
82
|
+
|
|
83
|
+
- **Navigation:** NavArrowLeft, NavArrowRight, NavArrowDown, LongArrowUpLeftSolid
|
|
84
|
+
- **User:** UserFill, UserOutline
|
|
85
|
+
- **Form Controls:** CheckboxDefault, CheckboxSelect, CheckboxIndeterminate, RadioDefault, RadioSelect
|
|
86
|
+
- **Actions:** Search, Copy, Trash, XMark, XMarkSolid, CloudUpload
|
|
87
|
+
- **Feedback:** InfoCircleFill, InfoCircleOutline, ClipboardCheck, Loader
|
|
88
|
+
- **Visibility:** Eye, EyeClosed
|
|
89
|
+
|
|
90
|
+
**Usage:**
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { Icon } from '@undefine-ui/design-system';
|
|
94
|
+
|
|
95
|
+
// Basic usage
|
|
96
|
+
<Icon icon="Search" sx={{ width: 24, height: 24 }} />
|
|
97
|
+
|
|
98
|
+
// With custom color
|
|
99
|
+
<Icon icon="InfoCircleFill" sx={{ width: 32, height: 32, color: 'primary.main' }} />
|
|
100
|
+
|
|
101
|
+
// Different sizes
|
|
102
|
+
<Icon icon="Loader" sx={{ width: 16, height: 16 }} />
|
|
103
|
+
<Icon icon="Loader" sx={{ width: 48, height: 48 }} />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Props:**
|
|
107
|
+
|
|
108
|
+
- `icon` - Icon name (required, type: `IconType`)
|
|
109
|
+
- `sx` - MUI sx prop for styling (size, color, etc.)
|
|
110
|
+
- All `BoxProps` from MUI are supported
|
|
111
|
+
|
|
112
|
+
The Icon component renders SVG icons with full theme integration and accepts any MUI Box props for flexible styling.
|
|
113
|
+
|
|
75
114
|
### Logo assets
|
|
76
115
|
|
|
77
|
-
|
|
116
|
+
The package exports two Logo components:
|
|
117
|
+
|
|
118
|
+
#### `<Logo />`
|
|
119
|
+
|
|
120
|
+
Renders logo images hosted on Cloudinary by default. The component automatically selects the appropriate variant based on props:
|
|
78
121
|
|
|
79
122
|
| Variant flag combo | Asset served |
|
|
80
123
|
| -------------------------- | ----------------------------------- |
|
|
@@ -87,19 +130,40 @@ Storybook (`pnpm dev:storybook`) documents each component and token surface.
|
|
|
87
130
|
|
|
88
131
|
All logo assets are served from Cloudinary and don't require any local files in your host app.
|
|
89
132
|
|
|
90
|
-
|
|
133
|
+
```tsx
|
|
134
|
+
<Logo isFull isWhite href="/dashboard" />
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Props:**
|
|
138
|
+
|
|
139
|
+
- `isFull` - Use full logo with text (default: `false`)
|
|
140
|
+
- `isWhite` - Use white variant (default: `false`)
|
|
141
|
+
- `isBlack` - Use black variant (default: `false`)
|
|
142
|
+
- `disableLink` - Render without link wrapper (default: `false`)
|
|
143
|
+
- `href` - Link destination (default: `'/'`)
|
|
144
|
+
- `LinkComponent` - Custom link component (default: `'a'`)
|
|
145
|
+
- `src` - Override logo source URL
|
|
146
|
+
- `alt` - Image alt text (default: `'Undefine UI logo'`)
|
|
147
|
+
- `sx` - MUI sx prop for styling
|
|
148
|
+
|
|
149
|
+
#### `<AnimatedLogo />`
|
|
150
|
+
|
|
151
|
+
An animated SVG version of the logo perfect for splash screens and loading states. Features a smooth infinite animation sequence with staggered timing for visual interest.
|
|
91
152
|
|
|
92
153
|
```tsx
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
sx={{ width: 140 }}
|
|
97
|
-
disableLink={false}
|
|
98
|
-
alt="Custom logo"
|
|
99
|
-
/>
|
|
154
|
+
import { AnimatedLogo } from '@undefine-ui/design-system';
|
|
155
|
+
|
|
156
|
+
<AnimatedLogo />;
|
|
100
157
|
```
|
|
101
158
|
|
|
102
|
-
|
|
159
|
+
The animated logo automatically plays on mount with:
|
|
160
|
+
|
|
161
|
+
- Background fade-in
|
|
162
|
+
- Left bars sliding in from the left
|
|
163
|
+
- D letter scaling in with a bounce effect
|
|
164
|
+
- Continuous infinite loop
|
|
165
|
+
|
|
166
|
+
Ideal for splash screens, loading overlays, or brand storytelling moments.
|
|
103
167
|
|
|
104
168
|
## Export surface
|
|
105
169
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
AnimatedLogo: () => AnimatedLogo,
|
|
33
34
|
CheckboxDefault: () => CheckboxDefault,
|
|
34
35
|
CheckboxIndeterminate: () => CheckboxIndeterminate,
|
|
35
36
|
CheckboxSelect: () => CheckboxSelect,
|
|
@@ -68,6 +69,7 @@ __export(index_exports, {
|
|
|
68
69
|
SettingsConsumer: () => SettingsConsumer,
|
|
69
70
|
SettingsContext: () => SettingsContext,
|
|
70
71
|
SettingsProvider: () => SettingsProvider,
|
|
72
|
+
SplashScreen: () => SplashScreen,
|
|
71
73
|
Table: () => Table,
|
|
72
74
|
TablePagination: () => TablePagination,
|
|
73
75
|
ThemeProvider: () => ThemeProvider,
|
|
@@ -2047,7 +2049,7 @@ var Search = (props) => {
|
|
|
2047
2049
|
fillRule: "evenodd",
|
|
2048
2050
|
clipRule: "evenodd",
|
|
2049
2051
|
d: "M10.9804 10.9798C11.1757 10.7845 11.4923 10.7845 11.6875 10.9798L14.3542 13.6464C14.5495 13.8417 14.5495 14.1583 14.3542 14.3535C14.1589 14.5488 13.8424 14.5488 13.6471 14.3535L10.9804 11.6869C10.7852 11.4916 10.7852 11.175 10.9804 10.9798Z",
|
|
2050
|
-
fill: "
|
|
2052
|
+
fill: "currentColor"
|
|
2051
2053
|
}
|
|
2052
2054
|
),
|
|
2053
2055
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -2056,7 +2058,7 @@ var Search = (props) => {
|
|
|
2056
2058
|
fillRule: "evenodd",
|
|
2057
2059
|
clipRule: "evenodd",
|
|
2058
2060
|
d: "M7.33333 2.5C4.66396 2.5 2.5 4.66396 2.5 7.33333C2.5 10.0027 4.66396 12.1667 7.33333 12.1667C8.67047 12.1667 9.87999 11.6244 10.7556 10.7465C11.6281 9.87162 12.1667 8.66585 12.1667 7.33333C12.1667 4.66396 10.0027 2.5 7.33333 2.5ZM1.5 7.33333C1.5 4.11167 4.11167 1.5 7.33333 1.5C10.555 1.5 13.1667 4.11167 13.1667 7.33333C13.1667 8.94123 12.5155 10.398 11.4636 11.4526C10.4081 12.5109 8.94682 13.1667 7.33333 13.1667C4.11167 13.1667 1.5 10.555 1.5 7.33333Z",
|
|
2059
|
-
fill: "
|
|
2061
|
+
fill: "currentColor"
|
|
2060
2062
|
}
|
|
2061
2063
|
)
|
|
2062
2064
|
]
|
|
@@ -5562,6 +5564,17 @@ var getInitColorSchemeScript = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
|
5562
5564
|
// src/theme/ThemeProvider.tsx
|
|
5563
5565
|
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"), 1);
|
|
5564
5566
|
var import_styles31 = require("@mui/material/styles");
|
|
5567
|
+
var import__ = require("@fontsource/work-sans/300.css");
|
|
5568
|
+
var import__2 = require("@fontsource/work-sans/400.css");
|
|
5569
|
+
var import__3 = require("@fontsource/work-sans/500.css");
|
|
5570
|
+
var import__4 = require("@fontsource/work-sans/600.css");
|
|
5571
|
+
var import__5 = require("@fontsource/work-sans/700.css");
|
|
5572
|
+
var import__6 = require("@fontsource/geist/300.css");
|
|
5573
|
+
var import__7 = require("@fontsource/geist/400.css");
|
|
5574
|
+
var import__8 = require("@fontsource/geist/500.css");
|
|
5575
|
+
var import__9 = require("@fontsource/geist/600.css");
|
|
5576
|
+
var import__10 = require("@fontsource/geist/700.css");
|
|
5577
|
+
var import_satoshi = require("./satoshi-4X3TX4PE.css");
|
|
5565
5578
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5566
5579
|
var ThemeProvider = ({ children }) => {
|
|
5567
5580
|
const settings = useSettings();
|
|
@@ -5626,6 +5639,108 @@ var Logo = ({
|
|
|
5626
5639
|
}
|
|
5627
5640
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_Link.default, { component: LinkComponent, href, sx: { display: "contents" }, children: logo });
|
|
5628
5641
|
};
|
|
5642
|
+
var AnimatedLogo = () => {
|
|
5643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5644
|
+
"svg",
|
|
5645
|
+
{
|
|
5646
|
+
width: "120",
|
|
5647
|
+
height: "120",
|
|
5648
|
+
viewBox: "0 0 120 120",
|
|
5649
|
+
fill: "none",
|
|
5650
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5651
|
+
children: [
|
|
5652
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("style", { children: `
|
|
5653
|
+
@keyframes fadeIn {
|
|
5654
|
+
from {
|
|
5655
|
+
opacity: 0;
|
|
5656
|
+
}
|
|
5657
|
+
to {
|
|
5658
|
+
opacity: 1;
|
|
5659
|
+
}
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
@keyframes slideInLeft {
|
|
5663
|
+
from {
|
|
5664
|
+
opacity: 0;
|
|
5665
|
+
transform: translateX(-30px);
|
|
5666
|
+
}
|
|
5667
|
+
to {
|
|
5668
|
+
opacity: 1;
|
|
5669
|
+
transform: translateX(0);
|
|
5670
|
+
}
|
|
5671
|
+
}
|
|
5672
|
+
|
|
5673
|
+
@keyframes slideInRight {
|
|
5674
|
+
from {
|
|
5675
|
+
opacity: 0;
|
|
5676
|
+
transform: translateX(30px);
|
|
5677
|
+
}
|
|
5678
|
+
to {
|
|
5679
|
+
opacity: 1;
|
|
5680
|
+
transform: translateX(0);
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5683
|
+
|
|
5684
|
+
@keyframes scaleIn {
|
|
5685
|
+
from {
|
|
5686
|
+
opacity: 0;
|
|
5687
|
+
transform: scale(0.5);
|
|
5688
|
+
}
|
|
5689
|
+
to {
|
|
5690
|
+
opacity: 1;
|
|
5691
|
+
transform: scale(1);
|
|
5692
|
+
}
|
|
5693
|
+
}
|
|
5694
|
+
|
|
5695
|
+
.background-rect {
|
|
5696
|
+
animation: fadeIn 1.2s ease-out infinite;
|
|
5697
|
+
opacity: 0;
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
.bars {
|
|
5701
|
+
animation: slideInLeft 2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
|
|
5702
|
+
animation-delay: 0.4s;
|
|
5703
|
+
opacity: 0;
|
|
5704
|
+
}
|
|
5705
|
+
|
|
5706
|
+
.d-letter {
|
|
5707
|
+
animation: scaleIn 2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
|
|
5708
|
+
animation-delay: 1s;
|
|
5709
|
+
opacity: 0;
|
|
5710
|
+
transform-origin: center;
|
|
5711
|
+
}
|
|
5712
|
+
` }),
|
|
5713
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5714
|
+
"rect",
|
|
5715
|
+
{
|
|
5716
|
+
className: "background-rect",
|
|
5717
|
+
x: "30.2988",
|
|
5718
|
+
y: "11.9149",
|
|
5719
|
+
width: "75.7447",
|
|
5720
|
+
height: "78.8085",
|
|
5721
|
+
fill: "white"
|
|
5722
|
+
}
|
|
5723
|
+
),
|
|
5724
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5725
|
+
"path",
|
|
5726
|
+
{
|
|
5727
|
+
className: "bars",
|
|
5728
|
+
d: "M8.85059 113.191H7.48926C7.11333 113.191 6.8086 112.887 6.80859 112.511V28.3671C6.8086 28.1866 6.88019 28.0134 7.00781 27.8857L8.85059 26.0429V113.191ZM12.5957 113.191H10.5527V24.3408L12.5957 22.2978V113.191ZM16 113.191H13.957V20.9365L16 18.8935V113.191ZM19.0635 113.191H17.0215V17.872L19.0635 15.83V113.191ZM21.7871 113.191H19.7451V15.1484L21.7871 13.1064V113.191ZM24.1699 113.191H22.2979V12.5956L24.1699 10.7236V113.191Z",
|
|
5729
|
+
fill: "#5E30EB"
|
|
5730
|
+
}
|
|
5731
|
+
),
|
|
5732
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5733
|
+
"path",
|
|
5734
|
+
{
|
|
5735
|
+
className: "d-letter",
|
|
5736
|
+
d: "M112.511 6.80853C112.887 6.80854 113.191 7.11326 113.191 7.4892V91.6328C113.191 91.8133 113.12 91.9865 112.992 92.1142L92.1143 112.992C91.9866 113.120 91.8133 113.191 91.6328 113.191H24.5107V10.3828L27.8857 7.00775C28.0134 6.88012 28.1867 6.80854 28.3672 6.80853H112.511ZM48.3408 82.7236H65.6172C71.9715 82.7235 77.4182 81.5604 81.957 79.2343C86.5528 76.9081 90.071 73.4463 92.5107 68.8505C95.007 64.2549 96.2548 58.5532 96.2549 51.7451C96.2549 45.2202 95.0919 39.773 92.7656 35.4042C90.4394 30.9788 87.0924 27.6308 82.7236 25.3613C78.4117 23.0918 73.2201 21.957 67.1494 21.957H48.3408V82.7236ZM67.5742 32.5107C70.7515 32.5107 73.39 33.2202 75.4893 34.6386C77.6452 36.0003 79.2628 38.1278 80.3408 41.0214C81.4187 43.915 81.957 47.6029 81.957 52.0849C81.957 58.723 80.6809 63.7159 78.1279 67.0634C75.6315 70.4109 71.7161 72.0849 66.3828 72.0849H62.1279V32.5107H67.5742Z",
|
|
5737
|
+
fill: "#5E30EB"
|
|
5738
|
+
}
|
|
5739
|
+
)
|
|
5740
|
+
]
|
|
5741
|
+
}
|
|
5742
|
+
);
|
|
5743
|
+
};
|
|
5629
5744
|
|
|
5630
5745
|
// src/components/Table/Table.tsx
|
|
5631
5746
|
var import_Box4 = __toESM(require("@mui/material/Box"), 1);
|
|
@@ -6849,8 +6964,35 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
|
6849
6964
|
}
|
|
6850
6965
|
return content;
|
|
6851
6966
|
};
|
|
6967
|
+
var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
6968
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6969
|
+
import_Box14.default,
|
|
6970
|
+
{
|
|
6971
|
+
sx: {
|
|
6972
|
+
right: 0,
|
|
6973
|
+
width: 1,
|
|
6974
|
+
bottom: 0,
|
|
6975
|
+
height: 1,
|
|
6976
|
+
zIndex: 9998,
|
|
6977
|
+
display: "flex",
|
|
6978
|
+
position: "fixed",
|
|
6979
|
+
alignItems: "center",
|
|
6980
|
+
justifyContent: "center",
|
|
6981
|
+
bgcolor: "background.default",
|
|
6982
|
+
...sx
|
|
6983
|
+
},
|
|
6984
|
+
...rest,
|
|
6985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(AnimatedLogo, {})
|
|
6986
|
+
}
|
|
6987
|
+
);
|
|
6988
|
+
if (portal) {
|
|
6989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_Portal.default, { children: content });
|
|
6990
|
+
}
|
|
6991
|
+
return content;
|
|
6992
|
+
};
|
|
6852
6993
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6853
6994
|
0 && (module.exports = {
|
|
6995
|
+
AnimatedLogo,
|
|
6854
6996
|
CheckboxDefault,
|
|
6855
6997
|
CheckboxIndeterminate,
|
|
6856
6998
|
CheckboxSelect,
|
|
@@ -6889,6 +7031,7 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
|
6889
7031
|
SettingsConsumer,
|
|
6890
7032
|
SettingsContext,
|
|
6891
7033
|
SettingsProvider,
|
|
7034
|
+
SplashScreen,
|
|
6892
7035
|
Table,
|
|
6893
7036
|
TablePagination,
|
|
6894
7037
|
ThemeProvider,
|