luxen-ui 0.1.2 → 0.2.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 (49) hide show
  1. package/cdn/custom-elements.json +183 -5
  2. package/cdn/elements/dialog/dialog.d.ts +4 -0
  3. package/cdn/elements/dialog/dialog.d.ts.map +1 -1
  4. package/cdn/elements/dialog/dialog.js +10 -6
  5. package/cdn/elements/dialog/dialog.js.map +1 -1
  6. package/cdn/elements/dialog/dialog.styles.js +1 -1
  7. package/cdn/elements/dialog/dialog.styles.js.map +1 -1
  8. package/cdn/elements/dropdown/dropdown.js +1 -1
  9. package/cdn/elements/dropdown/dropdown.js.map +1 -1
  10. package/cdn/elements/dropdown-item/dropdown-item.js +1 -1
  11. package/cdn/elements/dropdown-item/dropdown-item.js.map +1 -1
  12. package/cdn/elements/input-stepper/input-stepper.d.ts +3 -0
  13. package/cdn/elements/input-stepper/input-stepper.d.ts.map +1 -1
  14. package/cdn/elements/input-stepper/input-stepper.js.map +1 -1
  15. package/cdn/elements/popover/popover.d.ts +3 -1
  16. package/cdn/elements/popover/popover.d.ts.map +1 -1
  17. package/cdn/elements/popover/popover.js +2 -2
  18. package/cdn/elements/popover/popover.js.map +1 -1
  19. package/cdn/shared/controllers/popover.d.ts +1 -0
  20. package/cdn/shared/controllers/popover.d.ts.map +1 -1
  21. package/cdn/shared/controllers/popover.js +1 -1
  22. package/cdn/shared/controllers/popover.js.map +1 -1
  23. package/cdn/styles/elements/button.css +1 -1
  24. package/cdn/styles/elements/input-stepper/default.css +19 -16
  25. package/cdn/styles/elements/input-stepper/rounded.css +14 -11
  26. package/cdn/styles/index.css +5 -2
  27. package/dist/css/elements/button.css +1 -1
  28. package/dist/css/elements/input-stepper/default.css +19 -16
  29. package/dist/css/elements/input-stepper/rounded.css +14 -11
  30. package/dist/css/index.css +5 -2
  31. package/dist/custom-elements.json +183 -5
  32. package/dist/elements/dialog/dialog.css +4 -3
  33. package/dist/elements/dialog/dialog.d.ts +4 -0
  34. package/dist/elements/dialog/dialog.d.ts.map +1 -1
  35. package/dist/elements/dialog/dialog.js +17 -4
  36. package/dist/elements/dropdown/dropdown.css +4 -4
  37. package/dist/elements/dropdown-item/dropdown-item.css +2 -1
  38. package/dist/elements/input-stepper/input-stepper.d.ts +3 -0
  39. package/dist/elements/input-stepper/input-stepper.d.ts.map +1 -1
  40. package/dist/elements/input-stepper/input-stepper.js +3 -0
  41. package/dist/elements/popover/popover.css +9 -5
  42. package/dist/elements/popover/popover.d.ts +3 -1
  43. package/dist/elements/popover/popover.d.ts.map +1 -1
  44. package/dist/elements/popover/popover.js +15 -4
  45. package/dist/shared/controllers/popover.d.ts +1 -0
  46. package/dist/shared/controllers/popover.d.ts.map +1 -1
  47. package/dist/shared/controllers/popover.js +2 -1
  48. package/dist/skills/luxen-ui/references/dialog.md +3 -1
  49. package/package.json +3 -2
@@ -15,7 +15,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
15
15
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
16
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
17
  };
18
- var _LuxenPopover_for_accessor_storage, _LuxenPopover_placement_accessor_storage, _LuxenPopover_distance_accessor_storage, _LuxenPopover_open_accessor_storage, _LuxenPopover_withoutArrow_accessor_storage, _LuxenPopover_trigger_accessor_storage;
18
+ var _LuxenPopover_for_accessor_storage, _LuxenPopover_placement_accessor_storage, _LuxenPopover_distance_accessor_storage, _LuxenPopover_open_accessor_storage, _LuxenPopover_withoutArrow_accessor_storage, _LuxenPopover_fullWidth_accessor_storage, _LuxenPopover_trigger_accessor_storage;
19
19
  import { html, nothing, unsafeCSS } from 'lit';
