@visitwonders/assembly 0.16.1 → 0.18.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.
Files changed (80) hide show
  1. package/declarations/action/button-group.d.ts +5 -8
  2. package/declarations/action/button-group.d.ts.map +1 -1
  3. package/declarations/data/pagination.d.ts +3 -5
  4. package/declarations/data/pagination.d.ts.map +1 -1
  5. package/declarations/data/table.d.ts +12 -11
  6. package/declarations/data/table.d.ts.map +1 -1
  7. package/declarations/form/calendar.d.ts +19 -12
  8. package/declarations/form/calendar.d.ts.map +1 -1
  9. package/declarations/form/checkbox-group.d.ts +2 -8
  10. package/declarations/form/checkbox-group.d.ts.map +1 -1
  11. package/declarations/form/checkbox.d.ts +4 -8
  12. package/declarations/form/checkbox.d.ts.map +1 -1
  13. package/declarations/form/combobox-field.d.ts +1 -1
  14. package/declarations/form/combobox-field.d.ts.map +1 -1
  15. package/declarations/form/combobox.d.ts +1 -1
  16. package/declarations/form/combobox.d.ts.map +1 -1
  17. package/declarations/form/date-picker-field.d.ts +4 -3
  18. package/declarations/form/date-picker-field.d.ts.map +1 -1
  19. package/declarations/form/date-picker.d.ts +11 -8
  20. package/declarations/form/date-picker.d.ts.map +1 -1
  21. package/declarations/form/date-range-picker-field.d.ts +4 -3
  22. package/declarations/form/date-range-picker-field.d.ts.map +1 -1
  23. package/declarations/form/date-range-picker.d.ts +6 -9
  24. package/declarations/form/date-range-picker.d.ts.map +1 -1
  25. package/declarations/form/input.d.ts +1 -4
  26. package/declarations/form/input.d.ts.map +1 -1
  27. package/declarations/form/money-field.d.ts +13 -3
  28. package/declarations/form/money-field.d.ts.map +1 -1
  29. package/declarations/form/multi-combobox-field.d.ts +1 -1
  30. package/declarations/form/multi-combobox-field.d.ts.map +1 -1
  31. package/declarations/form/multi-combobox.d.ts +1 -1
  32. package/declarations/form/multi-combobox.d.ts.map +1 -1
  33. package/declarations/form/radio.d.ts +3 -5
  34. package/declarations/form/radio.d.ts.map +1 -1
  35. package/declarations/form/search-input.d.ts +2 -1
  36. package/declarations/form/search-input.d.ts.map +1 -1
  37. package/declarations/form/text-field.d.ts +1 -7
  38. package/declarations/form/text-field.d.ts.map +1 -1
  39. package/declarations/form/textarea.d.ts +1 -7
  40. package/declarations/form/textarea.d.ts.map +1 -1
  41. package/declarations/form/toggle-field.d.ts +2 -4
  42. package/declarations/form/toggle-field.d.ts.map +1 -1
  43. package/declarations/form/toggle.d.ts +3 -9
  44. package/declarations/form/toggle.d.ts.map +1 -1
  45. package/declarations/overlay/drawer.d.ts +10 -9
  46. package/declarations/overlay/drawer.d.ts.map +1 -1
  47. package/declarations/overlay/modal.d.ts +10 -10
  48. package/declarations/overlay/modal.d.ts.map +1 -1
  49. package/declarations/overlay/popover.d.ts +9 -8
  50. package/declarations/overlay/popover.d.ts.map +1 -1
  51. package/declarations/overlay/tooltip.d.ts +9 -8
  52. package/declarations/overlay/tooltip.d.ts.map +1 -1
  53. package/dist/action/button-group.js +2 -25
  54. package/dist/data/pagination.js +10 -24
  55. package/dist/data/table.css +51 -3
  56. package/dist/data/table.js +14 -71
  57. package/dist/form/calendar.js +29 -57
  58. package/dist/form/checkbox-group.js +3 -23
  59. package/dist/form/checkbox.js +3 -17
  60. package/dist/form/combobox-field.js.map +1 -1
  61. package/dist/form/date-picker-field.js +1 -1
  62. package/dist/form/date-picker-field.js.map +1 -1
  63. package/dist/form/date-picker.js +10 -28
  64. package/dist/form/date-range-picker-field.js +1 -1
  65. package/dist/form/date-range-picker-field.js.map +1 -1
  66. package/dist/form/date-range-picker.js +8 -31
  67. package/dist/form/input.js +1 -6
  68. package/dist/form/money-field.js +23 -22
  69. package/dist/form/multi-combobox-field.js.map +1 -1
  70. package/dist/form/radio.js +3 -4
  71. package/dist/form/search-input.js +6 -9
  72. package/dist/form/text-field.js +3 -22
  73. package/dist/form/textarea.js +2 -17
  74. package/dist/form/toggle-field.js +1 -1
  75. package/dist/form/toggle.js +4 -18
  76. package/dist/overlay/drawer.js +6 -26
  77. package/dist/overlay/modal.js +5 -29
  78. package/dist/overlay/popover.js +15 -16
  79. package/dist/overlay/tooltip.js +14 -16
  80. package/package.json +16 -17
