polaris-vue-elements 0.4.0 → 0.4.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 CHANGED
@@ -11,6 +11,17 @@ major your app loads (`polaris-1.js`, `polaris-2.js`, …).
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [0.4.1] - 2026-10-29
15
+
16
+ Still generated from `@shopify/polaris-types` 2.0.0.
17
+
18
+ ### Fixed
19
+
20
+ - A boolean prop written as a bare attribute (`<SChip removable />`, `<SButton disabled />`) is
21
+ now on. Vue passes such an attribute to a prop declared without a Boolean type as `''`, which
22
+ the wrapper treated as falsy, so the attribute never reached the element and only
23
+ `:removable="true"` worked.
24
+
14
25
  ## [0.4.0] - 2026-10-27
15
26
 
16
27
  Still generated from `@shopify/polaris-types` 2.0.0.
@@ -96,7 +107,8 @@ Initial release: typed Vue 3 wrappers for the 59 Shopify Polaris web components
96
107
  `showOverlay()` / `hideOverlay()` / `toggleOverlay()`).
97
108
  - ESM build with bundled type declarations; `vue` ^3.5 as a peer dependency.
98
109
 
99
- [Unreleased]: https://github.com/HQCuong/polaris-vue/compare/v0.4.0...HEAD
110
+ [Unreleased]: https://github.com/HQCuong/polaris-vue/compare/v0.4.1...HEAD
111
+ [0.4.1]: https://github.com/HQCuong/polaris-vue/compare/v0.4.0...v0.4.1
100
112
  [0.4.0]: https://github.com/HQCuong/polaris-vue/compare/v0.3.0...v0.4.0
101
113
  [0.3.0]: https://github.com/HQCuong/polaris-vue/compare/v0.2.0...v0.3.0
102
114
  [0.2.0]: https://github.com/HQCuong/polaris-vue/compare/v0.1.0...v0.2.0
package/README.md CHANGED
@@ -101,11 +101,7 @@ npm run build:lib # build the publishable package into dist/
101
101
 
102
102
  ## Contributing
103
103
 
104
- 1. **Never edit `src/lib/generated/` or `docs/components/` by hand** — they are overwritten by the generators. Change `scripts/generate.mjs` / `scripts/generate-docs.mjs` instead.
105
- 2. **New form component needs v-model?** Add one line to `src/lib/overrides.ts` (the `overrides.spec.ts` drift guard will point at exactly what's missing).
106
- 3. **Curated docs example?** Add `docs/examples/<tag>.md` (complex live demos go in `docs/examples/demos/*.vue` — SFCs are immune to markdown-it mangling); the docs generator inlines it automatically.
107
- 4. Before opening a PR, make sure the full suite passes: `npm run generate && npm run docs:generate && npx vitest run && npm run type-check && npx oxlint . && npx eslint .` — CI runs the same checks plus a codegen-freshness diff.
108
- 5. Behavioral claims about Polaris components (slot rules, rendering quirks) should be verified against the real CDN runtime in a browser, not just jsdom — see `docs/guide/quirks.md` for previously verified findings.
104
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup, ground rules and the pre-PR checklist.
109
105
 
110
106
  ## Releasing
111
107
 
package/dist/index.js CHANGED
@@ -71,62 +71,65 @@ var r = {
71
71
  }
72
72
  };
73
73
  // src/lib/runtime/createWrapper.ts
