@filipgutica/ui 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/README.md +22 -168
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,11 @@
1
1
  # @filipgutica/ui
2
2
 
3
- A compact Vue 3.5+ design system built on [Reka UI](https://reka-ui.com), with
4
- Tailwind CSS 4 tokens and safe VS Code/Open VSX color-theme normalization.
3
+ Compact Vue 3.5+ components built on [Reka UI](https://reka-ui.com), with
4
+ Tailwind CSS 4 and VS Code theme support.
5
+
6
+ [Docs and playground](https://filipgutica.github.io/ui/) ·
7
+ [GitHub](https://github.com/filipgutica/ui) ·
8
+ [npm](https://www.npmjs.com/package/@filipgutica/ui)
5
9
 
6
10
  ## Install
7
11
 
@@ -9,7 +13,7 @@ Tailwind CSS 4 tokens and safe VS Code/Open VSX color-theme normalization.
9
13
  pnpm add @filipgutica/ui
10
14
  ```
11
15
 
12
- Import Tailwind and the shared theme files from your application stylesheet:
16
+ Import the styles from your application stylesheet:
13
17
 
14
18
  ```css
15
19
  @import "tailwindcss";
@@ -17,102 +21,27 @@ Import Tailwind and the shared theme files from your application stylesheet:
17
21
  @import "@filipgutica/ui/components.css";
18
22
  ```
19
23
 
20
- The theme exposes Tailwind utilities such as `bg-ui-bg`, `bg-ui-surface`,
21
- `text-ui-text`, `text-ui-muted`, `border-ui-border`, and `text-ui-error`.
22
-
23
- ## Vue components
24
-
25
- The first application-focused set includes:
26
-
27
- - `UiButton` with primary, secondary, ghost, danger, and text variants
28
- - `UiInput`, `UiSelect`, and `UiField` for consistent form controls
29
- - `UiCheckbox`, `UiSlider`, `UiRadioCard`, and `UiRadioCardGroup` for user input
30
- - `UiBadge`, `UiAlert`, and `UiProgress` for state and feedback
31
- - `UiCard` for structured content, actions, and footer metadata
32
- - `UiCodeBlock` for copyable, theme-aware source snippets
33
- - `UiDialog`, built on Reka UI, for accessible modal interaction
34
-
35
- Place `UiInput` or `UiSelect` inside `UiField`. The field supplies the control ID
36
- and automatically connects its description or error through the corresponding
37
- ARIA relationship.
24
+ ## Use
38
25
 
39
26
  ```vue
27
+ <script setup lang="ts">
28
+ import { UiButton } from '@filipgutica/ui'
29
+ </script>
30
+
40
31
  <template>
41
32
  <UiButton variant="secondary" size="sm">
42
- Inspect evidence
33
+ Save changes
43
34
  </UiButton>
44
35
  </template>
45
-
46
- <script setup lang="ts">
47
- import { UiButton } from '@filipgutica/ui'
48
- </script>
49
36
  ```
50
37
 
51
- `UiSelect` retains native form and keyboard behavior. Browsers with
52
- `appearance: base-select` support show a themed menu; other browsers use their
53
- native menu.
54
-
55
- `UiButton`, `UiInput`, `UiSelect`, `UiCheckbox`, and `UiSlider` share
56
- `size="sm | md | lg"`
57
- and default to the tighter `md` density. Existing `UiButton` values remain
58
- compatible: `compact` retains its former compact treatment and `default` maps
59
- to `lg`.
38
+ The [component docs](https://filipgutica.github.io/ui/#/components/button)
39
+ cover examples, props, slots, and events. Place inputs and selects inside
40
+ `UiField` to connect labels, descriptions, and errors automatically.
60
41
 
61
- `UiCodeBlock` accepts source text through `code`, shows a copy action by default,
62
- and highlights the selected language using the active theme. It can display a
63
- title, line numbers, or wrapped lines; unknown languages stay readable as plain text:
64
-
65
- ```vue
66
- <UiCodeBlock
67
- title="Example.vue"
68
- language="vue"
69
- :code="snippet"
70
- :line-numbers="true"
71
- />
72
- ```
42
+ ## Themes
73
43
 
74
- Highlighting supports Vue, JavaScript (`js`), TypeScript (`ts`), HTML, CSS,
75
- JSON, and Bash (`sh`/`shell`). Imported TextMate `tokenColors` are normalized
76
- into a shared syntax palette; language-specific overrides and font styles are
77
- not reproduced exactly. Themes saved before syntax support should be re-imported
78
- to recover their syntax colors. Existing saved themes remain usable with themed fallbacks.
79
-
80
- `UiSurface` remains exported for compatibility. New structured containers
81
- should use `UiCard`.
82
-
83
- ## Design conventions
84
-
85
- Use a compact system-font hierarchy: 14px for UI body text, 13px for
86
- secondary text, and 18px for dialog titles. Treat Open VSX/VS Code themes as
87
- the color authority, and use semantic tokens and package components instead of
88
- hard-coded provider color keys.
89
- Typography is package-owned through `--font-ui` and `--font-mono`; override
90
- these once at the application root rather than restyling each component.
91
-
92
- - Use shared control sizes `sm`, `md`, and `lg` (32px, 36px, and 44px); the
93
- default is `md`. Keep layout on a 4px rhythm, with 12px, 16px, and 24px as
94
- common gaps and insets.
95
- - Choose `UiCard` for structured content and optional actions or footer data.
96
- Choose `UiRadioCardGroup` with `UiRadioCard` for one-of-many rich options;
97
- choose `UiDialog` for modal tasks that need focus management.
98
- - Use one primary action per task, secondary buttons for supporting actions,
99
- and danger styling only for destructive actions. Use `UiBadge` for a short
100
- status, `UiAlert` for feedback, and `UiCodeBlock` for source code.
101
- - Put `UiInput` and `UiSelect` in `UiField` with a visible label. Supply help
102
- text or an error when needed so the field exposes the matching ARIA relationship.
103
- - Select menus use the same surface, type, radius, and spacing tokens as other
104
- controls. Keep option rows compact, show a checkmark for the selected value, and
105
- use quiet hover fills with visible keyboard focus.
106
- - Use raised surfaces and subtle borders for standalone cards. Align title, content,
107
- and footer insets; use a quiet divider for footer metadata and avoid card shadows.
108
- - Keep borders quiet and skip decorative grids. Preserve visible
109
- `:focus-visible` states, use 44px targets for touch-oriented actions, and provide
110
- an accessible name for every interactive control.
111
-
112
- ## VS Code themes
113
-
114
- The browser-safe theme entry point parses VS Code JSON/JSONC and maps supported
115
- workbench colors into the package's finite semantic token contract:
44
+ Import a VS Code JSON or JSONC theme in the browser:
116
45
 
117
46
  ```ts
118
47
  import { applySemanticTheme, parseVsCodeTheme } from '@filipgutica/ui/theme'
@@ -121,89 +50,14 @@ const theme = parseVsCodeTheme({ source, fileName })
121
50
  applySemanticTheme({ root: document.documentElement, theme })
122
51
  ```
123
52
 
124
- The Node-only Open VSX entry point searches and imports theme extensions without
125
- executing extension code:
126
-
127
- ```ts
128
- import { createOpenVsxThemeService } from '@filipgutica/ui/open-vsx'
129
-
130
- const themes = await createOpenVsxThemeService().search('Catppuccin')
131
- ```
132
-
133
- Open VSX packages are untrusted input. The importer restricts origins, validates
134
- identifiers and archive paths, caps downloaded and expanded sizes, checks the
135
- advertised SHA-256 checksum, and retains only normalized colors. Consumers that
136
- redistribute theme assets remain responsible for their licenses.
137
-
138
- ## Boundaries
139
-
140
- - Open VSX themes control color and light/dark/high-contrast appearance only.
141
- - Typography, spacing, radius, motion, and component structure remain owned by
142
- this package so applications keep a consistent design language.
143
- - `@filipgutica/ui/open-vsx` is Node-only. Do not import it into browser bundles.
144
-
145
- ## Docs and sandbox
146
-
147
- Start the component docs and sandbox:
148
-
149
- ```sh
150
- pnpm docs:dev
151
- ```
152
-
153
- Build the provider-neutral static assets:
154
-
155
- ```sh
156
- pnpm docs:build
157
- ```
158
-
159
- The docs use hash routes and relative asset paths, so the static assets work
160
- under a repository path without rewrite rules.
161
- The local Vite server also provides the same-origin `/api/open-vsx` endpoint.
162
- The theme picker uses this endpoint to search and import Open VSX themes.
163
-
164
- ### GitHub Pages
165
-
166
- The GitHub Pages site URL is [filipgutica.github.io/ui](https://filipgutica.github.io/ui/).
167
- The `docs.yml` workflow builds and deploys `docs-dist` on every push to `main`.
168
- It can also be started manually from the Actions tab. In the repository's
169
- **Settings → Pages**, select **GitHub Actions** as the build and deployment source.
170
-
171
- GitHub Pages serves static files and cannot run the Open VSX API. The workflow
172
- sets `VITE_STATIC_HOST=true` to disable live Open VSX search and imports;
173
- built-in themes and local theme-file imports remain available. To build the
174
- same static configuration locally:
175
-
176
- ```sh
177
- VITE_STATIC_HOST=true pnpm docs:build
178
- ```
179
-
180
- Other production hosts must provide `/api/open-vsx` for live Open VSX imports.
181
- Netlify and Amplify can use a serverless adapter.
53
+ Themes supply colors; the library keeps typography, spacing, and component
54
+ structure consistent. Open VSX search and imports are available through
55
+ `@filipgutica/ui/open-vsx`, which must run on a Node server.
182
56
 
183
57
  ## Development
184
58
 
185
59
  ```sh
186
60
  pnpm install
61
+ pnpm docs:dev
187
62
  pnpm verify
188
63
  ```
189
-
190
- Commits follow the Conventional Commits format. Releases run from `main`:
191
-
192
- - `fix:` publishes a patch release
193
- - `feat:` publishes a minor release
194
- - `feat!:` publishes a major release
195
- - `BREAKING CHANGE:` or `[BREAKING CHANGE]` anywhere in a commit body publishes
196
- a major release
197
- - the same markers anywhere in an associated merged PR body publish a major
198
- release
199
-
200
- The `release.yml` workflow runs on every push to `main`. When semantic-release
201
- finds qualifying commits, it publishes the next version to npm, creates the
202
- matching `v<version>` tag, and creates a GitHub Release. Configure an `NPM_TOKEN`
203
- Actions secret with permission to publish `@filipgutica/ui`; contributors do not
204
- publish locally or add a token to the repository.
205
-
206
- Before the first token-backed release, remove the package's existing trusted
207
- publisher in npm. The workflow retains `id-token: write` only for the provenance
208
- attestations enabled in `package.json`; npm registry authentication comes from
209
- the `NPM_TOKEN` secret.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/ui",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A compact Vue design system with Tailwind CSS and VS Code theme support",
5
5
  "type": "module",
6
6
  "sideEffects": [