@@ -72,12 +72,6 @@ class DrawerClose extends Component {
72
72
  // Main Component
73
73
  // ============================================================================
74
74
  class Drawer extends Component {
75
- static {
76
- g(this.prototype, "_isOpenInternal", [tracked], function () {
77
- return undefined;
78
- });
79
- }
80
- #_isOpenInternal = (i(this, "_isOpenInternal"), void 0);
81
75
  static {
82
76
  g(this.prototype, "exitAnimationActive", [tracked], function () {
83
77
  return false;
@@ -92,20 +86,8 @@ class Drawer extends Component {
92
86
  // ============================================================================
93
87
  // Getters
94
88
  // ============================================================================
95
- get isOpenInternal() {
96
- if (this._isOpenInternal === undefined) {
97
- return this.args.defaultOpen ?? false;
98
- }
99
- return this._isOpenInternal;
100
- }
101
- set isOpenInternal(value) {
102
- this._isOpenInternal = value;
103
- }
104
- get isControlled() {
105
- return this.args.open !== undefined;
106
- }
107
89
  get isOpen() {
108
- return this.isControlled ? this.args.open : this.isOpenInternal;
90
+ return this.args.open ?? false;
109
91
  }
110
92
  get side() {
111
93
  return this.args.side ?? 'right';
@@ -139,12 +121,10 @@ class Drawer extends Component {
139
121
  // ============================================================================
140
122
  // Actions
141
123
  // ============================================================================
142
- setOpen = value => {
143
- if (!this.isControlled) {
144
- this.isOpenInternal = value;
145
- }
146
- this.args.onOpenChange?.(value);
147
- };
124
+ // Requests a close and resolves once the slide-out animation has ended.
125
+ // The drawer holds no open state of its own — it fires the callback and
126
+ // the consumer sets `@open` to false. The returned promise is local
127
+ // teardown mechanics, awaited by consumers sequencing post-close work.
148
128
  closeDrawer = () => {
149
129
  if (!this.isOpen && !this.exitAnimationActive) {
150
130
  return Promise.resolve();
@@ -152,7 +132,7 @@ class Drawer extends Component {
152
132
  const promise = new Promise(resolve => {
153
133
  this.pendingCloseResolvers.push(resolve);
154
134
  });
155
- this.setOpen(false);
135
+ this.args.onOpenChange?.(false);
156
136
  return promise;
157
137
  };
158
138
  drainCloseResolvers() {
@@ -72,12 +72,6 @@ class ModalClose extends Component {
72
72
  // Main Component
73
73
  // ============================================================================
74
74
  class Modal extends Component {
75
- static {
76
- g(this.prototype, "_isOpenInternal", [tracked], function () {
77
- return undefined;
78
- });
79
- }
80
- #_isOpenInternal = (i(this, "_isOpenInternal"), void 0);
81
75
  static {
82
76
  g(this.prototype, "exitAnimationActive", [tracked], function () {
83
77
  return false;
@@ -91,20 +85,8 @@ class Modal extends Component {
91
85
  // ============================================================================
92
86
  // Getters
93
87
  // ============================================================================
94
- get isOpenInternal() {
95
- if (this._isOpenInternal === undefined) {
96
- return this.args.defaultOpen ?? false;
97
- }
98
- return this._isOpenInternal;
99
- }
100
- set isOpenInternal(value) {
101
- this._isOpenInternal = value;
102
- }
103
- get isControlled() {
104
- return this.args.open !== undefined;
105
- }
106
88
  get isOpen() {
107
- return this.isControlled ? this.args.open : this.isOpenInternal;
89
+ return this.args.open ?? false;
108
90
  }
109
91
  get size() {
110
92
  return this.args.size ?? 'md';
@@ -132,17 +114,11 @@ class Modal extends Component {
132
114
  // ============================================================================
133
115
  // Actions
134
116
  // ============================================================================
135
- setOpen = value => {
136
- if (!this.isControlled) {
137
- this.isOpenInternal = value;
138
- }
139
- this.args.onOpenChange?.(value);
140
- };
141
- openModal = () => {
142
- this.setOpen(true);
143
- };
117
+ // Internal close triggers (Esc, backdrop, close buttons) request a close
118
+ // by firing the callback. The modal holds no open state of its own — the
119
+ // consumer sets `@open` to false in response.
144
120
  closeModal = () => {
145
- this.setOpen(false);
121
+ this.args.onOpenChange?.(false);
146
122
  };
147
123
  handleBackdropClose = () => {
148
124
  if (this.closeOnBackdropClick) {
@@ -245,11 +245,14 @@ class PopoverClose extends Component {
245
245
  // ============================================================================
246
246
  class Popover extends Component {
247
247
  static {
248
- g(this.prototype, "_isOpenInternal", [tracked], function () {
249
- return undefined;
248
+ g(this.prototype, "_isOpen", [tracked], function () {
249
+ return false;
250
250
  });
251
251
  }
252
- #_isOpenInternal = (i(this, "_isOpenInternal"), void 0);
252
+ #_isOpen = (i(this, "_isOpen"), void 0); // Self-managed open state. The popover opens and closes itself on click,
253
+ // hover, or focus (per `@trigger`); this is the component's own UI
254
+ // mechanics, the ember-basic-dropdown shape. `@open`, when provided,
255
+ // overrides it.
253
256
  static {
254
257
  g(this.prototype, "triggerElement", [tracked], function () {
255
258
  return null;
@@ -307,20 +310,13 @@ class Popover extends Component {
307
310
  });
308
311
  };
309
312
  });
310
- get isOpenInternal() {
311
- if (this._isOpenInternal === undefined) {
312
- return this.args.defaultOpen ?? false;
313
- }
314
- return this._isOpenInternal;
315
- }
316
- set isOpenInternal(value) {
317
- this._isOpenInternal = value;
318
- }
319
- get isControlled() {
313
+ // True when the consumer is driving open via `@open`. The override wins
314
+ // over the self-managed `_isOpen` state.
315
+ get hasOpenOverride() {
320
316
  return this.args.open !== undefined;
321
317
  }
322
318
  get isOpen() {
323
- return this.isControlled ? this.args.open : this.isOpenInternal;
319
+ return this.args.open ?? this._isOpen;
324
320
  }
325
321
  get triggerMode() {
326
322
  return this.args.trigger ?? 'click';
@@ -338,8 +334,11 @@ class Popover extends Component {
338
334
  return this.args.closeDelay ?? 0;
339
335
  }
340
336
  setOpen = value => {
341
- if (!this.isControlled) {
342
- this.isOpenInternal = value;
337
+ // Update the self-managed state unless the consumer is driving `@open`.
338
+ // The callback fires either way so an `@open` consumer can follow the
339
+ // popover's own open/close intent rather than fighting it.
340
+ if (!this.hasOpenOverride) {
341
+ this._isOpen = value;
343
342
  }
344
343
  this.args.onOpenChange?.(value);
345
344
  };
@@ -67,11 +67,13 @@ class TooltipProvider extends Component {
67
67
  */
68
68
  class Tooltip extends Component {
69
69
  static {
70
- g(this.prototype, "_isOpenInternal", [tracked], function () {
71
- return undefined;
70
+ g(this.prototype, "_isOpen", [tracked], function () {
71
+ return false;
72
72
  });
73
73
  }
74
- #_isOpenInternal = (i(this, "_isOpenInternal"), void 0);
74
+ #_isOpen = (i(this, "_isOpen"), void 0); // Self-managed open state. The tooltip opens and closes itself on hover and
75
+ // focus; this is the component's own UI mechanics, the ember-basic-dropdown
76
+ // shape. `@open`, when provided, overrides it.
75
77
  static {
76
78
  g(this.prototype, "actualSide", [tracked], function () {
77
79
  return 'top';
@@ -92,21 +94,14 @@ class Tooltip extends Component {
92
94
  // ============================================================================
93
95
  // Getters
94
96
  // ============================================================================
95
- get isOpenInternal() {
96
- if (this._isOpenInternal === undefined) {
97
- return this.args.defaultOpen ?? false;
98
- }
99
- return this._isOpenInternal;
100
- }
101
- set isOpenInternal(value) {
102
- this._isOpenInternal = value;
103
- }
104
- get isControlled() {
97
+ // True when the consumer is driving open via `@open`. The override wins
98
+ // over the self-managed `_isOpen` state.
99
+ get hasOpenOverride() {
105
100
  return this.args.open !== undefined;
106
101
  }
107
102
  get isOpen() {
108
103
  if (this.args.disabled) return false;
109
- return this.isControlled ? this.args.open : this.isOpenInternal;
104
+ return this.args.open ?? this._isOpen;
110
105
  }
111
106
  get side() {
112
107
  return this.args.side ?? 'top';
@@ -244,8 +239,11 @@ class Tooltip extends Component {
244
239
  // State Management
245
240
  // ============================================================================
246
241
  setOpen = value => {
247
- if (!this.isControlled) {
248
- this.isOpenInternal = value;
242
+ // Update the self-managed state unless the consumer is driving `@open`.
243
+ // The callback fires either way so an `@open` consumer can follow the
244
+ // tooltip's own open/close intent rather than fighting it.
245
+ if (!this.hasOpenOverride) {
246
+ this._isOpen = value;
249
247
  }
250
248
  this.args.onOpenChange?.(value);
251
249
  // Track close time for skip delay behavior
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visitwonders/assembly",
3
- "version": "0.16.1",
3
+ "version": "0.18.0",
4
4
  "description": "The default blueprint for Embroider v2 addons.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -77,21 +77,6 @@
77
77
  "declarations",
78
78
  "dist"
79
79
  ],
80
- "scripts": {
81
- "build": "rollup --config",
82
- "format": "prettier . --cache --write",
83
- "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
84
- "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
85
- "lint:format": "prettier . --cache --check",
86
- "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
87
- "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
88
- "lint:js": "eslint . --cache",
89
- "lint:js:fix": "eslint . --fix",
90
- "lint:types": "ember-tsc",
91
- "prepack": "rm -rf declarations dist && rollup --config",
92
- "start": "rollup --config --watch",
93
- "test": "echo 'A v2 addon does not have tests, run tests in showcase'"
94
- },
95
80
  "dependencies": {
96
81
  "@arthur5005/dnd-kit-ember": "^0.1.2",
97
82
  "@embroider/addon-shim": "^1.8.9",
@@ -228,5 +213,19 @@
228
213
  "./typography/heading.js": "./dist/_app_/typography/heading.js",
229
214
  "./typography/text.js": "./dist/_app_/typography/text.js"
230
215
  }
216
+ },
217
+ "scripts": {
218
+ "build": "rollup --config",
219
+ "format": "prettier . --cache --write",
220
+ "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
221
+ "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
222
+ "lint:format": "prettier . --cache --check",
223
+ "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
224
+ "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
225
+ "lint:js": "eslint . --cache",
226
+ "lint:js:fix": "eslint . --fix",
227
+ "lint:types": "ember-tsc",
228
+ "start": "rollup --config --watch",
229
+ "test": "echo 'A v2 addon does not have tests, run tests in showcase'"
231
230
  }
232
- }
231
+ }