20
20
  import { LuxenElement } from '../../shared/luxen-element';
21
21
  import { property } from 'lit/decorators.js';
@@ -35,7 +35,7 @@ const styles = unsafeCSS(rawStyles);
35
35
  *
36
36
  * @cssproperty --background - Background color. Default: `Canvas`.
37
37
  * @cssproperty --color - Text color. Default: inherited.
38
- * @cssproperty --radius - Border radius. Default `8px`.
38
+ * @cssproperty --border-radius - Border radius. Default `8px`.
39
39
  * @cssproperty --max-width - Maximum width. Default `320px`.
40
40
  * @cssproperty --shadow - Box shadow.
41
41
  * @cssproperty --arrow-size - Arrow size. Default `8px`.
@@ -59,6 +59,7 @@ export class LuxenPopover extends LuxenElement {
59
59
  _LuxenPopover_distance_accessor_storage.set(this, 8);
60
60
  _LuxenPopover_open_accessor_storage.set(this, false);
61
61
  _LuxenPopover_withoutArrow_accessor_storage.set(this, false);
62
+ _LuxenPopover_fullWidth_accessor_storage.set(this, false);
62
63
  _LuxenPopover_trigger_accessor_storage.set(this, 'click');
63
64
  // --- Trigger event handlers ---
64
65
  this._onPointerEnter = () => {
@@ -113,6 +114,9 @@ export class LuxenPopover extends LuxenElement {
113
114
  /** Hide the directional arrow. */
114
115
  get withoutArrow() { return __classPrivateFieldGet(this, _LuxenPopover_withoutArrow_accessor_storage, "f"); }
115
116
  set withoutArrow(value) { __classPrivateFieldSet(this, _LuxenPopover_withoutArrow_accessor_storage, value, "f"); }
117
+ /** Stretch the popover to the viewport width. Useful for mega menus. */
118
+ get fullWidth() { return __classPrivateFieldGet(this, _LuxenPopover_fullWidth_accessor_storage, "f"); }
119
+ set fullWidth(value) { __classPrivateFieldSet(this, _LuxenPopover_fullWidth_accessor_storage, value, "f"); }
116
120
  /** Space-separated list of trigger modes: `click`, `hover`, `focus`, `manual`. */
117
121
  get trigger() { return __classPrivateFieldGet(this, _LuxenPopover_trigger_accessor_storage, "f"); }
118
122
  set trigger(value) { __classPrivateFieldSet(this, _LuxenPopover_trigger_accessor_storage, value, "f"); }
@@ -164,7 +168,11 @@ export class LuxenPopover extends LuxenElement {
164
168
  const popover = this._popoverEl;
165
169
  if (!popover)
166
170
  return;
167
- const posOpts = { placement: this.placement, distance: this.distance };
171
+ const posOpts = {
172
+ placement: this.placement,
173
+ distance: this.distance,
174
+ fullWidth: this.fullWidth,
175
+ };
168
176
  if (this.open) {
169
177
  popover.showPopover();
170
178
  await this._floating.updatePosition(posOpts);
@@ -222,7 +230,7 @@ export class LuxenPopover extends LuxenElement {
222
230
  `;
223
231
  }
224
232
  }
225
- _LuxenPopover_for_accessor_storage = new WeakMap(), _LuxenPopover_placement_accessor_storage = new WeakMap(), _LuxenPopover_distance_accessor_storage = new WeakMap(), _LuxenPopover_open_accessor_storage = new WeakMap(), _LuxenPopover_withoutArrow_accessor_storage = new WeakMap(), _LuxenPopover_trigger_accessor_storage = new WeakMap();
233
+ _LuxenPopover_for_accessor_storage = new WeakMap(), _LuxenPopover_placement_accessor_storage = new WeakMap(), _LuxenPopover_distance_accessor_storage = new WeakMap(), _LuxenPopover_open_accessor_storage = new WeakMap(), _LuxenPopover_withoutArrow_accessor_storage = new WeakMap(), _LuxenPopover_fullWidth_accessor_storage = new WeakMap(), _LuxenPopover_trigger_accessor_storage = new WeakMap();
226
234
  LuxenPopover.styles = [hostStyles, styles];
227
235
  __decorate([
228
236
  property()
@@ -239,6 +247,9 @@ __decorate([
239
247
  __decorate([
240
248
  property({ type: Boolean, reflect: true, attribute: 'without-arrow' })
241
249
  ], LuxenPopover.prototype, "withoutArrow", null);
250
+ __decorate([
251
+ property({ type: Boolean, reflect: true, attribute: 'full-width' })
252
+ ], LuxenPopover.prototype, "fullWidth", null);
242
253
  __decorate([
243
254
  property()
244
255
  ], LuxenPopover.prototype, "trigger", null);
@@ -9,6 +9,7 @@ export interface PopoverControllerConfig {
9
9
  export interface PositionOptions {
10
10
  placement: Placement;
11
11
  distance: number;
12
+ fullWidth?: boolean;
12
13
  }
13
14
  type TriggerHandlers = {
14
15
  onPointerEnter?: (e: PointerEvent) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/html/shared/controllers/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,s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 @@ export class PopoverController {
223
223
  });
224
224
  Object.assign(floating.style, {
225
225
  position: 'fixed',
226
- left: `${x}px`,
226
+ left: options.fullWidth ? '0px' : `${x}px`,
227
227
  top: `${y}px`,
228
+ width: options.fullWidth ? '100vw' : '',
228
229
  });
229
230
  if (placement !== this._currentPlacement) {
230
231
  this._currentPlacement = placement;
@@ -352,7 +352,7 @@ Add `autofocus` to any focusable element inside the dialog to focus it automatic
352
352
  | Check | Description |
353
353
  |-------|-------------|
354
354
  | Role | Rendered as a native `<dialog>` in the shadow root — built-in `dialog` role and modal semantics |
355
- | Accessible name | The `title` property is rendered as an `<h2>` inside the dialog header |
355
+ | Accessible name | The `title` property renders as an `<h2>` in the header, or provide a custom heading via `slot="title"` |
356
356
  | Focus management | Focus is trapped inside the modal; moves to the first focusable element on open |
357
357
  | Focus restoration | Focus returns to the trigger element when the dialog closes |
358
358
  | Close button | Consumer provides the close button via `slot="close"` with `aria-label="Close"` |
@@ -385,6 +385,7 @@ import 'luxen-ui/dialog';
385
385
  { Attribute: 'title', Description: 'Dialog title rendered in the header as an `<h2>`' },
386
386
  { Attribute: 'open', Description: 'Whether the dialog is open. Reflects to attribute' },
387
387
  { Attribute: 'light-dismiss', Description: 'Close when the backdrop is clicked' },
388
+ { Attribute: 'without-header', Description: 'Hide the header entirely (title and close slot)' },
388
389
  ]" />
389
390
 
390
391
  ### Commands
@@ -409,6 +410,7 @@ Open and close the dialog by toggling its `open` property, or via the [Invoker C
409
410
 
410
411
  <ApiTable :data="[
411
412
  { Slot: '(default)', Description: 'Body content' },
413
+ { Slot: 'title', Description: 'Custom heading element. Overrides the default `<h2>` rendered from the `title` property' },
412
414
  { Slot: 'close', Description: 'Close button (typically `<button class=&quot;l-close&quot;>`)' },
413
415
  { Slot: 'footer', Description: 'Footer actions' },
414
416
  ]" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luxen-ui",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Modern web components and CSS-first UI library built with Lit. Framework-agnostic, customizable prefix, design tokens.",
5
5
  "keywords": [
6
6
  "custom-elements",
@@ -35,7 +35,8 @@
35
35
  "sideEffects": [
36
36
  "*.css",
37
37
  "**/define.js",
38
- "**/registry.js"
38
+ "**/registry.js",
39
+ "**/elements/*/index.js"
39
40
  ],
40
41
  "main": "./dist/index.js",
41
42
  "module": "./dist/index.js",