opui-css 3.3.5 → 4.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/CHANGELOG.md +241 -0
- package/LICENSE +21 -21
- package/MIGRATING.md +105 -0
- package/README.md +66 -29
- package/astro/index.ts +46 -0
- package/components/AGENTS.md +247 -0
- package/components/Accordion/Accordion.astro +42 -0
- package/components/Anchor/Anchor.astro +51 -0
- package/components/Avatar/Avatar.astro +44 -0
- package/components/Badge/Badge.astro +54 -0
- package/components/Button/Button.astro +45 -0
- package/components/ButtonGroup/ButtonGroup.astro +29 -0
- package/components/Callout/Callout.astro +75 -0
- package/components/Card/Card.astro +38 -0
- package/components/Checkbox/Checkbox.astro +76 -0
- package/components/Checkbox/CheckboxInput.astro +32 -0
- package/components/Chip/Chip.astro +37 -0
- package/components/ClassicSelect/ClassicSelect.astro +83 -0
- package/components/DescriptionList/Description.astro +12 -0
- package/components/DescriptionList/DescriptionList.astro +22 -0
- package/components/DescriptionList/Item.astro +12 -0
- package/components/DescriptionList/Term.astro +12 -0
- package/components/DescriptionList/index.ts +12 -0
- package/components/Dialog/Dialog.astro +43 -0
- package/components/Divider/Divider.astro +14 -0
- package/components/Drawer/Drawer.astro +49 -0
- package/components/Drawer/DrawerFooter.astro +14 -0
- package/components/Drawer/DrawerHeader.astro +31 -0
- package/components/FieldDescription/FieldDescription.astro +13 -0
- package/components/FieldGroup/FieldGroup.astro +31 -0
- package/components/FieldLegend/FieldLegend.astro +15 -0
- package/components/FieldSet/FieldSet.astro +15 -0
- package/components/Form/Form.astro +15 -0
- package/components/IconButton/IconButton.astro +26 -0
- package/components/List/List.astro +36 -0
- package/components/ListItem/ListItem.astro +118 -0
- package/components/Progress/Progress.astro +40 -0
- package/components/Radio/Radio.astro +70 -0
- package/components/Radio/RadioInput.astro +24 -0
- package/components/Range/Range.astro +136 -0
- package/components/Select/Select.astro +106 -0
- package/components/Switch/Switch.astro +101 -0
- package/components/Switch/SwitchInput.astro +25 -0
- package/components/Table/Body.astro +13 -0
- package/components/Table/Cell.astro +13 -0
- package/components/Table/Column.astro +15 -0
- package/components/Table/ColumnGroup.astro +13 -0
- package/components/Table/Head.astro +13 -0
- package/components/Table/HeaderCell.astro +13 -0
- package/components/Table/Row.astro +13 -0
- package/components/Table/Table.astro +15 -0
- package/components/Table/index.ts +20 -0
- package/components/Tabs/Tabs.astro +28 -0
- package/components/Tabs/TabsItem.astro +47 -0
- package/components/Tabs/TabsPanel.astro +21 -0
- package/components/Tabs/TabsTab.astro +19 -0
- package/components/Tabs/index.ts +14 -0
- package/components/TextField/TextField.astro +128 -0
- package/components/Textarea/Textarea.astro +106 -0
- package/components/Toast/Toast.astro +42 -0
- package/components/ToggleButton/ToggleButton.astro +53 -0
- package/components/ToggleGroup/ToggleGroup.astro +49 -0
- package/components/Tooltip/Tooltip.astro +30 -0
- package/{src/core → core}/normalize.css +194 -196
- package/core/palette.css +59 -0
- package/{src/core → core}/utils.css +71 -60
- package/css/components/accordion.css +174 -0
- package/css/components/anchor.css +27 -0
- package/{src/themes/theme-two → css}/components/avatar.css +65 -68
- package/css/components/badge.css +107 -0
- package/css/components/button-group.css +179 -0
- package/css/components/button.css +215 -0
- package/css/components/callout.css +109 -0
- package/css/components/card.css +117 -0
- package/css/components/checkbox.css +205 -0
- package/{src/themes/theme-one → css}/components/chip.css +87 -135
- package/{src/themes/theme-two/components/definition-list.css → css/components/description-list.css} +77 -68
- package/{src/themes/theme-two → css}/components/dialog.css +68 -59
- package/css/components/divider.css +20 -0
- package/css/components/drawer.css +171 -0
- package/css/components/form.css +146 -0
- package/css/components/icon-button.css +139 -0
- package/{src/themes/theme-two → css}/components/link.css +21 -21
- package/{src/themes/theme-two → css}/components/list.css +345 -318
- package/{src/themes/theme-one → css}/components/progress.css +97 -83
- package/css/components/radio.css +172 -0
- package/css/components/range.css +337 -0
- package/{src/themes/theme-two → css}/components/select.css +169 -162
- package/{src/themes/theme-two → css}/components/spinner.css +37 -38
- package/{src/themes/theme-two → css}/components/switch.css +268 -225
- package/css/components/table.css +179 -0
- package/css/components/tabs.css +77 -0
- package/css/components/text-field.css +450 -0
- package/css/components/text-input.css +64 -0
- package/{src/themes/theme-two → css}/components/textarea.css +24 -25
- package/css/components/toast.css +161 -0
- package/css/components/toggle-button.css +87 -0
- package/css/components/toggle-group.css +56 -0
- package/css/components/tooltip.css +67 -0
- package/css/components/typography.css +585 -0
- package/{src/themes/theme-two → css}/components.css +41 -37
- package/{src/themes/theme-two → css}/imports.css +16 -16
- package/css/js/checkbox.js +21 -0
- package/css/js/toast.js +94 -0
- package/css/theme.css +132 -0
- package/dist/op.css +1001 -32
- package/dist/op.css.map +1 -0
- package/dist/opui.components.css +5146 -0
- package/dist/opui.components.css.map +1 -0
- package/dist/opui.css +6615 -0
- package/dist/opui.css.map +1 -0
- package/env.d.ts +14 -0
- package/open-props.css +9 -0
- package/package.json +81 -72
- package/dist/theme-one/components.css +0 -3869
- package/dist/theme-one/theme-one.css +0 -4424
- package/dist/theme-two/components.css +0 -3591
- package/dist/theme-two/theme-two.css +0 -4141
- package/src/open-props.css +0 -10
- package/src/themes/theme-one/components/accordion.css +0 -172
- package/src/themes/theme-one/components/alert.css +0 -85
- package/src/themes/theme-one/components/avatar.css +0 -68
- package/src/themes/theme-one/components/badge.css +0 -101
- package/src/themes/theme-one/components/button-group.css +0 -69
- package/src/themes/theme-one/components/button.css +0 -281
- package/src/themes/theme-one/components/card.css +0 -82
- package/src/themes/theme-one/components/checkbox-radio.css +0 -123
- package/src/themes/theme-one/components/definition-list.css +0 -68
- package/src/themes/theme-one/components/dialog.css +0 -59
- package/src/themes/theme-one/components/divider.css +0 -7
- package/src/themes/theme-one/components/field-group.css +0 -83
- package/src/themes/theme-one/components/field.css +0 -494
- package/src/themes/theme-one/components/icon-button.css +0 -40
- package/src/themes/theme-one/components/link.css +0 -21
- package/src/themes/theme-one/components/list.css +0 -318
- package/src/themes/theme-one/components/range.css +0 -121
- package/src/themes/theme-one/components/rich-text.css +0 -210
- package/src/themes/theme-one/components/select.css +0 -163
- package/src/themes/theme-one/components/snackbar.css +0 -148
- package/src/themes/theme-one/components/spinner.css +0 -38
- package/src/themes/theme-one/components/switch.css +0 -225
- package/src/themes/theme-one/components/tab-buttons.css +0 -120
- package/src/themes/theme-one/components/table.css +0 -92
- package/src/themes/theme-one/components/text-field.css +0 -57
- package/src/themes/theme-one/components/textarea.css +0 -25
- package/src/themes/theme-one/components/toggle-button-group.css +0 -135
- package/src/themes/theme-one/components/tooltip.css +0 -94
- package/src/themes/theme-one/components/typography.css +0 -209
- package/src/themes/theme-one/components.css +0 -37
- package/src/themes/theme-one/imports.css +0 -16
- package/src/themes/theme-one/theme.css +0 -163
- package/src/themes/theme-two/components/accordion.css +0 -172
- package/src/themes/theme-two/components/alert.css +0 -85
- package/src/themes/theme-two/components/badge.css +0 -101
- package/src/themes/theme-two/components/button-group.css +0 -50
- package/src/themes/theme-two/components/button.css +0 -229
- package/src/themes/theme-two/components/card.css +0 -82
- package/src/themes/theme-two/components/checkbox-radio.css +0 -123
- package/src/themes/theme-two/components/chip.css +0 -135
- package/src/themes/theme-two/components/divider.css +0 -7
- package/src/themes/theme-two/components/field-group.css +0 -83
- package/src/themes/theme-two/components/field.css +0 -281
- package/src/themes/theme-two/components/icon-button.css +0 -40
- package/src/themes/theme-two/components/progress.css +0 -83
- package/src/themes/theme-two/components/range.css +0 -121
- package/src/themes/theme-two/components/rich-text.css +0 -210
- package/src/themes/theme-two/components/snackbar.css +0 -148
- package/src/themes/theme-two/components/tab-buttons.css +0 -120
- package/src/themes/theme-two/components/table.css +0 -99
- package/src/themes/theme-two/components/text-field.css +0 -57
- package/src/themes/theme-two/components/toggle-button-group.css +0 -135
- package/src/themes/theme-two/components/tooltip.css +0 -94
- package/src/themes/theme-two/components/typography.css +0 -209
- package/src/themes/theme-two/theme.css +0 -158
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 4.0.1 - 2026-05-13
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Autosuggest arrow placement.
|
|
8
|
+
|
|
9
|
+
## 4.0.0
|
|
10
|
+
|
|
11
|
+
Complete rewrite. The library now also ships as an installable npm package with Astro components.
|
|
12
|
+
|
|
13
|
+
Don't forget, I'm just a single person working on this in my free time. I'm doing this for fun. There will be bugs.
|
|
14
|
+
|
|
15
|
+
### Breaking
|
|
16
|
+
|
|
17
|
+
- `theme-one` and `theme-two` are removed. I can't maintain a million themes. There is now a single theme in `css/theme.css`.
|
|
18
|
+
- The default package entry (`import "opui-css"`) now resolves to the single bundled stylesheet (`dist/opui.css`) instead of `dist/theme-two/theme-two.css`. The class names are the same, the file path is not.
|
|
19
|
+
- The `src/themes/` build pipeline is gone (vite + postcss + per-theme scripts). The package now builds with a small `postcss-import`-only pipeline that does not transform or lower any CSS syntax.
|
|
20
|
+
- Component CSS source moved from `src/components/` to `css/components/`. The pre-bundled output stays in `dist/`.
|
|
21
|
+
- Cascade layer order is now declared by the library in `css/imports.css`: `openprops, normalize, theme, components.root, components.extended, utils`.
|
|
22
|
+
- `astro` `^6` is required if you import from `opui-css/astro`. Pure-CSS consumers are unaffected (the peer is marked optional).
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Anchor, Drawer, Form, Toast, Toggle, Tooltip and a lot of re-writes and improvements to existing components.
|
|
27
|
+
- Definition List -> Description List
|
|
28
|
+
- Tab buttons -> Tabs
|
|
29
|
+
- Toggle button group -> Toggle
|
|
30
|
+
- Astro component entry: `import { Button } from "opui-css/astro"`.
|
|
31
|
+
- Per-component CSS imports under `opui-css/css/components/*.css`.
|
|
32
|
+
- Pre-bundled stylesheets in `opui-css/dist/`: `opui.css` (everything), `opui.components.css` (components only), and `op.css` (Open Props tokens, unchanged subpath from v3) for CDN / no-bundler use.
|
|
33
|
+
- `sideEffects` correctly declared so bundlers don't tree-shake CSS.
|
|
34
|
+
|
|
35
|
+
### Migration
|
|
36
|
+
|
|
37
|
+
See [`MIGRATING.md`](./MIGRATING.md).
|
|
38
|
+
|
|
39
|
+
## 3.3.5 - 2026-02-19
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- goof: forgot to leave open-props as a dependency
|
|
44
|
+
|
|
45
|
+
## 3.3.4 - 2026-02-19
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- Moved all dependencies to `devDependencies`.
|
|
50
|
+
|
|
51
|
+
## 3.3.3 - 2026-01-07
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- **Build Process**: Refactored `scripts/build-themes.js` to support organized theme exports. Files are now exported to theme-specific subdirectories in `dist/`.
|
|
56
|
+
- **Package Exports**: Updated `package.json` to use subpath exports:
|
|
57
|
+
- Default export `"."` now points to `theme-two.css`.
|
|
58
|
+
- Added `"./theme-one"` and `"./theme-two"` exports.
|
|
59
|
+
- Added `"./theme-one/components"` and `"./theme-two/components"` component imports.
|
|
60
|
+
- Added `"./open-props"` export for the base Open Props stuff.
|
|
61
|
+
- **Documentation**: Updated "Getting Started" guide with new usage examples and bundler configuration instructions (Vite vs. PostCSS).
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- Improved build script to automatically create subdirectories in `dist/` if they don't exist.
|
|
66
|
+
- Fixed watch mode in `build-themes.js` to correctly track and rebuild both theme and component files.
|
|
67
|
+
|
|
68
|
+
## 3.3.1 - 2025-12-17
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- `switch.css` goof.
|
|
73
|
+
|
|
74
|
+
## 3.3.0 - 2025-12-17
|
|
75
|
+
|
|
76
|
+
### Added
|
|
77
|
+
|
|
78
|
+
- Internal updates and optimizations.
|
|
79
|
+
|
|
80
|
+
## 3.2.0 - 2025-12-07
|
|
81
|
+
|
|
82
|
+
### Added
|
|
83
|
+
|
|
84
|
+
- Add support for `kbd` element inside of `<button>`.
|
|
85
|
+
|
|
86
|
+
## 3.1.2 - 2025-11-09
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- Added CSS variable to control list hover `background-color`.
|
|
91
|
+
|
|
92
|
+
## 3.1.1 - 2025-10-23
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
|
|
96
|
+
- Add support for icons in Switch component (e.g., dark mode toggle).
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
|
|
100
|
+
- Bug fix for definition list where lists with lots of content weren't rendering correctly.
|
|
101
|
+
|
|
102
|
+
## 3.1.0 - 2025-10-23
|
|
103
|
+
|
|
104
|
+
### Changed
|
|
105
|
+
|
|
106
|
+
- Removed sticky header from `table` component to allow for custom implementations.
|
|
107
|
+
|
|
108
|
+
## 3.0.0 - 2025-10-22
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- **Themes**: Introduced a formal theme system.
|
|
113
|
+
- Added `theme-two` as the new default theme (cleaner, more unified).
|
|
114
|
+
- Revised documentation and getting started guide for the new theme system.
|
|
115
|
+
|
|
116
|
+
### Changed
|
|
117
|
+
|
|
118
|
+
- Refactored component structure to better support multiple themes.
|
|
119
|
+
|
|
120
|
+
## 2.2.3 - 2025-09-21
|
|
121
|
+
|
|
122
|
+
### Changed
|
|
123
|
+
|
|
124
|
+
- Reverted `box-sizing` change from previous release.
|
|
125
|
+
|
|
126
|
+
## 2.2.2 - 2025-08-19
|
|
127
|
+
|
|
128
|
+
### Changed
|
|
129
|
+
|
|
130
|
+
- Moved `theme.css` out of the main bundle.
|
|
131
|
+
- Made `box-sizing` declaration in normalize less intrusive.
|
|
132
|
+
|
|
133
|
+
## 2.0.1 - 2025-08-19
|
|
134
|
+
|
|
135
|
+
### Removed
|
|
136
|
+
|
|
137
|
+
- Removed redundant code and assets.
|
|
138
|
+
|
|
139
|
+
## 2.0.0 - 2025-08-19
|
|
140
|
+
|
|
141
|
+
### Changed
|
|
142
|
+
|
|
143
|
+
- **Folder Structure**: New and improved folder structure.
|
|
144
|
+
- **PostCSS**: Switched from `lightningcss` to `postcss` for better stability.
|
|
145
|
+
- **NPM**: Made the package installable via npm.
|
|
146
|
+
- **Layers**: Renamed component sub-layers to `components.root` and `components.extended`.
|
|
147
|
+
- **Bundles**: Added pre-bundled versions with and without Open Props.
|
|
148
|
+
|
|
149
|
+
### Fixed
|
|
150
|
+
|
|
151
|
+
- Progress component wrapped in `@layer`.
|
|
152
|
+
- Theme color scheme fallback improvements.
|
|
153
|
+
|
|
154
|
+
## 1.2.4 - 2025-04-23
|
|
155
|
+
|
|
156
|
+
### Fixed
|
|
157
|
+
|
|
158
|
+
- Normalize custom-media improvements.
|
|
159
|
+
|
|
160
|
+
## 1.2.3 - 2025-04-16
|
|
161
|
+
|
|
162
|
+
### Fixed
|
|
163
|
+
|
|
164
|
+
- Button CSS updates.
|
|
165
|
+
|
|
166
|
+
## 1.2.2 - 2025-03-18
|
|
167
|
+
|
|
168
|
+
### Added
|
|
169
|
+
|
|
170
|
+
- Improved Select list animation and implementation of `::picker-icon`.
|
|
171
|
+
- Context-aware link colors in Alerts.
|
|
172
|
+
|
|
173
|
+
## 1.2.1 - 2025-03-07
|
|
174
|
+
|
|
175
|
+
### Fixed
|
|
176
|
+
|
|
177
|
+
- Removed unused border color in Switch component.
|
|
178
|
+
|
|
179
|
+
## 1.2.0 - 2025-02-18
|
|
180
|
+
|
|
181
|
+
### Added
|
|
182
|
+
|
|
183
|
+
- New component: `tab-buttons`.
|
|
184
|
+
|
|
185
|
+
## 1.1.4 - 2025-02-18
|
|
186
|
+
|
|
187
|
+
### Fixed
|
|
188
|
+
|
|
189
|
+
- Dialog component improvements when used with `.card` class.
|
|
190
|
+
|
|
191
|
+
## 1.1.3 - 2025-02-11
|
|
192
|
+
|
|
193
|
+
### Fixed
|
|
194
|
+
|
|
195
|
+
- Field component: Fixed issue where input was pushed down instead of label moving.
|
|
196
|
+
|
|
197
|
+
## 1.1.2 - 2025-02-10
|
|
198
|
+
|
|
199
|
+
### Changed
|
|
200
|
+
|
|
201
|
+
- Refactored pseudo-elements to use double colons (`::`).
|
|
202
|
+
- General package upgrades.
|
|
203
|
+
|
|
204
|
+
### Fixed
|
|
205
|
+
|
|
206
|
+
- Normalize `::before` fix.
|
|
207
|
+
- Outline offset clipping.
|
|
208
|
+
|
|
209
|
+
## 1.1.1 - 2025-01-26
|
|
210
|
+
|
|
211
|
+
### Added
|
|
212
|
+
|
|
213
|
+
- `box-decoration-clone` for `mark` elements.
|
|
214
|
+
|
|
215
|
+
## 1.1.0 - 2025-01-19
|
|
216
|
+
|
|
217
|
+
### Added
|
|
218
|
+
|
|
219
|
+
- New component: `range` input.
|
|
220
|
+
|
|
221
|
+
## 1.0.2 - 2025-01-17
|
|
222
|
+
|
|
223
|
+
### Fixed
|
|
224
|
+
|
|
225
|
+
- Select and documentation fixes.
|
|
226
|
+
|
|
227
|
+
## 1.0.1 - 2025-01-16
|
|
228
|
+
|
|
229
|
+
### Changed
|
|
230
|
+
|
|
231
|
+
- Adjusted for Select API changes (`<selectedoption>` to `<selectedcontent>`).
|
|
232
|
+
- Checkmark pseudo-element changed from `::before` to `::check`.
|
|
233
|
+
|
|
234
|
+
## 1.0.0 - 2025-01-14
|
|
235
|
+
|
|
236
|
+
### Added
|
|
237
|
+
|
|
238
|
+
- Initial release with 25+ components.
|
|
239
|
+
- Full documentation website.
|
|
240
|
+
- Added `[name]` attribute support to accordion.
|
|
241
|
+
- Support for stroke SVG icons in buttons.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Felix Bohlin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/MIGRATING.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Migrating from v3 to v4
|
|
2
|
+
|
|
3
|
+
v4 is a full re-platform.
|
|
4
|
+
|
|
5
|
+
## 1. `import "opui-css"` still works
|
|
6
|
+
|
|
7
|
+
The default export still resolves to a complete, ready-to-use stylesheet — just under a different filename. No code change needed unless you want one.
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- import "opui-css" // resolved to dist/theme-two/theme-two.css
|
|
11
|
+
+ import "opui-css" // now resolves to dist/opui.css (single theme)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
If you imported `theme-one` specifically, you need to either accept the new theme or vendor the v3 stylesheet into your repo:
|
|
15
|
+
|
|
16
|
+
```diff
|
|
17
|
+
- import "opui-css/theme-one"
|
|
18
|
+
- import "opui-css/theme-one/components"
|
|
19
|
+
+ import "opui-css" // or your own override layer
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. `opui-css/open-props` is unchanged
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import "opui-css/open-props" // still points at compiled Open Props tokens
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 3. The other `dist/` subpaths
|
|
29
|
+
|
|
30
|
+
| v3 | v4 |
|
|
31
|
+
| ---------------------------------------- | ----------------------------------- |
|
|
32
|
+
| `opui-css/dist/theme-two/theme-two.css` | `opui-css/dist/opui.css` |
|
|
33
|
+
| `opui-css/dist/theme-two/components.css` | `opui-css/dist/opui.components.css` |
|
|
34
|
+
| `opui-css/dist/theme-one/theme-one.css` | removed |
|
|
35
|
+
| `opui-css/dist/theme-one/components.css` | removed |
|
|
36
|
+
| `opui-css/dist/op.css` | `opui-css/dist/op.css` (unchanged) |
|
|
37
|
+
|
|
38
|
+
## 4. Source layout moved
|
|
39
|
+
|
|
40
|
+
If you were importing from `src/`:
|
|
41
|
+
|
|
42
|
+
```diff
|
|
43
|
+
- @import "opui-css/src/components/button.css";
|
|
44
|
+
+ @import "opui-css/css/components/button.css";
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The component CSS now lives under `css/`. The pre-bundled output stays in `dist/`.
|
|
48
|
+
|
|
49
|
+
## 5. Pick a theme — there's only one
|
|
50
|
+
|
|
51
|
+
`theme-one` and `theme-two` are removed. The shipped theme lives in `css/theme.css`. To customise, override variables in a layer:
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@layer theme {
|
|
55
|
+
:root {
|
|
56
|
+
--primary: oklch(60% 0.2 250);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 6. `open-props` is now a peer dependency
|
|
62
|
+
|
|
63
|
+
v3 had `open-props` as a regular dependency. v4 makes it a peer so you control the version:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pnpm add open-props
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 7. New: Astro components
|
|
70
|
+
|
|
71
|
+
```astro
|
|
72
|
+
---
|
|
73
|
+
import { Button, Dialog, Tabs } from "opui-css/astro"
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
<Button variant="primary">Save</Button>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`astro` is an _optional_ peer — only required if you actually import from `opui-css/astro`. Pure-CSS consumers won't see a peer warning.
|
|
80
|
+
|
|
81
|
+
The components emit the same class names the v3 docs documented, so existing styles keep working.
|
|
82
|
+
|
|
83
|
+
## 8. Cascade layers
|
|
84
|
+
|
|
85
|
+
v4 declares the layer order in `css/imports.css` / `dist/opui.css`:
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
@layer openprops, normalize, theme, components.root, components.extended, utils;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Put your overrides in a later layer or unlayered. If your app already declared `@layer` with a different order, reconcile or import `dist/opui.components.css` and own the layer order yourself.
|
|
92
|
+
|
|
93
|
+
## 9. Copy/paste is still supported
|
|
94
|
+
|
|
95
|
+
The source files under `components/` and `css/components/` are unminified and free to vendor in — the license is unchanged (MIT).
|
|
96
|
+
|
|
97
|
+
## 10. Pinning v3
|
|
98
|
+
|
|
99
|
+
If you're not ready to migrate, pin the last v3 release:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{ "dependencies": { "opui-css": "3.3.5" } }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
v3 will not receive further updates.
|
package/README.md
CHANGED
|
@@ -1,51 +1,88 @@
|
|
|
1
1
|
# Open Props UI
|
|
2
2
|
|
|
3
|
-
A CSS UI library exploring how next-gen HTML & CSS features can change the way we create components.
|
|
3
|
+
A CSS UI library exploring how next-gen HTML & CSS features can change the way we create components. Built on top of [Open Props](https://open-props.style/) and ships [Astro](https://astro.build/) components alongside framework-agnostic CSS.
|
|
4
4
|
|
|
5
|
-
https://open-props-ui.netlify.app/
|
|
5
|
+
- Docs: [open-props-ui.netlify.app](https://open-props-ui.netlify.app/)
|
|
6
|
+
- Source: [github.com/felix-bohlin/ui](https://github.com/felix-bohlin/ui)
|
|
6
7
|
|
|
7
|
-
##
|
|
8
|
+
## Install
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add opui-css open-props
|
|
12
|
+
```
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Peer dependencies:
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
- `astro` `^6` (only required if you use the Astro components)
|
|
17
|
+
- `open-props` `^1`
|
|
14
18
|
|
|
15
|
-
##
|
|
19
|
+
## Usage
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### Astro components
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
```astro
|
|
24
|
+
---
|
|
25
|
+
import { Button, Card } from "opui-css/astro"
|
|
26
|
+
---
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
- Use modern HTML & CSS features
|
|
23
|
-
- Follow accessibility guidelines
|
|
24
|
-
- Serve as an inspiration
|
|
25
|
-
- Be scalable
|
|
28
|
+
<link rel="stylesheet" href="opui-css/css/imports.css" />
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
<Card>
|
|
31
|
+
<Button variant="primary">Click me</Button>
|
|
32
|
+
</Card>
|
|
33
|
+
```
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
# Install dependencies
|
|
31
|
-
pnpm i
|
|
35
|
+
### Plain HTML + CSS (no build step)
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
pnpm build
|
|
37
|
+
Drop a pre-bundled stylesheet into any page and use the documented class names:
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
```html
|
|
40
|
+
<link rel="stylesheet" href="https://unpkg.com/opui-css/dist/opui.css" />
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
pnpm clean
|
|
42
|
+
<button class="button primary">Click me</button>
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
`dist/opui.css` is a single self-contained file (Open Props + normalize + theme + every component + utils, in the correct cascade layers). `dist/opui.components.css` is the same minus tokens and reset for users who already have those.
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Documentation
|
|
47
|
+
If you do have a bundler that resolves CSS `@import`s (Vite, Astro, webpack, …), import the source instead so you only ship what you use:
|
|
48
48
|
|
|
49
|
+
```css
|
|
50
|
+
@import "opui-css/css/imports.css"; /* same content as dist/opui.css */
|
|
51
|
+
@import "opui-css/css/components/button.css"; /* or pick à la carte */
|
|
49
52
|
```
|
|
50
|
-
|
|
53
|
+
|
|
54
|
+
### Cascade layers
|
|
55
|
+
|
|
56
|
+
The library defines this layer order:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
@layer openprops, normalize, theme, components.root, components.extended, utils;
|
|
51
60
|
```
|
|
61
|
+
|
|
62
|
+
Wrap your own styles in a layer above `utils` (or unlayered) to override.
|
|
63
|
+
|
|
64
|
+
## Entry points
|
|
65
|
+
|
|
66
|
+
| Import | What it gives you |
|
|
67
|
+
| ----------------------------------- | --------------------------------------------- |
|
|
68
|
+
| `opui-css` | Pre-bundled: everything in one file (default) |
|
|
69
|
+
| `opui-css/open-props` | Pre-bundled: Open Props tokens only |
|
|
70
|
+
| `opui-css/dist/opui.css` | Same as default — explicit path |
|
|
71
|
+
| `opui-css/dist/opui.components.css` | Pre-bundled: components only |
|
|
72
|
+
| `opui-css/dist/op.css` | Same as `opui-css/open-props` — explicit path |
|
|
73
|
+
| `opui-css/css/imports.css` | Source: everything (resolved by your bundler) |
|
|
74
|
+
| `opui-css/css/components.css` | All component styles (no tokens / reset) |
|
|
75
|
+
| `opui-css/css/components/*.css` | One component at a time |
|
|
76
|
+
| `opui-css/core/normalize.css` | CSS reset |
|
|
77
|
+
| `opui-css/core/palette.css` | Extra OKLCH palette |
|
|
78
|
+
| `opui-css/core/utils.css` | Utility classes |
|
|
79
|
+
| `opui-css/astro` | All Astro components |
|
|
80
|
+
| `opui-css/components/*` | Individual Astro component sources |
|
|
81
|
+
|
|
82
|
+
## Contributing
|
|
83
|
+
|
|
84
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for the component-authoring pattern.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
[MIT](./LICENSE) © Felix Bohlin
|
package/astro/index.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { default as Accordion } from "../components/Accordion/Accordion.astro"
|
|
2
|
+
export { default as Anchor } from "../components/Anchor/Anchor.astro"
|
|
3
|
+
export { default as Avatar } from "../components/Avatar/Avatar.astro"
|
|
4
|
+
export { default as Badge } from "../components/Badge/Badge.astro"
|
|
5
|
+
export { default as Button } from "../components/Button/Button.astro"
|
|
6
|
+
export { default as ButtonGroup } from "../components/ButtonGroup/ButtonGroup.astro"
|
|
7
|
+
export { default as Callout } from "../components/Callout/Callout.astro"
|
|
8
|
+
export { default as Card } from "../components/Card/Card.astro"
|
|
9
|
+
export { default as Checkbox } from "../components/Checkbox/Checkbox.astro"
|
|
10
|
+
export { default as CheckboxInput } from "../components/Checkbox/CheckboxInput.astro"
|
|
11
|
+
export { default as Chip } from "../components/Chip/Chip.astro"
|
|
12
|
+
export { default as ClassicSelect } from "../components/ClassicSelect/ClassicSelect.astro"
|
|
13
|
+
export { default as DescriptionList } from "../components/DescriptionList/index"
|
|
14
|
+
export { default as Dialog } from "../components/Dialog/Dialog.astro"
|
|
15
|
+
export { default as Divider } from "../components/Divider/Divider.astro"
|
|
16
|
+
export { default as Drawer } from "../components/Drawer/Drawer.astro"
|
|
17
|
+
export { default as DrawerFooter } from "../components/Drawer/DrawerFooter.astro"
|
|
18
|
+
export { default as DrawerHeader } from "../components/Drawer/DrawerHeader.astro"
|
|
19
|
+
export { default as FieldDescription } from "../components/FieldDescription/FieldDescription.astro"
|
|
20
|
+
export { default as FieldGroup } from "../components/FieldGroup/FieldGroup.astro"
|
|
21
|
+
export { default as FieldLegend } from "../components/FieldLegend/FieldLegend.astro"
|
|
22
|
+
export { default as FieldSet } from "../components/FieldSet/FieldSet.astro"
|
|
23
|
+
export { default as Form } from "../components/Form/Form.astro"
|
|
24
|
+
export { default as IconButton } from "../components/IconButton/IconButton.astro"
|
|
25
|
+
export { default as List } from "../components/List/List.astro"
|
|
26
|
+
export { default as ListItem } from "../components/ListItem/ListItem.astro"
|
|
27
|
+
export { default as Progress } from "../components/Progress/Progress.astro"
|
|
28
|
+
export { default as Radio } from "../components/Radio/Radio.astro"
|
|
29
|
+
export { default as RadioInput } from "../components/Radio/RadioInput.astro"
|
|
30
|
+
export { default as Range } from "../components/Range/Range.astro"
|
|
31
|
+
export { default as Select } from "../components/Select/Select.astro"
|
|
32
|
+
export { default as Switch } from "../components/Switch/Switch.astro"
|
|
33
|
+
export { default as SwitchInput } from "../components/Switch/SwitchInput.astro"
|
|
34
|
+
export { default as Tabs } from "../components/Tabs/index"
|
|
35
|
+
export {
|
|
36
|
+
TabsItem,
|
|
37
|
+
Tab as TabsTab,
|
|
38
|
+
Panel as TabsPanel,
|
|
39
|
+
} from "../components/Tabs/index"
|
|
40
|
+
export { default as Table } from "../components/Table/index"
|
|
41
|
+
export { default as Textarea } from "../components/Textarea/Textarea.astro"
|
|
42
|
+
export { default as TextField } from "../components/TextField/TextField.astro"
|
|
43
|
+
export { default as Toast } from "../components/Toast/Toast.astro"
|
|
44
|
+
export { default as Tooltip } from "../components/Tooltip/Tooltip.astro"
|
|
45
|
+
export { default as ToggleButton } from "../components/ToggleButton/ToggleButton.astro"
|
|
46
|
+
export { default as ToggleGroup } from "../components/ToggleGroup/ToggleGroup.astro"
|