@ship-it-ui/ui 0.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/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/index.cjs +3581 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1353 -0
- package/dist/index.d.ts +1353 -0
- package/dist/index.js +3410 -0
- package/dist/index.js.map +1 -0
- package/package.json +94 -0
- package/src/styles/animations.css +123 -0
- package/src/styles/globals.css +144 -0
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ship-it-ui/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React component library for the Ship-It design system. Tailwind v4 + Radix UI primitives, themed via @ship-it-ui/tokens.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ship-it-ops/ship-it-design.git",
|
|
9
|
+
"directory": "packages/ui"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./styles/globals.css": "./src/styles/globals.css"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"src/styles",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"provenance": true
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"**/*.css"
|
|
34
|
+
],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
37
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@fontsource-variable/geist": "^5.1.0",
|
|
41
|
+
"@fontsource-variable/geist-mono": "^5.1.0",
|
|
42
|
+
"@radix-ui/react-alert-dialog": "^1.1.2",
|
|
43
|
+
"@radix-ui/react-avatar": "^1.1.1",
|
|
44
|
+
"@radix-ui/react-checkbox": "^1.1.2",
|
|
45
|
+
"@radix-ui/react-context-menu": "^2.2.2",
|
|
46
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
47
|
+
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
48
|
+
"@radix-ui/react-hover-card": "^1.1.2",
|
|
49
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
50
|
+
"@radix-ui/react-menubar": "^1.1.16",
|
|
51
|
+
"@radix-ui/react-popover": "^1.1.2",
|
|
52
|
+
"@radix-ui/react-radio-group": "^1.2.1",
|
|
53
|
+
"@radix-ui/react-select": "^2.1.2",
|
|
54
|
+
"@radix-ui/react-slider": "^1.2.1",
|
|
55
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
56
|
+
"@radix-ui/react-switch": "^1.1.1",
|
|
57
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
58
|
+
"@radix-ui/react-toast": "^1.2.2",
|
|
59
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
60
|
+
"class-variance-authority": "^0.7.0",
|
|
61
|
+
"clsx": "^2.1.1",
|
|
62
|
+
"tailwind-merge": "^2.5.4"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
66
|
+
"@testing-library/react": "^16.0.1",
|
|
67
|
+
"@testing-library/user-event": "^14.5.2",
|
|
68
|
+
"@types/react": "^18.3.12",
|
|
69
|
+
"@types/react-dom": "^18.3.1",
|
|
70
|
+
"@vitest/coverage-v8": "^2.1.3",
|
|
71
|
+
"axe-core": "^4.10.2",
|
|
72
|
+
"jsdom": "^25.0.1",
|
|
73
|
+
"react": "^18.3.1",
|
|
74
|
+
"react-dom": "^18.3.1",
|
|
75
|
+
"tailwindcss": "^4.0.0-beta.3",
|
|
76
|
+
"tsup": "^8.3.0",
|
|
77
|
+
"typescript": "^5.6.3",
|
|
78
|
+
"vitest": "^2.1.3",
|
|
79
|
+
"vitest-axe": "^0.1.0",
|
|
80
|
+
"@ship-it-ui/eslint-config": "0.0.1",
|
|
81
|
+
"@ship-it-ui/icons": "0.0.1",
|
|
82
|
+
"@ship-it-ui/tokens": "0.0.1",
|
|
83
|
+
"@ship-it-ui/tsconfig": "0.0.1"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "tsup",
|
|
87
|
+
"dev": "tsup --watch",
|
|
88
|
+
"lint": "eslint src",
|
|
89
|
+
"test": "vitest run --coverage",
|
|
90
|
+
"test:watch": "vitest",
|
|
91
|
+
"typecheck": "tsc --noEmit",
|
|
92
|
+
"clean": "rm -rf dist .turbo"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Keyframes used across @ship-it-ui/ui components.
|
|
3
|
+
*
|
|
4
|
+
* Imported by globals.css so consumers get all animations with one stylesheet.
|
|
5
|
+
* All durations are gated by the `prefers-reduced-motion` block in tokens.css —
|
|
6
|
+
* components don't need to handle that themselves.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
@keyframes ship-spin {
|
|
10
|
+
to {
|
|
11
|
+
transform: rotate(360deg);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@keyframes ship-pulse {
|
|
16
|
+
0%,
|
|
17
|
+
100% {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
50% {
|
|
21
|
+
opacity: 0.3;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes ship-indeterminate {
|
|
26
|
+
0% {
|
|
27
|
+
margin-left: -40%;
|
|
28
|
+
}
|
|
29
|
+
100% {
|
|
30
|
+
margin-left: 100%;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@keyframes ship-skeleton {
|
|
35
|
+
0%,
|
|
36
|
+
100% {
|
|
37
|
+
opacity: 0.6;
|
|
38
|
+
}
|
|
39
|
+
50% {
|
|
40
|
+
opacity: 0.3;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@keyframes ship-pulse-ring {
|
|
45
|
+
0% {
|
|
46
|
+
box-shadow: 0 0 0 0 currentColor;
|
|
47
|
+
}
|
|
48
|
+
70% {
|
|
49
|
+
box-shadow: 0 0 0 8px transparent;
|
|
50
|
+
}
|
|
51
|
+
100% {
|
|
52
|
+
box-shadow: 0 0 0 0 transparent;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes ship-fade-in {
|
|
57
|
+
from {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
}
|
|
60
|
+
to {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes ship-dialog-in {
|
|
66
|
+
from {
|
|
67
|
+
opacity: 0;
|
|
68
|
+
transform: scale(0.96) translateY(4px);
|
|
69
|
+
}
|
|
70
|
+
to {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
transform: scale(1) translateY(0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@keyframes ship-pop-in {
|
|
77
|
+
from {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
transform: scale(0.96);
|
|
80
|
+
}
|
|
81
|
+
to {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
transform: scale(1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@keyframes ship-slide-in-right {
|
|
88
|
+
from {
|
|
89
|
+
transform: translateX(100%);
|
|
90
|
+
}
|
|
91
|
+
to {
|
|
92
|
+
transform: translateX(0);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@keyframes ship-slide-in-left {
|
|
97
|
+
from {
|
|
98
|
+
transform: translateX(-100%);
|
|
99
|
+
}
|
|
100
|
+
to {
|
|
101
|
+
transform: translateX(0);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@keyframes ship-slide-in-bottom {
|
|
106
|
+
from {
|
|
107
|
+
transform: translateY(100%);
|
|
108
|
+
}
|
|
109
|
+
to {
|
|
110
|
+
transform: translateY(0);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes ship-toast-in {
|
|
115
|
+
from {
|
|
116
|
+
opacity: 0;
|
|
117
|
+
transform: translateX(20px) scale(0.96);
|
|
118
|
+
}
|
|
119
|
+
to {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
transform: translateX(0) scale(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global stylesheet for @ship-it-ui/ui consumers.
|
|
3
|
+
*
|
|
4
|
+
* Pulls in Geist (self-hosted), design tokens (CSS variables), keyframe animations,
|
|
5
|
+
* and bridges every token into Tailwind v4 via the `@theme inline` directive — so
|
|
6
|
+
* utility classes like `bg-bg`, `text-text`, `p-4`, `rounded-md`, `font-sans`,
|
|
7
|
+
* `text-h2`, `tracking-tight`, `shadow-lg` resolve to the same values that
|
|
8
|
+
* handwritten CSS using `var(--*)` would resolve to.
|
|
9
|
+
*
|
|
10
|
+
* Apps consuming this library should import this file once at app entry:
|
|
11
|
+
*
|
|
12
|
+
* import '@ship-it-ui/ui/styles/globals.css';
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* Self-hosted Geist via @fontsource-variable. */
|
|
16
|
+
@import '@fontsource-variable/geist';
|
|
17
|
+
@import '@fontsource-variable/geist-mono';
|
|
18
|
+
|
|
19
|
+
@import 'tailwindcss';
|
|
20
|
+
@import '@ship-it-ui/tokens/styles/tokens.css';
|
|
21
|
+
@import './animations.css';
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Tailwind v4 auto-source-detection runs from the consuming app's project
|
|
25
|
+
* root (e.g. `apps/docs/`), which means it misses the workspace package
|
|
26
|
+
* source files. These explicit @source directives scan every TS/TSX/MDX file
|
|
27
|
+
* across `@ship-it-ui/ui`, `@ship-it-ui/shipit`, and the docs Storybook so that
|
|
28
|
+
* utility classes used in components actually get compiled.
|
|
29
|
+
*
|
|
30
|
+
* Paths are resolved relative to this CSS file:
|
|
31
|
+
* ../** = packages/ui/src/**
|
|
32
|
+
* ../../../shipit/src/** = packages/shipit/src/**
|
|
33
|
+
* ../../../../apps/docs/** = apps/docs/**
|
|
34
|
+
*/
|
|
35
|
+
@source '../**/*.{ts,tsx,mdx}';
|
|
36
|
+
@source '../../../shipit/src/**/*.{ts,tsx,mdx}';
|
|
37
|
+
@source '../../../../apps/docs/**/*.{ts,tsx,mdx}';
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
* `@theme inline` tells Tailwind to read these variables for utility-class
|
|
41
|
+
* generation (so `bg-accent`, `text-text`, `rounded-md` etc. work) but NOT to
|
|
42
|
+
* redefine them in :root — tokens.css owns the actual values.
|
|
43
|
+
*/
|
|
44
|
+
@theme inline {
|
|
45
|
+
/* Color — semantic tokens become Tailwind color utilities. */
|
|
46
|
+
--color-bg: var(--color-bg);
|
|
47
|
+
--color-panel: var(--color-panel);
|
|
48
|
+
--color-panel-2: var(--color-panel-2);
|
|
49
|
+
--color-border: var(--color-border);
|
|
50
|
+
--color-border-strong: var(--color-border-strong);
|
|
51
|
+
--color-text: var(--color-text);
|
|
52
|
+
--color-text-muted: var(--color-text-muted);
|
|
53
|
+
--color-text-dim: var(--color-text-dim);
|
|
54
|
+
--color-accent: var(--color-accent);
|
|
55
|
+
--color-accent-text: var(--color-accent-text);
|
|
56
|
+
--color-accent-dim: var(--color-accent-dim);
|
|
57
|
+
--color-accent-glow: var(--color-accent-glow);
|
|
58
|
+
--color-ok: var(--color-ok);
|
|
59
|
+
--color-warn: var(--color-warn);
|
|
60
|
+
--color-err: var(--color-err);
|
|
61
|
+
--color-purple: var(--color-purple);
|
|
62
|
+
--color-pink: var(--color-pink);
|
|
63
|
+
|
|
64
|
+
/* Foreground for components that sit on top of an accent surface
|
|
65
|
+
* (primary buttons, solid badges). Always near-black, regardless of theme. */
|
|
66
|
+
--color-on-accent: #0a0a0b;
|
|
67
|
+
|
|
68
|
+
/* Typography — families. */
|
|
69
|
+
--font-sans: var(--font-family-sans);
|
|
70
|
+
--font-mono: var(--font-family-mono);
|
|
71
|
+
|
|
72
|
+
/* Typography — sizes (named, not numeric, so utilities stay semantic). */
|
|
73
|
+
--text-eyebrow: var(--font-size-eyebrow);
|
|
74
|
+
--text-mono: var(--font-size-mono);
|
|
75
|
+
--text-body: var(--font-size-body);
|
|
76
|
+
--text-body-lg: var(--font-size-body-lg);
|
|
77
|
+
--text-h4: var(--font-size-h4);
|
|
78
|
+
--text-h3: var(--font-size-h3);
|
|
79
|
+
--text-h2: var(--font-size-h2);
|
|
80
|
+
--text-h1: var(--font-size-h1);
|
|
81
|
+
--text-display: var(--font-size-display);
|
|
82
|
+
|
|
83
|
+
/* Typography — weights. */
|
|
84
|
+
--font-weight-light: var(--font-weight-light);
|
|
85
|
+
--font-weight-regular: var(--font-weight-regular);
|
|
86
|
+
--font-weight-medium: var(--font-weight-medium);
|
|
87
|
+
--font-weight-semibold: var(--font-weight-semibold);
|
|
88
|
+
--font-weight-bold: var(--font-weight-bold);
|
|
89
|
+
|
|
90
|
+
/* Typography — tracking. */
|
|
91
|
+
--tracking-xtight: var(--tracking-xtight);
|
|
92
|
+
--tracking-tight: var(--tracking-tight);
|
|
93
|
+
--tracking-normal: var(--tracking-normal);
|
|
94
|
+
--tracking-wide: var(--tracking-wide);
|
|
95
|
+
--tracking-xwide: var(--tracking-xwide);
|
|
96
|
+
|
|
97
|
+
/* Spacing (4pt scale, irregular ramp — handoff skips 7). */
|
|
98
|
+
--spacing-1: var(--space-1);
|
|
99
|
+
--spacing-2: var(--space-2);
|
|
100
|
+
--spacing-3: var(--space-3);
|
|
101
|
+
--spacing-4: var(--space-4);
|
|
102
|
+
--spacing-5: var(--space-5);
|
|
103
|
+
--spacing-6: var(--space-6);
|
|
104
|
+
--spacing-8: var(--space-8);
|
|
105
|
+
|
|
106
|
+
/* Radius. */
|
|
107
|
+
--radius-xs: var(--radius-xs);
|
|
108
|
+
--radius-sm: var(--radius-sm);
|
|
109
|
+
--radius-md: var(--radius-md);
|
|
110
|
+
--radius-base: var(--radius-base);
|
|
111
|
+
--radius-lg: var(--radius-lg);
|
|
112
|
+
--radius-xl: var(--radius-xl);
|
|
113
|
+
--radius-full: var(--radius-full);
|
|
114
|
+
|
|
115
|
+
/* Shadow. */
|
|
116
|
+
--shadow-sm: var(--shadow-sm);
|
|
117
|
+
--shadow: var(--shadow);
|
|
118
|
+
--shadow-lg: var(--shadow-lg);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@layer base {
|
|
122
|
+
html {
|
|
123
|
+
font-family: var(--font-family-sans);
|
|
124
|
+
color: var(--color-text);
|
|
125
|
+
background: var(--color-bg);
|
|
126
|
+
font-feature-settings: 'cv11', 'ss01';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
body {
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Tabular numerals everywhere there's tick motion or comparison —
|
|
134
|
+
* matches the handoff's voice rule for `1,204 repos`, `02 / 08`. */
|
|
135
|
+
.ship-mono,
|
|
136
|
+
.font-mono {
|
|
137
|
+
font-variant-numeric: tabular-nums;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
*:focus-visible {
|
|
141
|
+
outline: 2px solid var(--color-accent);
|
|
142
|
+
outline-offset: 2px;
|
|
143
|
+
}
|
|
144
|
+
}
|