74
- function i(e, t) {
74
+ function i(e) {
75
+ return e === "" || !!e;
76
+ }
77
+ function a(e, t) {
75
78
  let n = e;
76
79
  for (let [e, r] of t) n[e] = r;
77
80
  }
78
- function a(a) {
79
- let o = r[a.tagName], s = {};
80
- for (let e of a.props) s[e.name] = {
81
+ function o(o) {
82
+ let s = r[o.tagName], c = {};
83
+ for (let e of o.props) c[e.name] = {
81
84
  type: null,
82
85
  default: void 0
83
86
  };
84
- return o && (s.modelValue = {
87
+ return s && (c.modelValue = {
85
88
  type: null,
86
89
  default: void 0
87
90
  }), t({
88
- name: a.tagName,
91
+ name: o.tagName,
89
92
  inheritAttrs: !1,
90
- props: s,
91
- emits: o ? ["update:modelValue"] : [],
92
- setup(t, { attrs: r, slots: s, emit: c }) {
93
+ props: c,
94
+ emits: s ? ["update:modelValue"] : [],
95
+ setup(t, { attrs: r, slots: c, emit: l }) {
93
96
  return () => {
94
- let l = { ...r }, u = [], d = t;
95
- for (let e of a.props) {
96
- let t = d[e.name];
97
- t !== void 0 && (e.attribute ? e.type === "boolean" ? t && (l[e.attribute] = "") : l[e.attribute] = t : u.push([e.name, t]));
97
+ let u = { ...r }, d = [], f = t;
98
+ for (let e of o.props) {
99
+ let t = f[e.name];
100
+ t !== void 0 && (e.attribute ? e.type === "boolean" ? i(t) && (u[e.attribute] = "") : u[e.attribute] = t : d.push([e.name, t]));
98
101
  }
99
- if (o) {
100
- let e = d.modelValue;
102
+ if (s) {
103
+ let e = f.modelValue;
101
104
  if (e !== void 0) {
102
- let t = a.props.find((e) => e.name === o.prop);
103
- t?.attribute ? t.type === "boolean" ? e && (l[t.attribute] = "") : l[t.attribute] = e : u.push([o.prop, e]);
105
+ let t = o.props.find((e) => e.name === s.prop);
106
+ t?.attribute ? t.type === "boolean" ? i(e) && (u[t.attribute] = "") : u[t.attribute] = e : d.push([s.prop, e]);
104
107
  }
105
- let t = `on${o.event.charAt(0).toUpperCase()}${o.event.slice(1)}`, n = l[t];
106
- l[t] = (e) => {
108
+ let t = `on${s.event.charAt(0).toUpperCase()}${s.event.slice(1)}`, n = u[t];
109
+ u[t] = (e) => {
107
110
  let t = e.target;
108
- c("update:modelValue", t[o.prop]), n?.(e);
111
+ l("update:modelValue", t[s.prop]), n?.(e);
109
112
  };
110
113
  }
111
- u.length > 0 && (l.onVnodeMounted = (e) => {
112
- i(e.el, u);
113
- }, l.onVnodeUpdated = (e) => {
114
- i(e.el, u);
114
+ d.length > 0 && (u.onVnodeMounted = (e) => {
115
+ a(e.el, d);
116
+ }, u.onVnodeUpdated = (e) => {
117
+ a(e.el, d);
115
118
  });
116
- let f = [];
117
- s.default && f.push(...s.default());
118
- for (let t of Object.keys(s)) {
119
+ let p = [];
120
+ c.default && p.push(...c.default());
121
+ for (let t of Object.keys(c)) {
119
122
  if (t === "default") continue;
120
- let n = s[t];
121
- if (n) for (let r of n()) f.push(e(r, { slot: t }));
123
+ let n = c[t];
124
+ if (n) for (let r of n()) p.push(e(r, { slot: t }));
122
125
  }
123
- return n(a.tagName, l, f);
126
+ return n(o.tagName, u, p);
124
127
  };
125
128
  }
126
129
  });
127
130
  }
128
131
  // src/lib/generated/metadata.ts
129
- var o = {
132
+ var s = {
130
133
  SAvatar: {
131
134
  tagName: "s-avatar",
132
135
  props: [
@@ -3559,7 +3562,7 @@ var o = {
3559
3562
  ],
3560
3563
  slots: ["details", "error"]
3561
3564
  }
3562
- }, s = a(o.SAvatar), c = a(o.SBadge), l = a(o.SBanner), u = a(o.SBox), d = a(o.SButton), f = a(o.SButtonGroup), ee = a(o.SCheckbox), p = a(o.SChip), m = a(o.SChoice), h = a(o.SChoiceList), g = a(o.SClickable), _ = a(o.SClickableChip), v = a(o.SColorField), y = a(o.SColorPicker), b = a(o.SDateField), x = a(o.SDatePicker), S = a(o.SDivider), C = a(o.SDropZone), w = a(o.SEmailField), T = a(o.SEmptyState), E = a(o.SGrid), D = a(o.SGridItem), O = a(o.SHeading), k = a(o.SIcon), A = a(o.SImage), j = a(o.SLink), M = a(o.SListItem), N = a(o.SMenu), P = a(o.SModal), F = a(o.SMoneyField), I = a(o.SNumber), L = a(o.SNumberField), R = a(o.SOption), z = a(o.SOptionGroup), B = a(o.SOrderedList), te = a(o.SPage), V = a(o.SParagraph), H = a(o.SPasswordField), U = a(o.SPopover), W = a(o.SPressButton), G = a(o.SProgress), K = a(o.SQueryContainer), q = a(o.SScrollBox), J = a(o.SSearchField), Y = a(o.SSection), X = a(o.SSelect), Z = a(o.SSpinner), Q = a(o.SStack), ne = a(o.SSwitch), re = a(o.STable), ie = a(o.STableBody), ae = a(o.STableCell), oe = a(o.STableHeader), $ = a(o.STableHeaderRow), se = a(o.STableRow), ce = a(o.SText), le = a(o.STextArea), ue = a(o.STextField), de = a(o.SThumbnail), fe = a(o.STooltip), pe = a(o.SUnorderedList), me = a(o.SUrlField), he = /* @__PURE__ */ "s-avatar.s-badge.s-banner.s-box.s-button.s-button-group.s-checkbox.s-chip.s-choice.s-choice-list.s-clickable.s-clickable-chip.s-color-field.s-color-picker.s-date-field.s-date-picker.s-divider.s-drop-zone.s-email-field.s-empty-state.s-grid.s-grid-item.s-heading.s-icon.s-image.s-link.s-list-item.s-menu.s-modal.s-money-field.s-number.s-number-field.s-option.s-option-group.s-ordered-list.s-page.s-paragraph.s-password-field.s-popover.s-press-button.s-progress.s-query-container.s-scroll-box.s-search-field.s-section.s-select.s-spinner.s-stack.s-switch.s-table.s-table-body.s-table-cell.s-table-header.s-table-header-row.s-table-row.s-text.s-text-area.s-text-field.s-thumbnail.s-tooltip.s-unordered-list.s-url-field".split(".");
3563
- export { s as SAvatar, c as SBadge, l as SBanner, u as SBox, d as SButton, f as SButtonGroup, ee as SCheckbox, p as SChip, m as SChoice, h as SChoiceList, g as SClickable, _ as SClickableChip, v as SColorField, y as SColorPicker, b as SDateField, x as SDatePicker, S as SDivider, C as SDropZone, w as SEmailField, T as SEmptyState, E as SGrid, D as SGridItem, O as SHeading, k as SIcon, A as SImage, j as SLink, M as SListItem, N as SMenu, P as SModal, F as SMoneyField, I as SNumber, L as SNumberField, R as SOption, z as SOptionGroup, B as SOrderedList, te as SPage, V as SParagraph, H as SPasswordField, U as SPopover, W as SPressButton, G as SProgress, K as SQueryContainer, q as SScrollBox, J as SSearchField, Y as SSection, X as SSelect, Z as SSpinner, Q as SStack, ne as SSwitch, re as STable, ie as STableBody, ae as STableCell, oe as STableHeader, $ as STableHeaderRow, se as STableRow, ce as SText, le as STextArea, ue as STextField, de as SThumbnail, fe as STooltip, pe as SUnorderedList, me as SUrlField, he as componentTags, a as createWrapper };
3565
+ }, c = o(s.SAvatar), l = o(s.SBadge), u = o(s.SBanner), d = o(s.SBox), f = o(s.SButton), p = o(s.SButtonGroup), ee = o(s.SCheckbox), m = o(s.SChip), h = o(s.SChoice), g = o(s.SChoiceList), _ = o(s.SClickable), v = o(s.SClickableChip), y = o(s.SColorField), b = o(s.SColorPicker), x = o(s.SDateField), S = o(s.SDatePicker), C = o(s.SDivider), w = o(s.SDropZone), T = o(s.SEmailField), E = o(s.SEmptyState), D = o(s.SGrid), O = o(s.SGridItem), k = o(s.SHeading), A = o(s.SIcon), j = o(s.SImage), M = o(s.SLink), N = o(s.SListItem), P = o(s.SMenu), F = o(s.SModal), I = o(s.SMoneyField), L = o(s.SNumber), R = o(s.SNumberField), z = o(s.SOption), B = o(s.SOptionGroup), V = o(s.SOrderedList), te = o(s.SPage), H = o(s.SParagraph), U = o(s.SPasswordField), W = o(s.SPopover), G = o(s.SPressButton), K = o(s.SProgress), q = o(s.SQueryContainer), J = o(s.SScrollBox), Y = o(s.SSearchField), X = o(s.SSection), Z = o(s.SSelect), Q = o(s.SSpinner), ne = o(s.SStack), re = o(s.SSwitch), ie = o(s.STable), ae = o(s.STableBody), oe = o(s.STableCell), $ = o(s.STableHeader), se = o(s.STableHeaderRow), ce = o(s.STableRow), le = o(s.SText), ue = o(s.STextArea), de = o(s.STextField), fe = o(s.SThumbnail), pe = o(s.STooltip), me = o(s.SUnorderedList), he = o(s.SUrlField), ge = /* @__PURE__ */ "s-avatar.s-badge.s-banner.s-box.s-button.s-button-group.s-checkbox.s-chip.s-choice.s-choice-list.s-clickable.s-clickable-chip.s-color-field.s-color-picker.s-date-field.s-date-picker.s-divider.s-drop-zone.s-email-field.s-empty-state.s-grid.s-grid-item.s-heading.s-icon.s-image.s-link.s-list-item.s-menu.s-modal.s-money-field.s-number.s-number-field.s-option.s-option-group.s-ordered-list.s-page.s-paragraph.s-password-field.s-popover.s-press-button.s-progress.s-query-container.s-scroll-box.s-search-field.s-section.s-select.s-spinner.s-stack.s-switch.s-table.s-table-body.s-table-cell.s-table-header.s-table-header-row.s-table-row.s-text.s-text-area.s-text-field.s-thumbnail.s-tooltip.s-unordered-list.s-url-field".split(".");
3566
+ export { c as SAvatar, l as SBadge, u as SBanner, d as SBox, f as SButton, p as SButtonGroup, ee as SCheckbox, m as SChip, h as SChoice, g as SChoiceList, _ as SClickable, v as SClickableChip, y as SColorField, b as SColorPicker, x as SDateField, S as SDatePicker, C as SDivider, w as SDropZone, T as SEmailField, E as SEmptyState, D as SGrid, O as SGridItem, k as SHeading, A as SIcon, j as SImage, M as SLink, N as SListItem, P as SMenu, F as SModal, I as SMoneyField, L as SNumber, R as SNumberField, z as SOption, B as SOptionGroup, V as SOrderedList, te as SPage, H as SParagraph, U as SPasswordField, W as SPopover, G as SPressButton, K as SProgress, q as SQueryContainer, J as SScrollBox, Y as SSearchField, X as SSection, Z as SSelect, Q as SSpinner, ne as SStack, re as SSwitch, ie as STable, ae as STableBody, oe as STableCell, $ as STableHeader, se as STableHeaderRow, ce as STableRow, le as SText, ue as STextArea, de as STextField, fe as SThumbnail, pe as STooltip, me as SUnorderedList, he as SUrlField, ge as componentTags, o as createWrapper };
3564
3567
 
3565
3568
  //# sourceMappingURL=index.js.map