ropav 0.1.1 → 0.1.2

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/dist/switch.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @layer ropav.components {
2
- .rp-switch[data-v-d966892e] {
2
+ .rp-switch[data-v-81b33803] {
3
3
  --_rp-switch-color: var(--rp-color-control-selected-bg);
4
4
  --_rp-switch-font-size: var(--rp-font-size-md);
5
5
  --_rp-switch-default-track-width: 46px;
@@ -26,15 +26,15 @@
26
26
  font-family: var(--rp-font-family);
27
27
  user-select: none;
28
28
  }
29
- .rp-switch--disabled[data-v-d966892e] {
29
+ .rp-switch--disabled[data-v-81b33803] {
30
30
  opacity: var(--rp-opacity-disabled);
31
31
  cursor: not-allowed;
32
32
  }
33
- .rp-switch[data-v-d966892e] {
33
+ .rp-switch[data-v-81b33803] {
34
34
  gap: var(--rp-spacing-2);
35
35
  font-size: var(--_rp-switch-font-size);
36
36
  }
37
- .rp-switch__native[data-v-d966892e] {
37
+ .rp-switch__native[data-v-81b33803] {
38
38
  position: absolute;
39
39
  width: 1px;
40
40
  height: 1px;
@@ -46,11 +46,11 @@
46
46
  border-width: 0;
47
47
  pointer-events: none;
48
48
  }
49
- .rp-switch__native:focus-visible + .rp-switch__track[data-v-d966892e] {
49
+ .rp-switch__native:focus-visible + .rp-switch__track[data-v-81b33803] {
50
50
  border-color: var(--rp-color-control-border-focus);
51
51
  box-shadow: 0 0 0 var(--rp-border-width-medium) var(--rp-color-focus-ring);
52
52
  }
53
- .rp-switch__track[data-v-d966892e] {
53
+ .rp-switch__track[data-v-81b33803] {
54
54
  position: relative;
55
55
  display: inline-flex;
56
56
  align-items: center;
@@ -61,17 +61,17 @@
61
61
  border-radius: var(--rp-radius-full);
62
62
  transition: background-color var(--rp-transition-fast);
63
63
  }
64
- .rp-switch--checked .rp-switch__track[data-v-d966892e] {
64
+ .rp-switch--checked .rp-switch__track[data-v-81b33803] {
65
65
  background-color: var(--_rp-switch-color);
66
66
  }
67
- .rp-switch--invalid .rp-switch__track[data-v-d966892e] {
67
+ .rp-switch--invalid .rp-switch__track[data-v-81b33803] {
68
68
  outline: var(--rp-border-width-thin) solid var(--_rp-switch-invalid-border);
69
69
  outline-offset: var(--_rp-switch-thumb-offset);
70
70
  }
71
- .rp-switch--invalid .rp-switch__native:focus-visible + .rp-switch__track[data-v-d966892e] {
71
+ .rp-switch--invalid .rp-switch__native:focus-visible + .rp-switch__track[data-v-81b33803] {
72
72
  box-shadow: 0 0 0 var(--rp-border-width-medium) var(--_rp-switch-invalid-ring);
73
73
  }
74
- .rp-switch__thumb[data-v-d966892e] {
74
+ .rp-switch__thumb[data-v-81b33803] {
75
75
  position: absolute;
76
76
  left: var(--_rp-switch-thumb-offset);
77
77
  width: var(--_rp-switch-thumb-size);
@@ -81,38 +81,38 @@
81
81
  box-shadow: var(--rp-shadow-sm);
82
82
  transition: transform var(--rp-transition-fast);
83
83
  }
84
- .rp-switch--checked .rp-switch__thumb[data-v-d966892e] {
84
+ .rp-switch--checked .rp-switch__thumb[data-v-81b33803] {
85
85
  transform: translateX(calc(var(--_rp-switch-track-width) - var(--_rp-switch-thumb-size) - var(--_rp-switch-thumb-offset) * 2));
86
86
  }
87
- .rp-switch__label[data-v-d966892e] {
87
+ .rp-switch__label[data-v-81b33803] {
88
88
  line-height: var(--rp-line-height-md);
89
89
  color: var(--rp-color-text);
90
90
  }
91
- .rp-switch--size-xs[data-v-d966892e] {
91
+ .rp-switch--size-xs[data-v-81b33803] {
92
92
  --_rp-switch-default-track-width: 32px;
93
93
  --_rp-switch-default-track-height: 16px;
94
94
  --_rp-switch-default-thumb-size: 12px;
95
95
  --_rp-switch-font-size: var(--rp-font-size-xs);
96
96
  }
97
- .rp-switch--size-sm[data-v-d966892e] {
97
+ .rp-switch--size-sm[data-v-81b33803] {
98
98
  --_rp-switch-default-track-width: 38px;
99
99
  --_rp-switch-default-track-height: 20px;
100
100
  --_rp-switch-default-thumb-size: 14px;
101
101
  --_rp-switch-font-size: var(--rp-font-size-sm);
102
102
  }
103
- .rp-switch--size-md[data-v-d966892e] {
103
+ .rp-switch--size-md[data-v-81b33803] {
104
104
  --_rp-switch-default-track-width: 46px;
105
105
  --_rp-switch-default-track-height: 24px;
106
106
  --_rp-switch-default-thumb-size: 18px;
107
107
  --_rp-switch-font-size: var(--rp-font-size-md);
108
108
  }
109
- .rp-switch--size-lg[data-v-d966892e] {
109
+ .rp-switch--size-lg[data-v-81b33803] {
110
110
  --_rp-switch-default-track-width: 56px;
111
111
  --_rp-switch-default-track-height: 30px;
112
112
  --_rp-switch-default-thumb-size: 22px;
113
113
  --_rp-switch-font-size: var(--rp-font-size-lg);
114
114
  }
115
- .rp-switch--size-xl[data-v-d966892e] {
115
+ .rp-switch--size-xl[data-v-81b33803] {
116
116
  --_rp-switch-default-track-width: 72px;
117
117
  --_rp-switch-default-track-height: 36px;
118
118
  --_rp-switch-default-thumb-size: 28px;
package/dist/switch.js CHANGED
@@ -5,7 +5,7 @@ import { n as getComponentColorValue } from "./componentColors.js";
5
5
  import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
6
6
  import { o as useControllableValue, r as useCheckedFormControl } from "./useFormControl.js";
7
7
  import { t as useControlState } from "./useControlState.js";
8
- import { child, computed, createIf, createSlot, defineVaporComponent, next, ref, renderEffect, setDynamicProps, setInsertionState, setStaticTemplateRef, template, unref } from "vue";
8
+ import { child, computed, createIf, createSlot, defineVaporComponent, next, nextTick, ref, renderEffect, setDynamicProps, setInsertionState, setStaticTemplateRef, template, unref } from "vue";
9
9
  //#region src/components/switch/useSwitch.ts
10
10
  function getSwitchColorStyle(color) {
11
11
  const colorValue = getComponentColorValue(color);
@@ -23,7 +23,11 @@ function useSwitch(props, emitUpdate, getValue = () => props.modelValue ?? false
23
23
  }));
24
24
  const rootStyle = computed(() => getSwitchColorStyle(props.color));
25
25
  function onChange(e) {
26
- emitUpdate(e.target.checked);
26
+ const input = e.target;
27
+ emitUpdate(input.checked);
28
+ nextTick(() => {
29
+ input.checked = getValue();
30
+ });
27
31
  }
28
32
  function focus(options) {
29
33
  inputRef.value?.focus(options);
@@ -39,8 +43,8 @@ function useSwitch(props, emitUpdate, getValue = () => props.modelValue ?? false
39
43
  }
40
44
  //#endregion
41
45
  //#region src/components/switch/switch.vue?vue&type=script&setup=true&vapor=true&lang.ts
42
- var t0 = template("<span data-v-d966892e>");
43
- var t1 = template("<label data-v-d966892e><input data-v-d966892e><span data-v-d966892e><span data-v-d966892e></span></span>", 1);
46
+ var t0 = template("<span data-v-81b33803>");
47
+ var t1 = template("<label data-v-81b33803><input data-v-81b33803><span data-v-81b33803><span data-v-81b33803></span></span>", 1);
44
48
  //#endregion
45
49
  //#region src/components/switch/switch.vue
46
50
  var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
@@ -113,6 +117,7 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
113
117
  }),
114
118
  "data-disabled": presence(control.disabled),
115
119
  "data-invalid": presence(control.invalid),
120
+ "data-state": controllable.value.value ? "checked" : "unchecked",
116
121
  onChange(event) {
117
122
  onChange(event);
118
123
  attrs.onChange?.(event);
@@ -165,7 +170,7 @@ var switch_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
165
170
  });
166
171
  return n7;
167
172
  }
168
- }), [["__scopeId", "data-v-d966892e"]]);
173
+ }), [["__scopeId", "data-v-81b33803"]]);
169
174
  //#endregion
170
175
  //#region src/components/switch/types.ts
171
176
  var switchParts = [
package/dist/tooltip.js CHANGED
@@ -317,10 +317,7 @@ var tooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
317
317
  to: () => unref(teleportTo),
318
318
  disabled: () => !__props.teleport
319
319
  }, () => {
320
- return createComponent(VaporTransition, {
321
- name: "rp-tooltip-content",
322
- persisted: ""
323
- }, extend(() => {
320
+ return createComponent(VaporTransition, { name: "rp-tooltip-content" }, extend(() => {
324
321
  return createIf(() => unref(shouldRenderContent), () => {
325
322
  const n11 = t2();
326
323
  renderEffect(() => setDynamicProps(n11, [
@@ -0,0 +1,5 @@
1
+ export interface VaporIconCompiler {
2
+ compiler(svg: string, collection: string, icon: string): string;
3
+ }
4
+ /** An unplugin-icons compiler that emits zero-VDOM Vue Vapor components. */
5
+ export declare function vaporIconCompiler(): VaporIconCompiler;
@@ -0,0 +1,40 @@
1
+ import { compile } from "@vue/compiler-vapor";
2
+ //#region src/unplugin-icons.ts
3
+ var randomIdHelper = "const __randId = () => Math.random().toString(36).substr(2, 10);";
4
+ function handleSVGId(svg) {
5
+ if (!/="url\(#/.test(svg)) return {
6
+ svg,
7
+ injectScripts: ""
8
+ };
9
+ const idMap = {};
10
+ return {
11
+ svg: svg.replace(/\b([\w-]+)="url\(#(.+?)\)"/g, (_, attr, id) => {
12
+ idMap[id] = `'${id}':'uicons-'+__randId()`;
13
+ return `:${attr}="'url(#'+idMap['${id}']+')'"`;
14
+ }).replace(/\bid="(.+?)"/g, (full, id) => {
15
+ if (idMap[id]) return `:id="idMap['${id}']"`;
16
+ return full;
17
+ }),
18
+ injectScripts: `${randomIdHelper}const idMap = {${Object.values(idMap).join(",")}};`
19
+ };
20
+ }
21
+ /** An unplugin-icons compiler that emits zero-VDOM Vue Vapor components. */
22
+ function vaporIconCompiler() {
23
+ return { compiler(svg, collection, icon) {
24
+ const name = `${collection}-${icon}`;
25
+ const { injectScripts, svg: handled } = handleSVGId(svg);
26
+ let { code } = compile(handled, {
27
+ filename: `${name}.vue`,
28
+ prefixIdentifiers: true
29
+ });
30
+ code = code.replace(/^export /gm, "");
31
+ const setup = injectScripts ? `,\n setup() {${injectScripts};return { idMap }}` : "";
32
+ return `${code}
33
+ import { defineVaporComponent, markRaw } from 'vue';
34
+
35
+ export default markRaw(defineVaporComponent({ name: ${JSON.stringify(name)}, render${setup} }))
36
+ /* vite-plugin-components disabled */`;
37
+ } };
38
+ }
39
+ //#endregion
40
+ export { vaporIconCompiler };
@@ -26,7 +26,7 @@ Ropav does not expose a `vars` prop. Public CSS variables are set through CSS, t
26
26
 
27
27
  - Classes merge as internal classes, compatibility classes, `classNames`, then root `class` attributes.
28
28
  - Styles merge as internal styles, compatibility styles, `styles`, then root `style` attributes. Later stages win a duplicate property.
29
- - `inputAttrs` styling and `thumbStyle` are compatibility stages because these escape hatches also carry non-styling behavior.
29
+ - `inputAttrs` styling is a compatibility stage because this escape hatch also carries non-styling behavior.
30
30
  - Attributes and native listeners are forwarded exactly once to the public root host. Internal native handlers run before consumer handlers.
31
31
  - Declared component events remain component events. Component-owned roles, ARIA and behavioral attributes remain authoritative.
32
32
  - Composite components do not copy root attributes into their child components. Teleported roots receive attributes on the rendered host, not on the virtual teleport node.
@@ -64,7 +64,8 @@ Only independently useful semantic elements are public parts. Conditional parts
64
64
  | Radio | `root`, `input`, `indicator`, `label` |
65
65
  | RadioGroup | `root` |
66
66
  | Select | `root`, `trigger`, `value`, `indicator`, `clear`, `content`, `option`, `empty` |
67
- | Slider, RangeSlider | `root`, `label`, `value`, `track`, `range`, `input`, `thumb`, `mark`, `markLabel`, `tooltip` |
67
+ | Slider | `root`, `label`, `value`, `track`, `range`, `input`, `thumb`, `mark`, `markLabel`, `tooltip` |
68
+ | RangeSlider | `root`, `label`, `value`, `track`, `range`, `input`, `thumb`, `mark`, `markLabel`, `tooltip` |
68
69
  | Switch | `root`, `input`, `track`, `thumb`, `label` |
69
70
  | Tabs, TabsList, TabsTrigger, TabsContent | `root` on each component |
70
71
  | Textarea | `root`, `input` |
@@ -90,6 +91,8 @@ Boolean states use presence semantics: the attribute value is empty when true an
90
91
  - `data-selected`: Select options and ColorPicker swatches.
91
92
  - `data-highlighted`: Select options and DropdownMenu items.
92
93
  - `data-filled`: Slider and RangeSlider marks.
94
+ - `data-track-hovered` and `data-dragging`: Slider track pointer interaction.
95
+ - `data-thumb-visibility="always|interaction|hidden"`: Slider thumb visibility behavior.
93
96
  - `data-submenu`: DropdownMenu items that own children.
94
97
  - `data-orientation="horizontal|vertical"`: Accordion, ButtonGroup, RadioGroup, Slider, RangeSlider, Tabs and TabsList.
95
98
  - `data-placement`: the final placement after collision handling; twelve placements for Popover and DropdownMenu, and a side (`top`, `right`, `bottom`, `left`) for Tooltip.
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "ropav",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
+ "packageManager": "pnpm@11.13.1",
6
7
  "engines": {
7
8
  "node": "^20.19.0 || ^22.13.0 || >=24.0.0"
8
9
  },
@@ -163,13 +164,58 @@
163
164
  "types": "./dist/components/tooltip/index.d.ts",
164
165
  "import": "./dist/components/tooltip/index.js"
165
166
  },
167
+ "./unplugin-icons": {
168
+ "types": "./dist/unplugin-icons.d.ts",
169
+ "import": "./dist/unplugin-icons.js"
170
+ },
166
171
  "./base.css": "./dist/base.css",
167
172
  "./styles-manifest": "./src/styles/styles-manifest.json",
168
173
  "./styles-manifest.json": "./src/styles/styles-manifest.json",
169
174
  "./scss/*.scss": "./src/styles/*.scss"
170
175
  },
176
+ "scripts": {
177
+ "dev": "pnpm run storybook",
178
+ "tokens:build": "style-dictionary build --config scripts/tokens.config.mjs --silent",
179
+ "tokens:check": "node scripts/check-tokens.mjs",
180
+ "styles:manifest:bootstrap": "node scripts/bootstrap-public-styles-manifest.mjs",
181
+ "typecheck": "vue-tsc -b tsconfig.app.json tsconfig.node.json tsconfig.test.json",
182
+ "typecheck:storybook": "vue-tsc -p tsconfig.storybook.json --noEmit",
183
+ "lint": "oxlint",
184
+ "lint:fix": "oxlint --fix",
185
+ "format": "oxfmt",
186
+ "format:check": "oxfmt --check",
187
+ "test": "vitest run --project=unit",
188
+ "test:consumer-types": "pnpm run test:package",
189
+ "test:consumer-types:built": "tsc -p tests/fixtures/consumer-types/tsconfig.bundler.json && tsc -p tests/fixtures/consumer-types/tsconfig.nodenext.json",
190
+ "test:exports": "pnpm run test:package",
191
+ "test:exports:built": "node scripts/check-exports.mjs",
192
+ "test:consumer-fixture:built": "node tests/fixtures/consumer-app/check.mjs && vue-tsc -p tests/fixtures/consumer-app/tsconfig.json --noEmit && vite build --config tests/fixtures/consumer-app/vite.config.ts && node tests/fixtures/consumer-app/assertions.mjs",
193
+ "test:package": "pnpm run build && pnpm run test:exports:built && pnpm run test:consumer-types:built && pnpm run test:consumer-fixture:built",
194
+ "test:watch": "vitest --project=unit",
195
+ "test:typecheck": "vitest run --project=unit --typecheck",
196
+ "test:storybook": "vitest run --project=storybook",
197
+ "test:all": "pnpm run tokens:check && pnpm test && pnpm test:storybook",
198
+ "build": "pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck && vite build",
199
+ "prepublishOnly": "pnpm run test:package",
200
+ "preview": "vite preview",
201
+ "storybook": "pnpm run tokens:build && storybook dev -p 6006 --no-open",
202
+ "build-storybook": "pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck:storybook && storybook build",
203
+ "changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -o CHANGELOG.md",
204
+ "changelog:all": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -o CHANGELOG.md -r 0",
205
+ "release": "pnpm run test:package && bumpp --git-check --all --commit \"chore(release): v%s\" --tag \"v%s\" --execute \"pnpm run changelog\""
206
+ },
171
207
  "peerDependencies": {
172
- "vue": "^3.6.0-beta.4"
208
+ "@vue/compiler-vapor": "3.6.0-rc.1",
209
+ "unplugin-icons": "^23.0.1",
210
+ "vue": "^3.6.0-rc.1"
211
+ },
212
+ "peerDependenciesMeta": {
213
+ "@vue/compiler-vapor": {
214
+ "optional": true
215
+ },
216
+ "unplugin-icons": {
217
+ "optional": true
218
+ }
173
219
  },
174
220
  "dependencies": {
175
221
  "@floating-ui/dom": "^1.8.0",
@@ -183,7 +229,7 @@
183
229
  "@types/node": "^26.1.1",
184
230
  "@vitejs/plugin-vue": "^6.0.8",
185
231
  "@vitest/browser-playwright": "^4.1.10",
186
- "@vue/compiler-vapor": "3.6.0-beta.17",
232
+ "@vue/compiler-vapor": "3.6.0-rc.1",
187
233
  "@vue/tsconfig": "^0.9.1",
188
234
  "bumpp": "^11.1.0",
189
235
  "conventional-changelog": "^8.1.0",
@@ -200,41 +246,11 @@
200
246
  "vite": "^8.1.5",
201
247
  "vite-plugin-dts": "^5.0.3",
202
248
  "vitest": "^4.1.10",
203
- "vue": "3.6.0-beta.17",
249
+ "vue": "3.6.0-rc.1",
204
250
  "vue-tsc": "^3.3.7"
205
251
  },
206
252
  "repository": {
207
253
  "type": "git",
208
254
  "url": "https://github.com/daopk/ropav"
209
- },
210
- "scripts": {
211
- "dev": "pnpm run storybook",
212
- "tokens:build": "style-dictionary build --config scripts/tokens.config.mjs --silent",
213
- "tokens:check": "node scripts/check-tokens.mjs",
214
- "styles:manifest:bootstrap": "node scripts/bootstrap-public-styles-manifest.mjs",
215
- "typecheck": "vue-tsc -b tsconfig.app.json tsconfig.node.json tsconfig.test.json",
216
- "typecheck:storybook": "vue-tsc -p tsconfig.storybook.json --noEmit",
217
- "lint": "oxlint",
218
- "lint:fix": "oxlint --fix",
219
- "format": "oxfmt",
220
- "format:check": "oxfmt --check",
221
- "test": "vitest run --project=unit",
222
- "test:consumer-types": "pnpm run test:package",
223
- "test:consumer-types:built": "tsc -p tests/fixtures/consumer-types/tsconfig.bundler.json && tsc -p tests/fixtures/consumer-types/tsconfig.nodenext.json",
224
- "test:exports": "pnpm run test:package",
225
- "test:exports:built": "node scripts/check-exports.mjs",
226
- "test:consumer-fixture:built": "node tests/fixtures/consumer-app/check.mjs && vue-tsc -p tests/fixtures/consumer-app/tsconfig.json --noEmit && vite build --config tests/fixtures/consumer-app/vite.config.ts && node tests/fixtures/consumer-app/assertions.mjs",
227
- "test:package": "pnpm run build && pnpm run test:exports:built && pnpm run test:consumer-types:built && pnpm run test:consumer-fixture:built",
228
- "test:watch": "vitest --project=unit",
229
- "test:typecheck": "vitest run --project=unit --typecheck",
230
- "test:storybook": "vitest run --project=storybook",
231
- "test:all": "pnpm run tokens:check && pnpm test && pnpm test:storybook",
232
- "build": "pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck && vite build",
233
- "preview": "vite preview",
234
- "storybook": "pnpm run tokens:build && storybook dev -p 6006 --no-open",
235
- "build-storybook": "pnpm run tokens:build && pnpm run tokens:check && pnpm run typecheck:storybook && storybook build",
236
- "changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -o CHANGELOG.md",
237
- "changelog:all": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -o CHANGELOG.md -r 0",
238
- "release": "pnpm run test:package && bumpp --git-check --all --commit \"chore(release): v%s\" --tag \"v%s\" --execute \"pnpm run changelog\""
239
255
  }
240
- }
256
+ }