@surflane/ui 0.3.0 → 0.4.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 +17 -7
- package/dist/advanced-forms.js +24 -24
- package/dist/app-shell.js +8 -8
- package/dist/avatar.d.ts +24 -0
- package/dist/avatar.js +26 -0
- package/dist/button.js +3 -3
- package/dist/chart.js +6 -3
- package/dist/chevron.d.ts +3 -0
- package/dist/chevron.js +6 -0
- package/dist/commands.js +9 -9
- package/dist/content.js +11 -8
- package/dist/context-overlays.js +6 -6
- package/dist/data.js +21 -21
- package/dist/dialog.js +8 -7
- package/dist/disclosure.d.ts +42 -0
- package/dist/disclosure.js +41 -0
- package/dist/feedback.js +14 -14
- package/dist/file-upload.js +1 -1
- package/dist/filter-bar.js +5 -5
- package/dist/forms.js +17 -17
- package/dist/foundations.js +7 -7
- package/dist/icon.js +4 -2
- package/dist/index.d.ts +4 -5
- package/dist/index.js +7 -5
- package/dist/input-extensions.js +11 -11
- package/dist/input.js +1 -1
- package/dist/markdown.js +3 -2
- package/dist/menu.js +14 -14
- package/dist/messages.js +11 -11
- package/dist/navigation-menu.js +9 -9
- package/dist/navigation.d.ts +1 -91
- package/dist/navigation.js +8 -75
- package/dist/otp-field.js +4 -4
- package/dist/pagination.js +1 -1
- package/dist/panels.js +12 -11
- package/dist/parts.d.ts +3 -0
- package/dist/parts.js +8 -1
- package/dist/popover.js +2 -2
- package/dist/scroll-area.js +1 -1
- package/dist/select.js +3 -2
- package/dist/sizing.js +1 -1
- package/dist/status.js +2 -2
- package/dist/syntax-context.d.ts +7 -0
- package/dist/syntax-context.js +4 -0
- package/dist/syntax-highlighter.d.ts +4 -1
- package/dist/syntax-highlighter.js +11 -5
- package/dist/syntax-highlighting.d.ts +8 -0
- package/dist/syntax-highlighting.js +12 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.js +13 -0
- package/dist/toast.js +14 -14
- package/package.json +57 -8
- package/src/all.css +8 -0
- package/src/styles.css +3571 -3623
package/dist/toast.js
CHANGED
|
@@ -5,21 +5,21 @@ import { useComponentSize } from './sizing.js';
|
|
|
5
5
|
import { Toast as BaseToast } from '@base-ui/react/toast';
|
|
6
6
|
import { part, skin } from './parts.js';
|
|
7
7
|
import { StatusIcon } from './status.js';
|
|
8
|
-
const ToneContext = React.createContext('neutral');
|
|
9
|
-
const Root = React.forwardRef(function Root({ tone = 'neutral', className, ...props }, ref) {
|
|
8
|
+
const ToneContext = /* @__PURE__ */ React.createContext('neutral');
|
|
9
|
+
const Root = /* @__PURE__ */ React.forwardRef(function Root({ tone = 'neutral', className, ...props }, ref) {
|
|
10
10
|
return (_jsx(ToneContext.Provider, { value: tone, children: _jsx(BaseToast.Root, { ...props, ref: ref, "data-tone": tone, className: skin('pui-toast', className) }) }));
|
|
11
11
|
});
|
|
12
|
-
const Icon = React.forwardRef(function Icon({ tone, children, className, ...props }, ref) {
|
|
12
|
+
const Icon = /* @__PURE__ */ React.forwardRef(function Icon({ tone, children, className, ...props }, ref) {
|
|
13
13
|
const inherited = React.useContext(ToneContext);
|
|
14
14
|
return (_jsx("span", { ...props, ref: ref, "aria-hidden": 'true', className: ['pui-toast-icon', className].filter(Boolean).join(' '), children: children ?? _jsx(StatusIcon, { tone: tone ?? inherited }) }));
|
|
15
15
|
});
|
|
16
|
-
const Close = React.forwardRef(function Close({ className, children, ...props }, ref) {
|
|
17
|
-
return (_jsx(BaseToast.Close, { "aria-label": 'Dismiss notification', "aria-hidden": false, "data-variant": 'ghost', "data-size": 'icon', ...props, ref: ref, className: skin('pui-button pui-toast-close', className), children: children ?? (_jsx("svg", { width: '16', height: '16', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '1.6', "aria-hidden": 'true', children: _jsx("path", { d: 'm6 6 12 12M18 6 6 18' }) })) }));
|
|
16
|
+
const Close = /* @__PURE__ */ React.forwardRef(function Close({ className, children, ...props }, ref) {
|
|
17
|
+
return (_jsx(BaseToast.Close, { "aria-label": 'Dismiss notification', "aria-hidden": false, "data-variant": 'ghost', "data-size": 'icon-sm', "data-ui-size": 'small', ...props, ref: ref, className: skin('pui-button pui-toast-close', className), children: children ?? (_jsx("svg", { width: '16', height: '16', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: '1.6', "aria-hidden": 'true', children: _jsx("path", { d: 'm6 6 12 12M18 6 6 18' }) })) }));
|
|
18
18
|
});
|
|
19
|
-
const Action = React.forwardRef(function Action({ className, ...props }, ref) {
|
|
20
|
-
return (_jsx(BaseToast.Action, { "data-variant": 'outline', "data-size": '
|
|
19
|
+
const Action = /* @__PURE__ */ React.forwardRef(function Action({ className, ...props }, ref) {
|
|
20
|
+
return (_jsx(BaseToast.Action, { "data-variant": 'outline', "data-size": 'small', "data-ui-size": 'small', ...props, ref: ref, className: skin('pui-button pui-toast-action', className) }));
|
|
21
21
|
});
|
|
22
|
-
const Viewport = React.forwardRef(function Viewport({ layout = 'stack', className, ...props }, ref) {
|
|
22
|
+
const Viewport = /* @__PURE__ */ React.forwardRef(function Viewport({ layout = 'stack', className, ...props }, ref) {
|
|
23
23
|
const viewportRef = React.useRef(null);
|
|
24
24
|
React.useLayoutEffect(() => {
|
|
25
25
|
const viewport = viewportRef.current;
|
|
@@ -31,7 +31,7 @@ const Viewport = React.forwardRef(function Viewport({ layout = 'stack', classNam
|
|
|
31
31
|
const gap = parseFloat(getComputedStyle(viewport).rowGap) || 0;
|
|
32
32
|
const height = cards.reduce((sum, card) => {
|
|
33
33
|
const natural = parseFloat(getComputedStyle(card).getPropertyValue('--toast-height'));
|
|
34
|
-
return
|
|
34
|
+
return sum + (Number.isFinite(natural) ? natural : card.offsetHeight);
|
|
35
35
|
}, 0) +
|
|
36
36
|
Math.max(0, cards.length - 1) * gap;
|
|
37
37
|
const wasOverflow = viewport.hasAttribute('data-stack-overflow');
|
|
@@ -89,11 +89,11 @@ export const Toast = {
|
|
|
89
89
|
Close,
|
|
90
90
|
Action,
|
|
91
91
|
Viewport,
|
|
92
|
-
Content: part(BaseToast.Content, 'pui-toast-content'),
|
|
93
|
-
Title: part(BaseToast.Title, 'pui-toast-title'),
|
|
94
|
-
Description: part(BaseToast.Description, 'pui-toast-description'),
|
|
95
|
-
Text: part('div', 'pui-toast-text'),
|
|
96
|
-
Positioner: part(BaseToast.Positioner, 'pui-positioner'),
|
|
92
|
+
Content: /* @__PURE__ */ part(BaseToast.Content, 'pui-toast-content'),
|
|
93
|
+
Title: /* @__PURE__ */ part(BaseToast.Title, 'pui-toast-title'),
|
|
94
|
+
Description: /* @__PURE__ */ part(BaseToast.Description, 'pui-toast-description'),
|
|
95
|
+
Text: /* @__PURE__ */ part('div', 'pui-toast-text'),
|
|
96
|
+
Positioner: /* @__PURE__ */ part(BaseToast.Positioner, 'pui-positioner'),
|
|
97
97
|
};
|
|
98
98
|
// Flat names for React Server Components, which cannot dot into client exports.
|
|
99
99
|
export const { Action: ToastAction, Arrow: ToastArrow, Close: ToastClose, Content: ToastContent, Description: ToastDescription, Portal: ToastPortal, Positioner: ToastPositioner, Provider: ToastProvider, Root: ToastRoot, Title: ToastTitle, Viewport: ToastViewport, Icon: ToastIcon, Text: ToastText, } = Toast;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surflane/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Surflane React components built on Base UI, with data, chart, code and Markdown components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
31
|
"src/styles.css",
|
|
32
|
+
"src/all.css",
|
|
32
33
|
"LICENSE-MIT",
|
|
33
34
|
"LICENSE-APACHE"
|
|
34
35
|
],
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"import": "./dist/index.js"
|
|
39
40
|
},
|
|
40
41
|
"./styles.css": "./src/styles.css",
|
|
42
|
+
"./all.css": "./src/all.css",
|
|
41
43
|
"./button": {
|
|
42
44
|
"types": "./dist/button.d.ts",
|
|
43
45
|
"import": "./dist/button.js"
|
|
@@ -74,6 +76,14 @@
|
|
|
74
76
|
"types": "./dist/chart.d.ts",
|
|
75
77
|
"import": "./dist/chart.js"
|
|
76
78
|
},
|
|
79
|
+
"./date-picker": {
|
|
80
|
+
"types": "./dist/date-picker.d.ts",
|
|
81
|
+
"import": "./dist/date-picker.js"
|
|
82
|
+
},
|
|
83
|
+
"./tree": {
|
|
84
|
+
"types": "./dist/tree.d.ts",
|
|
85
|
+
"import": "./dist/tree.js"
|
|
86
|
+
},
|
|
77
87
|
"./markdown": {
|
|
78
88
|
"types": "./dist/markdown.d.ts",
|
|
79
89
|
"import": "./dist/markdown.js"
|
|
@@ -82,6 +92,10 @@
|
|
|
82
92
|
"types": "./dist/syntax-highlighter.d.ts",
|
|
83
93
|
"import": "./dist/syntax-highlighter.js"
|
|
84
94
|
},
|
|
95
|
+
"./syntax-highlighting": {
|
|
96
|
+
"types": "./dist/syntax-highlighting.d.ts",
|
|
97
|
+
"import": "./dist/syntax-highlighting.js"
|
|
98
|
+
},
|
|
85
99
|
"./package.json": "./package.json"
|
|
86
100
|
},
|
|
87
101
|
"scripts": {
|
|
@@ -89,10 +103,50 @@
|
|
|
89
103
|
"prepack": "npm run build"
|
|
90
104
|
},
|
|
91
105
|
"dependencies": {
|
|
92
|
-
"@base-ui/react": "1.9.0"
|
|
106
|
+
"@base-ui/react": "1.9.0"
|
|
107
|
+
},
|
|
108
|
+
"peerDependencies": {
|
|
109
|
+
"@headless-tree/core": "^1.8.0",
|
|
110
|
+
"@headless-tree/react": "^1.8.0",
|
|
111
|
+
"@surflane/design-tokens": "^0.4.0",
|
|
112
|
+
"@tanstack/react-virtual": "^3.14.21",
|
|
113
|
+
"react": "^19.0.0",
|
|
114
|
+
"react-aria-components": "^1.22.1",
|
|
115
|
+
"react-dom": "^19.0.0",
|
|
116
|
+
"react-markdown": "^10.1.0",
|
|
117
|
+
"recharts": "^3.10.1",
|
|
118
|
+
"remark-gfm": "^4.0.1",
|
|
119
|
+
"shiki": "^4.5.0"
|
|
120
|
+
},
|
|
121
|
+
"peerDependenciesMeta": {
|
|
122
|
+
"@headless-tree/core": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"@headless-tree/react": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
128
|
+
"@tanstack/react-virtual": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"react-aria-components": {
|
|
132
|
+
"optional": true
|
|
133
|
+
},
|
|
134
|
+
"react-markdown": {
|
|
135
|
+
"optional": true
|
|
136
|
+
},
|
|
137
|
+
"recharts": {
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
"remark-gfm": {
|
|
141
|
+
"optional": true
|
|
142
|
+
},
|
|
143
|
+
"shiki": {
|
|
144
|
+
"optional": true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"devDependencies": {
|
|
93
148
|
"@headless-tree/core": "1.8.0",
|
|
94
149
|
"@headless-tree/react": "1.8.0",
|
|
95
|
-
"@internationalized/date": "3.12.4",
|
|
96
150
|
"@tanstack/react-virtual": "3.14.21",
|
|
97
151
|
"react-aria-components": "1.22.1",
|
|
98
152
|
"react-markdown": "10.1.0",
|
|
@@ -100,11 +154,6 @@
|
|
|
100
154
|
"remark-gfm": "4.0.1",
|
|
101
155
|
"shiki": "4.5.0"
|
|
102
156
|
},
|
|
103
|
-
"peerDependencies": {
|
|
104
|
-
"@surflane/design-tokens": "^0.3.0",
|
|
105
|
-
"react": "^19.0.0",
|
|
106
|
-
"react-dom": "^19.0.0"
|
|
107
|
-
},
|
|
108
157
|
"publishConfig": {
|
|
109
158
|
"access": "public"
|
|
110
159
|
}
|
package/src/all.css
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* Every Surflane stylesheet in one import, in the recommended order: tokens, controls,
|
|
2
|
+
* composition, document typography and components. Each file keeps its cascade layer. */
|
|
3
|
+
@layer surflane.tokens, surflane.themes, surflane.base, surflane.components;
|
|
4
|
+
@import '@surflane/design-tokens/tokens.css';
|
|
5
|
+
@import '@surflane/design-tokens/controls.css';
|
|
6
|
+
@import '@surflane/design-tokens/foundations.css';
|
|
7
|
+
@import '@surflane/design-tokens/typography.css';
|
|
8
|
+
@import './styles.css';
|