neba 1.0.0 → 1.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 +27 -16
- package/dist/components/avatar/Avatar.d.ts +100 -0
- package/dist/components/avatar/Avatar.js +1 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/blockquote/Blockquote.d.ts +65 -0
- package/dist/components/blockquote/Blockquote.js +1 -0
- package/dist/components/blockquote/index.d.ts +2 -0
- package/dist/components/blockquote/index.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +92 -0
- package/dist/components/breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/carousel/Carousel.d.ts +74 -0
- package/dist/components/carousel/Carousel.js +1 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/chat-bubble/ChatBubble.d.ts +114 -0
- package/dist/components/chat-bubble/ChatBubble.js +1 -0
- package/dist/components/chat-bubble/index.d.ts +2 -0
- package/dist/components/chat-bubble/index.js +1 -0
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/container/Container.d.ts +55 -0
- package/dist/components/container/Container.js +1 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/date-picker/DatePicker.d.ts +75 -0
- package/dist/components/date-picker/DatePicker.js +1 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-range-picker/DateRangePicker.d.ts +81 -0
- package/dist/components/date-range-picker/DateRangePicker.js +1 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-time-picker/DateTimePicker.d.ts +68 -0
- package/dist/components/date-time-picker/DateTimePicker.js +1 -0
- package/dist/components/date-time-picker/index.d.ts +2 -0
- package/dist/components/date-time-picker/index.js +1 -0
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/divider/Divider.d.ts +19 -0
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/grid/Grid.d.ts +50 -0
- package/dist/components/grid/Grid.js +1 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/index.js +1 -0
- package/dist/components/grid-container/GridContainer.d.ts +79 -0
- package/dist/components/grid-container/GridContainer.js +1 -0
- package/dist/components/grid-container/index.d.ts +2 -0
- package/dist/components/grid-container/index.js +1 -0
- package/dist/components/highlight/Highlight.d.ts +84 -0
- package/dist/components/highlight/Highlight.js +1 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.js +1 -0
- package/dist/components/icon/Icon.d.ts +58 -0
- package/dist/components/icon/Icon.js +1 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/icon-button/IconButton.d.ts +39 -0
- package/dist/components/icon-button/IconButton.js +1 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/otp-field/OtpField.d.ts +85 -0
- package/dist/components/otp-field/OtpField.js +1 -0
- package/dist/components/otp-field/index.d.ts +2 -0
- package/dist/components/otp-field/index.js +1 -0
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/panes/Panes.d.ts +78 -0
- package/dist/components/panes/Panes.js +1 -0
- package/dist/components/panes/index.d.ts +2 -0
- package/dist/components/panes/index.js +1 -0
- package/dist/components/pill/Pill.d.ts +80 -0
- package/dist/components/pill/Pill.js +1 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/segmented-button/SegmentedButton.d.ts +77 -0
- package/dist/components/segmented-button/SegmentedButton.js +1 -0
- package/dist/components/segmented-button/index.d.ts +2 -0
- package/dist/components/segmented-button/index.js +1 -0
- package/dist/components/select/Select.js +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +60 -0
- package/dist/components/shortcut/Shortcut.js +1 -0
- package/dist/components/shortcut/index.d.ts +2 -0
- package/dist/components/shortcut/index.js +1 -0
- package/dist/components/spoiler/Spoiler.d.ts +95 -0
- package/dist/components/spoiler/Spoiler.js +1 -0
- package/dist/components/spoiler/index.d.ts +2 -0
- package/dist/components/spoiler/index.js +1 -0
- package/dist/components/statistic/Statistic.d.ts +91 -0
- package/dist/components/statistic/Statistic.js +1 -0
- package/dist/components/statistic/index.d.ts +2 -0
- package/dist/components/statistic/index.js +1 -0
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/text-link/TextLink.d.ts +82 -0
- package/dist/components/text-link/TextLink.js +1 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/time-picker/TimePicker.d.ts +76 -0
- package/dist/components/time-picker/TimePicker.js +1 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/timeline/Timeline.d.ts +98 -0
- package/dist/components/timeline/Timeline.js +1 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +67 -0
- package/dist/components/toolbar/Toolbar.js +1 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +1 -0
- package/dist/components/tree-view/TreeView.d.ts +115 -0
- package/dist/components/tree-view/TreeView.js +1 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/components/tree-view/index.js +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +1 -1
- package/dist/internal/calendar.d.ts +149 -0
- package/dist/internal/calendar.js +1 -0
- package/dist/internal/date.d.ts +170 -0
- package/dist/internal/date.js +1 -0
- package/dist/internal/grid.d.ts +69 -0
- package/dist/internal/grid.js +1 -0
- package/dist/internal/i18n.d.ts +78 -0
- package/dist/internal/i18n.js +1 -0
- package/dist/internal/icons.d.ts +54 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/picker.d.ts +111 -0
- package/dist/internal/picker.js +1 -0
- package/dist/internal/sizer.d.ts +33 -0
- package/dist/internal/sizer.js +1 -0
- package/dist/internal/styles.d.ts +33 -0
- package/dist/internal/styles.js +1 -1
- package/dist/styles.css +2 -758
- package/dist/tailwind.css +1017 -0
- package/dist/types.d.ts +65 -0
- package/package.json +25 -12
package/dist/types.d.ts
CHANGED
|
@@ -38,6 +38,19 @@ export type NebaSide = 'top' | 'right' | 'bottom' | 'left';
|
|
|
38
38
|
* is the whole reason the library never says `left`.
|
|
39
39
|
*/
|
|
40
40
|
export type NebaAlign = 'start' | 'center' | 'end';
|
|
41
|
+
/**
|
|
42
|
+
* How a bar sits in the page's scroll.
|
|
43
|
+
*
|
|
44
|
+
* The three CSS `position` values that mean something for a bar, spelled the
|
|
45
|
+
* way CSS spells them — this is one of the few ideas where inventing a nicer
|
|
46
|
+
* word (`pinned`, `floating`) would only make a reader look up which CSS it
|
|
47
|
+
* maps to. Toolbar and Pill both read it.
|
|
48
|
+
*
|
|
49
|
+
* - `static` — in the flow, scrolling away with the content.
|
|
50
|
+
* - `sticky` — in the flow until the edge, then held there.
|
|
51
|
+
* - `fixed` — out of the flow entirely, against the viewport.
|
|
52
|
+
*/
|
|
53
|
+
export type NebaPosition = 'static' | 'sticky' | 'fixed';
|
|
41
54
|
/**
|
|
42
55
|
* Which corner of a box something is pinned to. Badge reads this.
|
|
43
56
|
*
|
|
@@ -47,6 +60,58 @@ export type NebaAlign = 'start' | 'center' | 'end';
|
|
|
47
60
|
* let a caller spell `{ vertical: 'left' }`.
|
|
48
61
|
*/
|
|
49
62
|
export type NebaCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
63
|
+
/**
|
|
64
|
+
* Which day a week starts on, counted the way `Date.prototype.getDay` counts it:
|
|
65
|
+
* Sunday is `0`, Saturday is `6`.
|
|
66
|
+
*
|
|
67
|
+
* A number rather than `'sunday' | 'monday' | …`, and for once not because the
|
|
68
|
+
* number is shorter. Every date API in the platform already speaks this
|
|
69
|
+
* encoding, so a caller computing the value rather than typing it in — from a
|
|
70
|
+
* user setting, from `Intl`, from a row in a database — has nothing to translate.
|
|
71
|
+
* The pickers default it from the locale, so it is rarely written down at all.
|
|
72
|
+
*/
|
|
73
|
+
export type NebaWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
74
|
+
/**
|
|
75
|
+
* The viewport widths the layout components branch on, smallest first.
|
|
76
|
+
*
|
|
77
|
+
* Deliberately the same five names as `NebaSize`, and deliberately *not* the
|
|
78
|
+
* same idea: a `size` of `md` is how big a control is, a breakpoint of `md` is
|
|
79
|
+
* how wide the window is. They share a spelling because a caller who has
|
|
80
|
+
* learned one ladder should not have to learn a second set of words for the
|
|
81
|
+
* other, and because every CSS framework worth copying already spells them this
|
|
82
|
+
* way.
|
|
83
|
+
*
|
|
84
|
+
* The widths are Tailwind's own defaults — `sm` 40rem, `md` 48rem, `lg` 64rem,
|
|
85
|
+
* `xl` 80rem — so a Neba grid and a `md:` utility change at the same moment.
|
|
86
|
+
* `xs` is 0: it is the value with no media query around it.
|
|
87
|
+
*/
|
|
88
|
+
export type NebaBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
89
|
+
/**
|
|
90
|
+
* A value that may differ per breakpoint.
|
|
91
|
+
*
|
|
92
|
+
* A bare value applies from `xs` up; a partial map applies each entry from its
|
|
93
|
+
* own breakpoint up, so `{ xs: 12, md: 6 }` is full width until 48rem and half
|
|
94
|
+
* from there on. There is no `NebaBreakpoint` that means "only at this width" —
|
|
95
|
+
* every entry is a floor, which is what makes a two-entry map enough to
|
|
96
|
+
* describe most layouts.
|
|
97
|
+
*/
|
|
98
|
+
export type NebaResponsive<T> = T | Partial<Record<NebaBreakpoint, T>>;
|
|
99
|
+
/**
|
|
100
|
+
* How a row distributes the space it has left over along its main axis.
|
|
101
|
+
*
|
|
102
|
+
* The three positional values are `NebaAlign`'s — logical, so they flip under
|
|
103
|
+
* RTL — and the three distribution values keep their CSS spelling, because
|
|
104
|
+
* `space-between` is what the property is called and inventing `between` would
|
|
105
|
+
* be a second name for something that already has one.
|
|
106
|
+
*/
|
|
107
|
+
export type NebaJustifyContent = NebaAlign | 'space-between' | 'space-around' | 'space-evenly' | 'stretch';
|
|
108
|
+
/**
|
|
109
|
+
* How items sit across the axis they are laid out on. `stretch` is the default
|
|
110
|
+
* everywhere it is offered: a row of cards is a row of cards of one height.
|
|
111
|
+
*/
|
|
112
|
+
export type NebaAlignItems = NebaAlign | 'stretch' | 'baseline';
|
|
113
|
+
/** The same, for one item overriding the row around it. */
|
|
114
|
+
export type NebaAlignSelf = NebaAlignItems | 'auto';
|
|
50
115
|
/**
|
|
51
116
|
* Visual weight of a component's surface.
|
|
52
117
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A comprehensive React UI component library — buttons, fields, menus, dialogs, tables and much more — accessible and themeable, sharing one prop vocabulary and a translucent acrylic design language. ESM only, types included, dark mode built in.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
"url": "https://github.com/jooy2/neba/issues"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"build": "npm run format:fix && tsc --project tsconfig.prod.json && npm run minify && node scripts/
|
|
18
|
+
"build": "npm run format:fix && tsc --project tsconfig.prod.json && npm run minify && node scripts/build-styles.mjs",
|
|
19
19
|
"lint": "eslint . --ext .js,.ts .",
|
|
20
20
|
"lint:fix": "eslint . --ext .js,.ts --fix .",
|
|
21
21
|
"minify": "terser-glob 'dist/**/*.js' --config-file terser.config.json",
|
|
22
22
|
"prepare": "npm run build",
|
|
23
23
|
"format": "prettier .",
|
|
24
24
|
"format:fix": "prettier . --write",
|
|
25
|
-
"docs:
|
|
26
|
-
"docs:
|
|
25
|
+
"docs:changelog": "node scripts/copy-changelog.mjs",
|
|
26
|
+
"docs:dev": "npm run build && npm run docs:changelog && vitepress dev docs",
|
|
27
|
+
"docs:build": "npm run build && npm run docs:changelog && vitepress build docs",
|
|
27
28
|
"docs:serve": "npm run build && npm run docs:build && vitepress serve docs",
|
|
28
29
|
"test": "vitest run",
|
|
29
30
|
"test:watch": "vitest",
|
|
@@ -44,7 +45,8 @@
|
|
|
44
45
|
"module": "./dist/types.js",
|
|
45
46
|
"default": "./dist/types.js"
|
|
46
47
|
},
|
|
47
|
-
"./styles.css": "./dist/styles.css"
|
|
48
|
+
"./styles.css": "./dist/styles.css",
|
|
49
|
+
"./tailwind.css": "./dist/tailwind.css"
|
|
48
50
|
},
|
|
49
51
|
"typesVersions": {
|
|
50
52
|
"*": {
|
|
@@ -98,19 +100,20 @@
|
|
|
98
100
|
"devDependencies": {
|
|
99
101
|
"@eslint/js": "^9.39.1",
|
|
100
102
|
"@tailwindcss/postcss": "^4.3.3",
|
|
101
|
-
"@types/node": "^26.1.
|
|
102
|
-
"@types/react": "^19.2.
|
|
103
|
-
"@types/react-dom": "^19.2.
|
|
103
|
+
"@types/node": "^26.1.2",
|
|
104
|
+
"@types/react": "^19.2.18",
|
|
105
|
+
"@types/react-dom": "^19.2.4",
|
|
104
106
|
"@typescript-eslint/parser": "^8.65.0",
|
|
105
|
-
"@vitejs/plugin-react-swc": "^4.3.
|
|
107
|
+
"@vitejs/plugin-react-swc": "^4.3.3",
|
|
106
108
|
"@vitest/browser": "^4.1.10",
|
|
107
109
|
"@vitest/browser-playwright": "^4.1.10",
|
|
108
110
|
"eslint": "^9.39.1",
|
|
109
111
|
"eslint-config-prettier": "^10.1.8",
|
|
110
112
|
"eslint-plugin-n": "^18.2.2",
|
|
111
|
-
"globals": "^17.
|
|
113
|
+
"globals": "^17.8.0",
|
|
112
114
|
"jiti": "^2.7.0",
|
|
113
|
-
"playwright": "^1.
|
|
115
|
+
"playwright": "^1.62.1",
|
|
116
|
+
"postcss": "^8.5.25",
|
|
114
117
|
"prettier": "^3.9.6",
|
|
115
118
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
116
119
|
"react": "^19.2.8",
|
|
@@ -120,7 +123,7 @@
|
|
|
120
123
|
"tsx": "^4.23.1",
|
|
121
124
|
"typescript": "^5.9.3",
|
|
122
125
|
"typescript-eslint": "^8.65.0",
|
|
123
|
-
"vite": "^8.
|
|
126
|
+
"vite": "^8.2.0",
|
|
124
127
|
"vitepress": "^1.6.4",
|
|
125
128
|
"vitepress-i18n": "^1.3.5",
|
|
126
129
|
"vitepress-sidebar": "^1.36.1",
|
|
@@ -129,5 +132,15 @@
|
|
|
129
132
|
},
|
|
130
133
|
"dependencies": {
|
|
131
134
|
"@base-ui/react": "^1.6.0"
|
|
135
|
+
},
|
|
136
|
+
"peerDependencies": {
|
|
137
|
+
"@types/react": "^18.0.0 || ^19.0.0",
|
|
138
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
139
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
140
|
+
},
|
|
141
|
+
"peerDependenciesMeta": {
|
|
142
|
+
"@types/react": {
|
|
143
|
+
"optional": true
|
|
144
|
+
}
|
|
132
145
|
}
|
|
133
146
|
}
|