@ecopages/radiant-ui 0.1.0-beta.0 → 0.1.0-beta.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.
Files changed (75) hide show
  1. package/README.md +4 -2
  2. package/dist/components/ui/alert/alert.css +56 -23
  3. package/dist/components/ui/breadcrumb/breadcrumb.css +85 -36
  4. package/dist/components/ui/carousel/carousel.css +465 -166
  5. package/dist/components/ui/checkbox/checkbox.css +196 -49
  6. package/dist/components/ui/combobox/combobox.css +213 -60
  7. package/dist/components/ui/dialog/dialog.css +176 -49
  8. package/dist/components/ui/disclosure/disclosure.css +228 -100
  9. package/dist/components/ui/feed/feed.css +30 -10
  10. package/dist/components/ui/field/field.css +18 -22
  11. package/dist/components/ui/form/form.css +7 -8
  12. package/dist/components/ui/grid/grid.css +172 -43
  13. package/dist/components/ui/input/input.css +126 -30
  14. package/dist/components/ui/label/label.css +20 -6
  15. package/dist/components/ui/listbox/listbox.css +137 -19
  16. package/dist/components/ui/menu-button/index.js +1 -1
  17. package/dist/components/ui/menu-button/index.js.map +4 -4
  18. package/dist/components/ui/menu-button/menu-button.css +158 -38
  19. package/dist/components/ui/menu-button/menu-button.script.d.ts +7 -7
  20. package/dist/components/ui/menubar/index.js +1 -1
  21. package/dist/components/ui/menubar/index.js.map +2 -2
  22. package/dist/components/ui/menubar/menubar.css +207 -39
  23. package/dist/components/ui/meter/meter.css +50 -13
  24. package/dist/components/ui/navigation-menu/navigation-menu.css +281 -85
  25. package/dist/components/ui/radio-group/radio-group.css +179 -40
  26. package/dist/components/ui/shared/floating-position.d.ts +37 -0
  27. package/dist/components/ui/shared/floating-position.test.d.ts +1 -0
  28. package/dist/components/ui/shared/placement.d.ts +2 -0
  29. package/dist/components/ui/sidebar/sidebar.css +407 -189
  30. package/dist/components/ui/slider/slider.css +220 -47
  31. package/dist/components/ui/spinbutton/spinbutton.css +65 -15
  32. package/dist/components/ui/switch/switch.css +164 -43
  33. package/dist/components/ui/tabs/tabs.css +145 -24
  34. package/dist/components/ui/textarea/textarea.css +128 -31
  35. package/dist/components/ui/toast/toast.css +388 -255
  36. package/dist/components/ui/toolbar/toolbar.css +118 -11
  37. package/dist/components/ui/tooltip/index.js +1 -1
  38. package/dist/components/ui/tooltip/index.js.map +4 -4
  39. package/dist/components/ui/tooltip/tooltip.css +119 -21
  40. package/dist/components/ui/tooltip/tooltip.script.d.ts +6 -6
  41. package/dist/components/ui/tree/tree.css +180 -49
  42. package/dist/components/ui/treegrid/treegrid.css +190 -72
  43. package/dist/components/ui/window-splitter/window-splitter.css +144 -31
  44. package/dist/index.js +1 -1
  45. package/dist/index.js.map +4 -4
  46. package/dist/styles/components/button.css +299 -113
  47. package/dist/styles/radiant-ui-core.css +828 -7
  48. package/dist/styles/radiant-ui.css +1497 -8
  49. package/dist/styles/styles.css +5830 -36
  50. package/dist/styles/tailwind.css +1607 -27
  51. package/dist/styles/themes/aurora.css +637 -15
  52. package/dist/styles/themes/default-compact-soft.css +580 -15
  53. package/dist/styles/themes/default.css +641 -2
  54. package/dist/styles/themes/glacier.css +637 -15
  55. package/dist/styles/tokens/colors/aurora.css +1 -73
  56. package/dist/styles/tokens/colors/basalt.css +1 -36
  57. package/dist/styles/tokens/colors/glacier.css +1 -45
  58. package/dist/styles/tokens/colors/palettes.css +1 -3
  59. package/dist/styles/tokens/elevation/default.css +11 -19
  60. package/dist/styles/tokens/elevation/flat.css +11 -19
  61. package/dist/styles/tokens/motion/default.css +6 -17
  62. package/dist/styles/tokens/motion/snappy.css +6 -17
  63. package/dist/styles/tokens/presets/colors/index.css +446 -4
  64. package/dist/styles/tokens/radius/default.css +17 -31
  65. package/dist/styles/tokens/radius/edgy.css +17 -32
  66. package/dist/styles/tokens/radius/sharp.css +20 -2
  67. package/dist/styles/tokens/radius/soft.css +17 -31
  68. package/dist/styles/tokens/semantic.css +445 -79
  69. package/dist/styles/tokens/spacing/compact.css +16 -21
  70. package/dist/styles/tokens/spacing/default.css +16 -21
  71. package/dist/styles/tokens/spacing/scale-bridge.css +1 -17
  72. package/dist/styles/tokens/spacing/wide.css +16 -21
  73. package/dist/styles/tokens/system.css +21 -33
  74. package/dist/styles/tokens/typography/default.css +23 -33
  75. package/package.json +5 -6
@@ -1,16 +1,123 @@
1
- @reference '../../../styles/radiant-ui.css';
2
-
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
3
  rui-toolbar {
4
- @apply block;
4
+ display: block;
5
5
  }
6
-
7
6
  @layer components {
8
- .rui-toolbar {
9
- @apply inline-flex items-center gap-1 rounded-container border border-border bg-surface p-1;
10
- }
11
-
12
- .rui-toolbar .rui-button--ghost[aria-pressed='true'],
7
+ .rui-toolbar {
8
+ display: inline-flex;
9
+ align-items: center;
10
+ gap: var(--spacing-1, var(--space-1));
11
+ border-radius: var(--radius-container, var(--radius-container));
12
+ border-style: var(--tw-border-style);
13
+ border-width: 1px;
14
+ border-color: var(--color-border, var(--border));
15
+ background-color: var(--color-surface, var(--surface));
16
+ padding: var(--spacing-1, var(--space-1));
17
+ }
18
+ .rui-toolbar .rui-button--ghost[aria-pressed='true'],
13
19
  .rui-toolbar .rui-button--outline[aria-pressed='true'] {
14
- @apply bg-background font-medium text-on-background shadow-sm;
15
- }
20
+ background-color: var(--color-background, var(--background));
21
+ --tw-font-weight: var(--font-weight-medium, var(--weight-medium));
22
+ font-weight: var(--font-weight-medium, var(--weight-medium));
23
+ color: var(--color-on-background, var(--on-background));
24
+ --tw-shadow: var(--shadow-control);
25
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
26
+ }
27
+ }
28
+ @property --tw-border-style {
29
+ syntax: "*";
30
+ inherits: false;
31
+ initial-value: solid;
32
+ }
33
+ @property --tw-font-weight {
34
+ syntax: "*";
35
+ inherits: false;
36
+ }
37
+ @property --tw-shadow {
38
+ syntax: "*";
39
+ inherits: false;
40
+ initial-value: 0 0 #0000;
41
+ }
42
+ @property --tw-shadow-color {
43
+ syntax: "*";
44
+ inherits: false;
45
+ }
46
+ @property --tw-shadow-alpha {
47
+ syntax: "<percentage>";
48
+ inherits: false;
49
+ initial-value: 100%;
50
+ }
51
+ @property --tw-inset-shadow {
52
+ syntax: "*";
53
+ inherits: false;
54
+ initial-value: 0 0 #0000;
55
+ }
56
+ @property --tw-inset-shadow-color {
57
+ syntax: "*";
58
+ inherits: false;
59
+ }
60
+ @property --tw-inset-shadow-alpha {
61
+ syntax: "<percentage>";
62
+ inherits: false;
63
+ initial-value: 100%;
64
+ }
65
+ @property --tw-ring-color {
66
+ syntax: "*";
67
+ inherits: false;
68
+ }
69
+ @property --tw-ring-shadow {
70
+ syntax: "*";
71
+ inherits: false;
72
+ initial-value: 0 0 #0000;
73
+ }
74
+ @property --tw-inset-ring-color {
75
+ syntax: "*";
76
+ inherits: false;
77
+ }
78
+ @property --tw-inset-ring-shadow {
79
+ syntax: "*";
80
+ inherits: false;
81
+ initial-value: 0 0 #0000;
82
+ }
83
+ @property --tw-ring-inset {
84
+ syntax: "*";
85
+ inherits: false;
86
+ }
87
+ @property --tw-ring-offset-width {
88
+ syntax: "<length>";
89
+ inherits: false;
90
+ initial-value: 0px;
91
+ }
92
+ @property --tw-ring-offset-color {
93
+ syntax: "*";
94
+ inherits: false;
95
+ initial-value: #fff;
96
+ }
97
+ @property --tw-ring-offset-shadow {
98
+ syntax: "*";
99
+ inherits: false;
100
+ initial-value: 0 0 #0000;
101
+ }
102
+ @layer properties {
103
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
104
+ *, ::before, ::after, ::backdrop {
105
+ --tw-border-style: solid;
106
+ --tw-font-weight: initial;
107
+ --tw-shadow: 0 0 #0000;
108
+ --tw-shadow-color: initial;
109
+ --tw-shadow-alpha: 100%;
110
+ --tw-inset-shadow: 0 0 #0000;
111
+ --tw-inset-shadow-color: initial;
112
+ --tw-inset-shadow-alpha: 100%;
113
+ --tw-ring-color: initial;
114
+ --tw-ring-shadow: 0 0 #0000;
115
+ --tw-inset-ring-color: initial;
116
+ --tw-inset-ring-shadow: 0 0 #0000;
117
+ --tw-ring-inset: initial;
118
+ --tw-ring-offset-width: 0px;
119
+ --tw-ring-offset-color: #fff;
120
+ --tw-ring-offset-shadow: 0 0 #0000;
121
+ }
122
+ }
16
123
  }
@@ -1,2 +1,2 @@
1
- import{RadiantElement as c,bound as n,customElement as h,onEvent as s,onUpdated as T,prop as a,query as m}from"@ecopages/radiant";import{autoUpdate as g,computePosition as R,flip as v,offset as f,shift as E}from"@floating-ui/dom";var r=@h("rui-tooltip")class extends c{@a({type:String,defaultValue:""})content;@a({type:String,defaultValue:"top"})placement;@a({type:Number,defaultValue:200})delay;@m({ref:"tooltip"})tooltipTarget;open=!1;showTimer=null;hideTimer=null;cleanup=null;tooltipId=`rui-tooltip-${Math.random().toString(36).slice(2,9)}`;describedEl=null;connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),queueMicrotask(()=>this.wireTrigger())}disconnectedCallback(){this.clearTimers(),this.teardownFloating(),this.removeEventListener("pointerenter",this.onPointerEnter),this.removeEventListener("pointerleave",this.onPointerLeave),this.describedEl?.removeAttribute("aria-describedby"),super.disconnectedCallback()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null}teardownFloating(){this.cleanup?.(),this.cleanup=null}getAnchor(){return this.querySelector('button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"])')??this}wireTrigger(){this.describedEl?.removeAttribute("aria-describedby"),this.describedEl=this.getAnchor(),this.describedEl.setAttribute("aria-describedby",this.tooltipId)}@n updatePosition(){if(!this.tooltipTarget||!this.open)return;let t=this.getAnchor();R(t,this.tooltipTarget,{placement:this.placement,middleware:[f(8),v(),E({padding:8})]}).then(({x:e,y:o})=>{Object.assign(this.tooltipTarget.style,{left:`${e}px`,top:`${o}px`})})}@T(["content","placement"])onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.updatePosition()}setOpen(t){if(this.clearTimers(),this.open=t,!!this.tooltipTarget)if(this.tooltipTarget.hidden=!t,t){this.teardownFloating();let e=this.getAnchor();this.cleanup=g(e,this.tooltipTarget,this.updatePosition),this.updatePosition()}else this.teardownFloating()}scheduleShow(){if(this.clearTimers(),this.delay<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),this.delay)}scheduleHide(){this.clearTimers(),this.hideTimer=setTimeout(()=>this.setOpen(!1),80)}@s({document:!0,type:"keydown"})onDocumentKeydown(t){!this.open||t.key!=="Escape"||this.setOpen(!1)}@s({type:"focusin",selector:".rui-tooltip__trigger"})onFocusIn(){this.scheduleShow()}@s({type:"focusout",selector:".rui-tooltip__trigger"})onFocusOut(t){let e=t.relatedTarget;e&&this.contains(e)||this.scheduleHide()}@n onPointerEnter(){this.scheduleShow()}@n onPointerLeave(){this.scheduleHide()}render(){return React.createElement("span",{class:"rui-tooltip"},React.createElement("span",{class:"rui-tooltip__trigger"},React.createElement("slot",null)),React.createElement("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content",role:"tooltip",hidden:!0},this.$.content))}};var y=Symbol.for("@ecopages/storybook-radiant.viewElement"),l=Symbol.for("@ecopages/storybook-radiant.scriptModule"),p=Symbol.for("@ecopages/storybook-radiant.scriptExport");function b(i,t){i[y]=t;let e=t[l];e&&(i[l]=e,i[p]=t[p]??t.name)}function d(i,t){let e=(o=>t(o));return b(e,i),e}import"./tooltip.css";var A=d(r,({slot:i,content:t,placement:e,delay:o,children:u})=>React.createElement("rui-tooltip",{slot:i,content:t,placement:e,delay:o},u));export{A as RuiTooltip,r as RuiTooltipElement};
1
+ import{RadiantElement as I,bound as y,customElement as L,onEvent as h,onUpdated as D,prop as c,query as V}from"@ecopages/radiant";var F={top:"bottom",bottom:"top",left:"right",right:"left"},S=8;function C(t){let e=t.indexOf("-");if(e===-1)return{side:t,align:"center"};let o=t.slice(0,e),n=t.slice(e+1);return{side:o,align:n==="start"||n==="end"?n:"center"}}function b(t){return t==="top"||t==="bottom"?"y":"x"}function f(t,e,o,n,i){let{width:r,height:s}=e,l=0,a=0;switch(o){case"top":a=t.top-s-i;break;case"bottom":a=t.bottom+i;break;case"left":l=t.left-r-i;break;case"right":l=t.right+i;break}return b(o)==="y"?n==="start"?l=t.left:n==="end"?l=t.right-r:l=t.left+(t.width-r)/2:n==="start"?a=t.top:n==="end"?a=t.bottom-s:a=t.top+(t.height-s)/2,{x:l,y:a}}function M(t,e,o,n){let{padding:i,width:r,height:s}=n;return o==="top"?Math.max(0,i-t.y):o==="bottom"?Math.max(0,t.y+e.height-(s-i)):o==="left"?Math.max(0,i-t.x):Math.max(0,t.x+e.width-(r-i))}function T(t,e,o,n){let{padding:i,width:r,height:s}=n;return o==="top"?t.top-i-e.height:o==="bottom"?s-i-e.height-t.bottom:o==="left"?t.left-i-e.width:r-i-e.width-t.right}function _(t,e,o,n){let{padding:i,width:r,height:s}=n;if(b(o)==="y"){let a=Math.max(i,r-i-e.width);return{x:Math.min(Math.max(t.x,i),a),y:t.y}}let l=Math.max(i,s-i-e.height);return{x:t.x,y:Math.min(Math.max(t.y,i),l)}}function O(t,e,o,n,i={width:typeof window>"u"?0:window.innerWidth,height:typeof window>"u"?0:window.innerHeight,padding:S}){let{side:r,align:s}=C(o),l=f(t,e,r,s,n),a=M(l,e,r,i),m=r,g=l;if(a>0){let p=F[r],A=f(t,e,p,s,n),P=T(t,e,r,i);T(t,e,p,i)>P&&(m=p,g=A)}return _(g,e,m,i)}function u(t,e,o,n){let i=O(t.getBoundingClientRect(),{width:e.offsetWidth,height:e.offsetHeight},o,n);Object.assign(e.style,{position:"fixed",left:`${i.x}px`,top:`${i.y}px`,right:"auto",bottom:"auto",visibility:"visible"})}function v({anchor:t,floating:e,getPlacement:o,gap:n}){let i=()=>{e.hidden||u(t,e,o(),n)};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);let r=new ResizeObserver(i);return r.observe(t),r.observe(e),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),r.disconnect()}}var w=8,d=@L("rui-tooltip")class extends I{@c({type:String,defaultValue:""})content;@c({type:String,defaultValue:"top"})placement;@c({type:Number,defaultValue:200})delay;@V({ref:"tooltip"})tooltipTarget;open=!1;showTimer=null;hideTimer=null;tooltipId=`rui-tooltip-${Math.random().toString(36).slice(2,9)}`;describedEl=null;cleanupFloating=null;connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.onPointerEnter),this.addEventListener("pointerleave",this.onPointerLeave),queueMicrotask(()=>this.wireTrigger())}disconnectedCallback(){this.clearTimers(),this.teardownFloating(),this.removeEventListener("pointerenter",this.onPointerEnter),this.removeEventListener("pointerleave",this.onPointerLeave),this.describedEl?.removeAttribute("aria-describedby"),super.disconnectedCallback()}clearTimers(){this.showTimer&&clearTimeout(this.showTimer),this.hideTimer&&clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null}teardownFloating(){this.cleanupFloating?.(),this.cleanupFloating=null}getAnchor(){return this.querySelector('button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"])')??this}wireTrigger(){this.describedEl?.removeAttribute("aria-describedby"),this.describedEl=this.getAnchor(),this.describedEl.setAttribute("aria-describedby",this.tooltipId)}attachFloating(){this.tooltipTarget&&(this.teardownFloating(),this.cleanupFloating=v({anchor:this.getAnchor(),floating:this.tooltipTarget,getPlacement:()=>this.placement,gap:w}))}@D(["content","placement"])onDescribedPropsUpdated(){this.wireTrigger(),this.open&&this.tooltipTarget&&u(this.getAnchor(),this.tooltipTarget,this.placement,w)}setOpen(e){this.clearTimers(),this.open=e,this.tooltipTarget&&(this.tooltipTarget.hidden=!e,e?this.attachFloating():this.teardownFloating())}scheduleShow(){if(this.clearTimers(),this.delay<=0){this.setOpen(!0);return}this.showTimer=setTimeout(()=>this.setOpen(!0),this.delay)}scheduleHide(){this.clearTimers(),this.hideTimer=setTimeout(()=>this.setOpen(!1),80)}@h({document:!0,type:"keydown"})onDocumentKeydown(e){!this.open||e.key!=="Escape"||this.setOpen(!1)}@h({type:"focusin",selector:".rui-tooltip__trigger"})onFocusIn(){this.scheduleShow()}@h({type:"focusout",selector:".rui-tooltip__trigger"})onFocusOut(e){let o=e.relatedTarget;o&&this.contains(o)||this.scheduleHide()}@y onPointerEnter(){this.scheduleShow()}@y onPointerLeave(){this.scheduleHide()}render(){return React.createElement("span",{class:"rui-tooltip"},React.createElement("span",{class:"rui-tooltip__trigger"},React.createElement("slot",null)),React.createElement("span",{"data-ref":"tooltip",id:this.tooltipId,class:"rui-tooltip__content rui-floating",role:"tooltip",hidden:!0},this.$.content))}};var k=Symbol.for("@ecopages/storybook-radiant.viewElement"),R=Symbol.for("@ecopages/storybook-radiant.scriptModule"),E=Symbol.for("@ecopages/storybook-radiant.scriptExport");function N(t,e){t[k]=e;let o=e[R];o&&(t[R]=o,t[E]=e[E]??e.name)}function x(t,e){let o=(n=>e(n));return N(o,t),o}import"./tooltip.css";var H=x(d,({slot:t,content:e,placement:o,delay:n,children:i})=>React.createElement("rui-tooltip",{slot:t,content:e,placement:o,delay:n},i));export{H as RuiTooltip,d as RuiTooltipElement};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/components/ui/tooltip/tooltip.script.tsx", "../../../../src/lib/radiant-view.ts", "../../../../src/components/ui/tooltip/tooltip.tsx"],
4
- "sourcesContent": ["import { RadiantElement, bound, customElement, onEvent, onUpdated, prop, query } from '@ecopages/radiant';\nimport { type Placement, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';\n\nexport type RuiTooltipProps = {\n\t/** Accessible description shown in the tooltip. */\n\tcontent?: string;\n\t/** Floating-ui placement. Default: `top`. */\n\tplacement?: Placement;\n\t/** Delay in ms before showing on hover/focus. Default: `200`. */\n\tdelay?: number;\n};\n\ntype RuiTooltipBindings = {\n\tcontent: string;\n};\n\n/**\n * `<rui-tooltip>` \u2014 a popup that describes a trigger on hover or focus.\n *\n * Implements the WAI-ARIA APG Tooltip pattern: the popup has `role=\"tooltip\"`\n * and the focusable trigger references it with `aria-describedby`. The tooltip\n * itself never receives focus.\n *\n * Event wiring:\n * - Bubbling events (`focusin` / `focusout`, document `keydown`) use `@onEvent`.\n * - `pointerenter` / `pointerleave` are bound directly on the host \u2014 they do not\n * bubble, so `@onEvent` delegation cannot see them on the slotted trigger.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n *\n * @element rui-tooltip\n * @slot - The trigger element (typically a button or focusable control).\n */\n@customElement('rui-tooltip')\nexport class RuiTooltip extends RadiantElement<RuiTooltipBindings> {\n\t@prop({ type: String, defaultValue: '' }) content: string;\n\t@prop({ type: String, defaultValue: 'top' }) placement: Placement;\n\t@prop({ type: Number, defaultValue: 200 }) delay: number;\n\n\t@query({ ref: 'tooltip' }) tooltipTarget: HTMLElement;\n\n\t/**\n\t * Plain (non-reactive) field, not a JSX binding target: `hidden` is toggled\n\t * imperatively in `setOpen()` rather than bound, since it flips on every\n\t * hover/focus in/out \u2014 high-frequency enough that a plain synchronous DOM\n\t * write is preferable to routing it through the reactive binding system.\n\t */\n\tprivate open = false;\n\n\tprivate showTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate hideTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate cleanup: ReturnType<typeof autoUpdate> | null = null;\n\tprivate tooltipId = `rui-tooltip-${Math.random().toString(36).slice(2, 9)}`;\n\tprivate describedEl: HTMLElement | null = null;\n\n\t/**\n\t * Pointer enter/leave must be host listeners: those events do not bubble, and\n\t * `@onEvent` only supports delegated (bubbling) listeners.\n\t */\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.addEventListener('pointerenter', this.onPointerEnter);\n\t\tthis.addEventListener('pointerleave', this.onPointerLeave);\n\t\tqueueMicrotask(() => this.wireTrigger());\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.clearTimers();\n\t\tthis.teardownFloating();\n\t\tthis.removeEventListener('pointerenter', this.onPointerEnter);\n\t\tthis.removeEventListener('pointerleave', this.onPointerLeave);\n\t\tthis.describedEl?.removeAttribute('aria-describedby');\n\t\tsuper.disconnectedCallback();\n\t}\n\n\tprivate clearTimers(): void {\n\t\tif (this.showTimer) clearTimeout(this.showTimer);\n\t\tif (this.hideTimer) clearTimeout(this.hideTimer);\n\t\tthis.showTimer = null;\n\t\tthis.hideTimer = null;\n\t}\n\n\tprivate teardownFloating(): void {\n\t\tthis.cleanup?.();\n\t\tthis.cleanup = null;\n\t}\n\n\tprivate getAnchor(): HTMLElement {\n\t\treturn (\n\t\t\t(this.querySelector(\n\t\t\t\t'button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n\t\t\t) as HTMLElement | null) ?? this\n\t\t);\n\t}\n\n\tprivate wireTrigger(): void {\n\t\tthis.describedEl?.removeAttribute('aria-describedby');\n\t\tthis.describedEl = this.getAnchor();\n\t\tthis.describedEl.setAttribute('aria-describedby', this.tooltipId);\n\t}\n\n\t@bound\n\tupdatePosition(): void {\n\t\tif (!this.tooltipTarget || !this.open) return;\n\t\tconst anchor = this.getAnchor();\n\t\tcomputePosition(anchor, this.tooltipTarget, {\n\t\t\tplacement: this.placement,\n\t\t\tmiddleware: [offset(8), flip(), shift({ padding: 8 })],\n\t\t}).then(({ x, y }) => {\n\t\t\tObject.assign(this.tooltipTarget.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t});\n\t\t});\n\t}\n\n\t@onUpdated(['content', 'placement'])\n\tonDescribedPropsUpdated(): void {\n\t\tthis.wireTrigger();\n\t\tif (this.open) this.updatePosition();\n\t}\n\n\tprivate setOpen(next: boolean): void {\n\t\tthis.clearTimers();\n\t\tthis.open = next;\n\t\tif (!this.tooltipTarget) return;\n\t\tthis.tooltipTarget.hidden = !next;\n\n\t\tif (next) {\n\t\t\tthis.teardownFloating();\n\t\t\tconst anchor = this.getAnchor();\n\t\t\tthis.cleanup = autoUpdate(anchor, this.tooltipTarget, this.updatePosition);\n\t\t\tthis.updatePosition();\n\t\t} else {\n\t\t\tthis.teardownFloating();\n\t\t}\n\t}\n\n\tprivate scheduleShow(): void {\n\t\tthis.clearTimers();\n\t\tif (this.delay <= 0) {\n\t\t\tthis.setOpen(true);\n\t\t\treturn;\n\t\t}\n\t\tthis.showTimer = setTimeout(() => this.setOpen(true), this.delay);\n\t}\n\n\tprivate scheduleHide(): void {\n\t\tthis.clearTimers();\n\t\tthis.hideTimer = setTimeout(() => this.setOpen(false), 80);\n\t}\n\n\t@onEvent({ document: true, type: 'keydown' })\n\tonDocumentKeydown(event: KeyboardEvent): void {\n\t\tif (!this.open || event.key !== 'Escape') return;\n\t\tthis.setOpen(false);\n\t}\n\n\t@onEvent({ type: 'focusin', selector: '.rui-tooltip__trigger' })\n\tonFocusIn(): void {\n\t\tthis.scheduleShow();\n\t}\n\n\t@onEvent({ type: 'focusout', selector: '.rui-tooltip__trigger' })\n\tonFocusOut(event: FocusEvent): void {\n\t\tconst next = event.relatedTarget as Node | null;\n\t\tif (next && this.contains(next)) return;\n\t\tthis.scheduleHide();\n\t}\n\n\t@bound\n\tonPointerEnter(): void {\n\t\tthis.scheduleShow();\n\t}\n\n\t@bound\n\tonPointerLeave(): void {\n\t\tthis.scheduleHide();\n\t}\n\n\toverride render() {\n\t\treturn (\n\t\t\t<span class=\"rui-tooltip\">\n\t\t\t\t<span class=\"rui-tooltip__trigger\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</span>\n\t\t\t\t<span data-ref=\"tooltip\" id={this.tooltipId} class=\"rui-tooltip__content\" role=\"tooltip\" hidden>\n\t\t\t\t\t{this.$.content}\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t);\n\t}\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\n\nconst RADIANT_VIEW_ELEMENT = Symbol.for('@ecopages/storybook-radiant.viewElement');\nconst RADIANT_SCRIPT_MODULE = Symbol.for('@ecopages/storybook-radiant.scriptModule');\nconst RADIANT_SCRIPT_EXPORT = Symbol.for('@ecopages/storybook-radiant.scriptExport');\n\nexport type RadiantViewComponent<TArgs = unknown> = ((args: TArgs) => JsxRenderable) & {\n\t[RADIANT_VIEW_ELEMENT]?: CustomElementConstructor;\n\t[RADIANT_SCRIPT_MODULE]?: string;\n\t[RADIANT_SCRIPT_EXPORT]?: string;\n};\n\nfunction linkViewToElement<TArgs>(\n\tview: RadiantViewComponent<TArgs>,\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n): void {\n\tview[RADIANT_VIEW_ELEMENT] = element;\n\n\tconst ssrModule = element[RADIANT_SCRIPT_MODULE];\n\tif (ssrModule) {\n\t\tview[RADIANT_SCRIPT_MODULE] = ssrModule;\n\t\tview[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n\t}\n}\n\n/** Link a JSX view export to its RadiantElement class (same symbols as the Storybook framework). */\nexport function defineRadiantView<TArgs>(\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n\trender: (args: TArgs) => JsxRenderable,\n): RadiantViewComponent<TArgs> {\n\tconst view = ((args: TArgs) => render(args)) as RadiantViewComponent<TArgs>;\n\tlinkViewToElement(view, element);\n\treturn view;\n}\n\n/** Re-copy SSR metadata from the linked element (e.g. after HMR). */\nexport function syncRadiantViewMetadata(view: RadiantViewComponent): void {\n\tconst element = view[RADIANT_VIEW_ELEMENT];\n\tif (element) {\n\t\tlinkViewToElement(view, element);\n\t}\n}\n", "import type { WithChildren, RadiantSlotProps } from '../../../types';\nimport { defineRadiantView } from '../../../lib/radiant-view';\nimport type { RuiTooltipProps } from './tooltip.script';\nimport { RuiTooltip as RuiTooltipElement } from './tooltip.script';\nimport './tooltip.css';\n\nexport const RuiTooltip = defineRadiantView(\n\tRuiTooltipElement,\n\t({ slot, content, placement, delay, children }: WithChildren<RuiTooltipProps & RadiantSlotProps>) => (\n\t\t<rui-tooltip slot={slot} content={content} placement={placement} delay={delay}>\n\t\t\t{children}\n\t\t</rui-tooltip>\n\t),\n);\n"],
5
- "mappings": "AAAA,OAAS,kBAAAA,EAAgB,SAAAC,EAAO,iBAAAC,EAAe,WAAAC,EAAS,aAAAC,EAAW,QAAAC,EAAM,SAAAC,MAAa,oBACtF,OAAyB,cAAAC,EAAY,mBAAAC,EAAiB,QAAAC,EAAM,UAAAC,EAAQ,SAAAC,MAAa,mBAiC1E,IAAMC,EADb,CAACV,EAAc,aAAa,CACrB,cAAyBF,CAAmC,CAClE,CAACK,EAAK,CAAE,KAAM,OAAQ,aAAc,EAAG,CAAC,CAAE,QAC1C,CAACA,EAAK,CAAE,KAAM,OAAQ,aAAc,KAAM,CAAC,CAAE,UAC7C,CAACA,EAAK,CAAE,KAAM,OAAQ,aAAc,GAAI,CAAC,CAAE,MAE3C,CAACC,EAAM,CAAE,IAAK,SAAU,CAAC,CAAE,cAQnB,KAAO,GAEP,UAAkD,KAClD,UAAkD,KAClD,QAAgD,KAChD,UAAY,eAAe,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAG,CAAC,CAAC,GACjE,YAAkC,KAMjC,mBAA0B,CAClC,MAAM,kBAAkB,EACxB,KAAK,iBAAiB,eAAgB,KAAK,cAAc,EACzD,KAAK,iBAAiB,eAAgB,KAAK,cAAc,EACzD,eAAe,IAAM,KAAK,YAAY,CAAC,CACxC,CAES,sBAA6B,CACrC,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,eAAgB,KAAK,cAAc,EAC5D,KAAK,oBAAoB,eAAgB,KAAK,cAAc,EAC5D,KA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3CK,IACHF,EAAKH,CAAqB,EAAIK,EAC9BF,EAAKF,CAAqB,EAAIG,EAAQH,CAAqB,GAAKG,EAAQ,KAE1E,CAGO,SAASE,EACfF,EAIAG,EAC8B,CAC9B,IAAMJ,GAASK,GAAgBD,EAAOC,CAAI,GAC1C,OAAAN,EAAkBC,EAAMC,CAAO,EACxBD,CACR,CCnCA,MAAO,gBAEA,IAAMM,EAAaC,EACzBD,EACA,CAAC,CAAE,KAAAE,EAAM,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,SAAAC,CAAS,IAC5C,oBAAC,eAAY,KAAMJ,EAAM,QAASC,EAAS,UAAWC,EAAW,MAAOC,GACtEC,CACF,CAEF",
6
- "names": ["RadiantElement", "bound", "customElement", "onEvent", "onUpdated", "prop", "query", "autoUpdate", "computePosition", "flip", "offset", "shift", "RuiTooltip", "anchor", "x", "y", "next", "event", "RADIANT_VIEW_ELEMENT", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "linkViewToElement", "view", "element", "ssrModule", "defineRadiantView", "render", "args", "RuiTooltip", "defineRadiantView", "slot", "content", "placement", "delay", "children"]
3
+ "sources": ["../../../../src/components/ui/tooltip/tooltip.script.tsx", "../../../../src/components/ui/shared/floating-position.ts", "../../../../src/lib/radiant-view.ts", "../../../../src/components/ui/tooltip/tooltip.tsx"],
4
+ "sourcesContent": ["import { RadiantElement, bound, customElement, onEvent, onUpdated, prop, query } from '@ecopages/radiant';\nimport { applyFloatingPosition, attachFloating } from '../shared/floating-position';\nimport type { RuiPlacement } from '../shared/placement';\n\nexport type RuiTooltipProps = {\n\t/** Accessible description shown in the tooltip. */\n\tcontent?: string;\n\t/** Placement of the tooltip surface relative to its anchor. Default: `top`. */\n\tplacement?: RuiPlacement;\n\t/** Delay in ms before showing on hover/focus. Default: `200`. */\n\tdelay?: number;\n};\n\ntype RuiTooltipBindings = {\n\tcontent: string;\n};\n\nconst TOOLTIP_GAP = 8;\n\n/**\n * `<rui-tooltip>` \u2014 a popup that describes a trigger on hover or focus.\n *\n * Implements the WAI-ARIA APG Tooltip pattern: the popup has `role=\"tooltip\"`\n * and the focusable trigger references it with `aria-describedby`. The tooltip\n * itself never receives focus.\n *\n * Event wiring:\n * - Bubbling events (`focusin` / `focusout`, document `keydown`) use `@onEvent`.\n * - `pointerenter` / `pointerleave` are bound directly on the host \u2014 they do not\n * bubble, so `@onEvent` delegation cannot see them on the slotted trigger.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n *\n * @element rui-tooltip\n * @slot - The trigger element (typically a button or focusable control).\n */\n@customElement('rui-tooltip')\nexport class RuiTooltip extends RadiantElement<RuiTooltipBindings> {\n\t@prop({ type: String, defaultValue: '' }) content: string;\n\t@prop({ type: String, defaultValue: 'top' }) placement: RuiPlacement;\n\t@prop({ type: Number, defaultValue: 200 }) delay: number;\n\n\t@query({ ref: 'tooltip' }) tooltipTarget: HTMLElement;\n\n\t/**\n\t * Plain (non-reactive) field, not a JSX binding target: `hidden` is toggled\n\t * imperatively in `setOpen()` rather than bound, since it flips on every\n\t * hover/focus in/out \u2014 high-frequency enough that a plain synchronous DOM\n\t * write is preferable to routing it through the reactive binding system.\n\t */\n\tprivate open = false;\n\n\tprivate showTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate hideTimer: ReturnType<typeof setTimeout> | null = null;\n\tprivate tooltipId = `rui-tooltip-${Math.random().toString(36).slice(2, 9)}`;\n\tprivate describedEl: HTMLElement | null = null;\n\tprivate cleanupFloating: (() => void) | null = null;\n\n\t/**\n\t * Pointer enter/leave must be host listeners: those events do not bubble, and\n\t * `@onEvent` only supports delegated (bubbling) listeners.\n\t */\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.addEventListener('pointerenter', this.onPointerEnter);\n\t\tthis.addEventListener('pointerleave', this.onPointerLeave);\n\t\tqueueMicrotask(() => this.wireTrigger());\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.clearTimers();\n\t\tthis.teardownFloating();\n\t\tthis.removeEventListener('pointerenter', this.onPointerEnter);\n\t\tthis.removeEventListener('pointerleave', this.onPointerLeave);\n\t\tthis.describedEl?.removeAttribute('aria-describedby');\n\t\tsuper.disconnectedCallback();\n\t}\n\n\tprivate clearTimers(): void {\n\t\tif (this.showTimer) clearTimeout(this.showTimer);\n\t\tif (this.hideTimer) clearTimeout(this.hideTimer);\n\t\tthis.showTimer = null;\n\t\tthis.hideTimer = null;\n\t}\n\n\tprivate teardownFloating(): void {\n\t\tthis.cleanupFloating?.();\n\t\tthis.cleanupFloating = null;\n\t}\n\n\tprivate getAnchor(): HTMLElement {\n\t\treturn (\n\t\t\t(this.querySelector(\n\t\t\t\t'button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n\t\t\t) as HTMLElement | null) ?? this\n\t\t);\n\t}\n\n\tprivate wireTrigger(): void {\n\t\tthis.describedEl?.removeAttribute('aria-describedby');\n\t\tthis.describedEl = this.getAnchor();\n\t\tthis.describedEl.setAttribute('aria-describedby', this.tooltipId);\n\t}\n\n\tprivate attachFloating(): void {\n\t\tif (!this.tooltipTarget) return;\n\t\tthis.teardownFloating();\n\t\tthis.cleanupFloating = attachFloating({\n\t\t\tanchor: this.getAnchor(),\n\t\t\tfloating: this.tooltipTarget,\n\t\t\tgetPlacement: () => this.placement,\n\t\t\tgap: TOOLTIP_GAP,\n\t\t});\n\t}\n\n\t@onUpdated(['content', 'placement'])\n\tonDescribedPropsUpdated(): void {\n\t\tthis.wireTrigger();\n\t\tif (this.open && this.tooltipTarget) {\n\t\t\tapplyFloatingPosition(this.getAnchor(), this.tooltipTarget, this.placement, TOOLTIP_GAP);\n\t\t}\n\t}\n\n\tprivate setOpen(next: boolean): void {\n\t\tthis.clearTimers();\n\t\tthis.open = next;\n\t\tif (!this.tooltipTarget) return;\n\t\tthis.tooltipTarget.hidden = !next;\n\n\t\tif (next) this.attachFloating();\n\t\telse this.teardownFloating();\n\t}\n\n\tprivate scheduleShow(): void {\n\t\tthis.clearTimers();\n\t\tif (this.delay <= 0) {\n\t\t\tthis.setOpen(true);\n\t\t\treturn;\n\t\t}\n\t\tthis.showTimer = setTimeout(() => this.setOpen(true), this.delay);\n\t}\n\n\tprivate scheduleHide(): void {\n\t\tthis.clearTimers();\n\t\tthis.hideTimer = setTimeout(() => this.setOpen(false), 80);\n\t}\n\n\t@onEvent({ document: true, type: 'keydown' })\n\tonDocumentKeydown(event: KeyboardEvent): void {\n\t\tif (!this.open || event.key !== 'Escape') return;\n\t\tthis.setOpen(false);\n\t}\n\n\t@onEvent({ type: 'focusin', selector: '.rui-tooltip__trigger' })\n\tonFocusIn(): void {\n\t\tthis.scheduleShow();\n\t}\n\n\t@onEvent({ type: 'focusout', selector: '.rui-tooltip__trigger' })\n\tonFocusOut(event: FocusEvent): void {\n\t\tconst next = event.relatedTarget as Node | null;\n\t\tif (next && this.contains(next)) return;\n\t\tthis.scheduleHide();\n\t}\n\n\t@bound\n\tonPointerEnter(): void {\n\t\tthis.scheduleShow();\n\t}\n\n\t@bound\n\tonPointerLeave(): void {\n\t\tthis.scheduleHide();\n\t}\n\n\toverride render() {\n\t\treturn (\n\t\t\t<span class=\"rui-tooltip\">\n\t\t\t\t<span class=\"rui-tooltip__trigger\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\tdata-ref=\"tooltip\"\n\t\t\t\t\tid={this.tooltipId}\n\t\t\t\t\tclass=\"rui-tooltip__content rui-floating\"\n\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\thidden\n\t\t\t\t>\n\t\t\t\t\t{this.$.content}\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t);\n\t}\n}\n", "import type { RuiPlacement } from './placement';\n\ntype Side = 'top' | 'right' | 'bottom' | 'left';\ntype Align = 'start' | 'center' | 'end';\n\nexport type FloatingSize = { width: number; height: number };\nexport type FloatingCoords = { x: number; y: number };\nexport type FloatingViewport = { width: number; height: number; padding: number };\n\nconst OPPOSITE: Record<Side, Side> = {\n\ttop: 'bottom',\n\tbottom: 'top',\n\tleft: 'right',\n\tright: 'left',\n};\n\nconst DEFAULT_VIEWPORT_PADDING = 8;\n\nfunction parsePlacement(placement: RuiPlacement): { side: Side; align: Align } {\n\tconst dash = placement.indexOf('-');\n\tif (dash === -1) return { side: placement as Side, align: 'center' };\n\tconst side = placement.slice(0, dash) as Side;\n\tconst align = placement.slice(dash + 1);\n\treturn { side, align: align === 'start' || align === 'end' ? align : 'center' };\n}\n\nfunction primaryAxis(side: Side): 'x' | 'y' {\n\treturn side === 'top' || side === 'bottom' ? 'y' : 'x';\n}\n\nfunction coordsFor(anchor: DOMRect, size: FloatingSize, side: Side, align: Align, gap: number): FloatingCoords {\n\tconst { width, height } = size;\n\tlet x = 0;\n\tlet y = 0;\n\n\tswitch (side) {\n\t\tcase 'top':\n\t\t\ty = anchor.top - height - gap;\n\t\t\tbreak;\n\t\tcase 'bottom':\n\t\t\ty = anchor.bottom + gap;\n\t\t\tbreak;\n\t\tcase 'left':\n\t\t\tx = anchor.left - width - gap;\n\t\t\tbreak;\n\t\tcase 'right':\n\t\t\tx = anchor.right + gap;\n\t\t\tbreak;\n\t}\n\n\tif (primaryAxis(side) === 'y') {\n\t\tif (align === 'start') x = anchor.left;\n\t\telse if (align === 'end') x = anchor.right - width;\n\t\telse x = anchor.left + (anchor.width - width) / 2;\n\t} else {\n\t\tif (align === 'start') y = anchor.top;\n\t\telse if (align === 'end') y = anchor.bottom - height;\n\t\telse y = anchor.top + (anchor.height - height) / 2;\n\t}\n\n\treturn { x, y };\n}\n\nfunction overflowOnPrimary(coords: FloatingCoords, size: FloatingSize, side: Side, viewport: FloatingViewport): number {\n\tconst { padding, width: vw, height: vh } = viewport;\n\tif (side === 'top') return Math.max(0, padding - coords.y);\n\tif (side === 'bottom') return Math.max(0, coords.y + size.height - (vh - padding));\n\tif (side === 'left') return Math.max(0, padding - coords.x);\n\treturn Math.max(0, coords.x + size.width - (vw - padding));\n}\n\nfunction freeSpaceOnSide(anchor: DOMRect, size: FloatingSize, side: Side, viewport: FloatingViewport): number {\n\tconst { padding, width: vw, height: vh } = viewport;\n\tif (side === 'top') return anchor.top - padding - size.height;\n\tif (side === 'bottom') return vh - padding - size.height - anchor.bottom;\n\tif (side === 'left') return anchor.left - padding - size.width;\n\treturn vw - padding - size.width - anchor.right;\n}\n\nfunction clampCrossAxis(\n\tcoords: FloatingCoords,\n\tsize: FloatingSize,\n\tside: Side,\n\tviewport: FloatingViewport,\n): FloatingCoords {\n\tconst { padding, width: vw, height: vh } = viewport;\n\tif (primaryAxis(side) === 'y') {\n\t\tconst maxX = Math.max(padding, vw - padding - size.width);\n\t\treturn { x: Math.min(Math.max(coords.x, padding), maxX), y: coords.y };\n\t}\n\tconst maxY = Math.max(padding, vh - padding - size.height);\n\treturn { x: coords.x, y: Math.min(Math.max(coords.y, padding), maxY) };\n}\n\n/**\n * Computes fixed-position coords for a floating surface.\n *\n * @remarks\n * Prefers `placement`, then flips on the primary axis when the opposite side\n * has more free space. Clamps only the cross-axis so the floating surface\n * never slides onto its anchor.\n */\nexport function computeFloatingCoords(\n\tanchor: DOMRect,\n\tsize: FloatingSize,\n\tplacement: RuiPlacement,\n\tgap: number,\n\tviewport: FloatingViewport = {\n\t\twidth: typeof window === 'undefined' ? 0 : window.innerWidth,\n\t\theight: typeof window === 'undefined' ? 0 : window.innerHeight,\n\t\tpadding: DEFAULT_VIEWPORT_PADDING,\n\t},\n): FloatingCoords {\n\tconst { side: preferred, align } = parsePlacement(placement);\n\tconst preferredCoords = coordsFor(anchor, size, preferred, align, gap);\n\tconst preferredOverflow = overflowOnPrimary(preferredCoords, size, preferred, viewport);\n\n\tlet side = preferred;\n\tlet coords = preferredCoords;\n\n\tif (preferredOverflow > 0) {\n\t\tconst flipped = OPPOSITE[preferred];\n\t\tconst flippedCoords = coordsFor(anchor, size, flipped, align, gap);\n\t\tconst preferredFree = freeSpaceOnSide(anchor, size, preferred, viewport);\n\t\tconst flippedFree = freeSpaceOnSide(anchor, size, flipped, viewport);\n\t\tif (flippedFree > preferredFree) {\n\t\t\tside = flipped;\n\t\t\tcoords = flippedCoords;\n\t\t}\n\t}\n\n\treturn clampCrossAxis(coords, size, side, viewport);\n}\n\n/** Applies fixed coords to a floating element. */\nexport function applyFloatingPosition(\n\tanchor: HTMLElement,\n\tfloating: HTMLElement,\n\tplacement: RuiPlacement,\n\tgap: number,\n): void {\n\tconst coords = computeFloatingCoords(\n\t\tanchor.getBoundingClientRect(),\n\t\t{ width: floating.offsetWidth, height: floating.offsetHeight },\n\t\tplacement,\n\t\tgap,\n\t);\n\tObject.assign(floating.style, {\n\t\tposition: 'fixed',\n\t\tleft: `${coords.x}px`,\n\t\ttop: `${coords.y}px`,\n\t\tright: 'auto',\n\t\tbottom: 'auto',\n\t\tvisibility: 'visible',\n\t});\n}\n\nexport type AttachFloatingOptions = {\n\tanchor: HTMLElement;\n\tfloating: HTMLElement;\n\tgetPlacement: () => RuiPlacement;\n\tgap: number;\n};\n\n/**\n * Positions on attach and keeps the floating element updated on scroll/resize.\n *\n * @returns Cleanup that removes listeners and observers.\n */\nexport function attachFloating({ anchor, floating, getPlacement, gap }: AttachFloatingOptions): () => void {\n\tconst update = (): void => {\n\t\tif (floating.hidden) return;\n\t\tapplyFloatingPosition(anchor, floating, getPlacement(), gap);\n\t};\n\n\tupdate();\n\n\twindow.addEventListener('resize', update);\n\twindow.addEventListener('scroll', update, true);\n\n\tconst observer = new ResizeObserver(update);\n\tobserver.observe(anchor);\n\tobserver.observe(floating);\n\n\treturn () => {\n\t\twindow.removeEventListener('resize', update);\n\t\twindow.removeEventListener('scroll', update, true);\n\t\tobserver.disconnect();\n\t};\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\n\nconst RADIANT_VIEW_ELEMENT = Symbol.for('@ecopages/storybook-radiant.viewElement');\nconst RADIANT_SCRIPT_MODULE = Symbol.for('@ecopages/storybook-radiant.scriptModule');\nconst RADIANT_SCRIPT_EXPORT = Symbol.for('@ecopages/storybook-radiant.scriptExport');\n\nexport type RadiantViewComponent<TArgs = unknown> = ((args: TArgs) => JsxRenderable) & {\n\t[RADIANT_VIEW_ELEMENT]?: CustomElementConstructor;\n\t[RADIANT_SCRIPT_MODULE]?: string;\n\t[RADIANT_SCRIPT_EXPORT]?: string;\n};\n\nfunction linkViewToElement<TArgs>(\n\tview: RadiantViewComponent<TArgs>,\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n): void {\n\tview[RADIANT_VIEW_ELEMENT] = element;\n\n\tconst ssrModule = element[RADIANT_SCRIPT_MODULE];\n\tif (ssrModule) {\n\t\tview[RADIANT_SCRIPT_MODULE] = ssrModule;\n\t\tview[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n\t}\n}\n\n/** Link a JSX view export to its RadiantElement class (same symbols as the Storybook framework). */\nexport function defineRadiantView<TArgs>(\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n\trender: (args: TArgs) => JsxRenderable,\n): RadiantViewComponent<TArgs> {\n\tconst view = ((args: TArgs) => render(args)) as RadiantViewComponent<TArgs>;\n\tlinkViewToElement(view, element);\n\treturn view;\n}\n\n/** Re-copy SSR metadata from the linked element (e.g. after HMR). */\nexport function syncRadiantViewMetadata(view: RadiantViewComponent): void {\n\tconst element = view[RADIANT_VIEW_ELEMENT];\n\tif (element) {\n\t\tlinkViewToElement(view, element);\n\t}\n}\n", "import type { WithChildren, RadiantSlotProps } from '../../../types';\nimport { defineRadiantView } from '../../../lib/radiant-view';\nimport type { RuiTooltipProps } from './tooltip.script';\nimport { RuiTooltip as RuiTooltipElement } from './tooltip.script';\nimport './tooltip.css';\n\nexport const RuiTooltip = defineRadiantView(\n\tRuiTooltipElement,\n\t({ slot, content, placement, delay, children }: WithChildren<RuiTooltipProps & RadiantSlotProps>) => (\n\t\t<rui-tooltip slot={slot} content={content} placement={placement} delay={delay}>\n\t\t\t{children}\n\t\t</rui-tooltip>\n\t),\n);\n"],
5
+ "mappings": "AAAA,OAAS,kBAAAA,EAAgB,SAAAC,EAAO,iBAAAC,EAAe,WAAAC,EAAS,aAAAC,EAAW,QAAAC,EAAM,SAAAC,MAAa,oBCStF,IAAMC,EAA+B,CACpC,IAAK,SACL,OAAQ,MACR,KAAM,QACN,MAAO,MACR,EAEMC,EAA2B,EAEjC,SAASC,EAAeC,EAAuD,CAC9E,IAAMC,EAAOD,EAAU,QAAQ,GAAG,EAClC,GAAIC,IAAS,GAAI,MAAO,CAAE,KAAMD,EAAmB,MAAO,QAAS,EACnE,IAAME,EAAOF,EAAU,MAAM,EAAGC,CAAI,EAC9BE,EAAQH,EAAU,MAAMC,EAAO,CAAC,EACtC,MAAO,CAAE,KAAAC,EAAM,MAAOC,IAAU,SAAWA,IAAU,MAAQA,EAAQ,QAAS,CAC/E,CAEA,SAASC,EAAYF,EAAuB,CAC3C,OAAOA,IAAS,OAASA,IAAS,SAAW,IAAM,GACpD,CAEA,SAASG,EAAUC,EAAiBC,EAAoBL,EAAYC,EAAcK,EAA6B,CAC9G,GAAM,CAAE,MAAAC,EAAO,OAAAC,CAAO,EAAIH,EACtBI,EAAI,EACJC,EAAI,EAER,OAAQV,EAAM,CACb,IAAK,MACJU,EAAIN,EAAO,IAAMI,EAASF,EAC1B,MACD,IAAK,SACJI,EAAIN,EAAO,OAASE,EACpB,MACD,IAAK,OACJG,EAAIL,EAAO,KAAOG,EAAQD,EAC1B,MACD,IAAK,QACJG,EAAIL,EAAO,MAAQE,EACnB,KACF,CAEA,OAAIJ,EAAYF,CAAI,IAAM,IACrBC,IAAU,QAASQ,EAAIL,EAAO,KACzBH,IAAU,MAAOQ,EAAIL,EAAO,MAAQG,EACxCE,EAAIL,EAAO,MAAQA,EAAO,MAAQG,GAAS,EA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AMJ,EAAM,QAASC,EAAS,UAAWC,EAAW,MAAOC,GACtEC,CACF,CAEF",
6
+ "names": ["RadiantElement", "bound", "customElement", "onEvent", "onUpdated", "prop", "query", "OPPOSITE", "DEFAULT_VIEWPORT_PADDING", "parsePlacement", "placement", "dash", "side", "align", "primaryAxis", "coordsFor", "anchor", "size", "gap", "width", "height", "x", "y", "overflowOnPrimary", "coords", "viewport", "padding", "vw", "vh", "freeSpaceOnSide", "clampCrossAxis", "maxX", "maxY", "computeFloatingCoords", "preferred", "preferredCoords", "preferredOverflow", "flipped", "flippedCoords", "preferredFree", "applyFloatingPosition", "floating", "attachFloating", "getPlacement", "update", "observer", "TOOLTIP_GAP", "RuiTooltip", "customElement", "RadiantElement", "prop", "query", "attachFloating", "onUpdated", "applyFloatingPosition", "next", "onEvent", "event", "bound", "RADIANT_VIEW_ELEMENT", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "linkViewToElement", "view", "element", "ssrModule", "defineRadiantView", "render", "args", "RuiTooltip", "defineRadiantView", "slot", "content", "placement", "delay", "children"]
7
7
  }
@@ -1,25 +1,123 @@
1
- @reference '../../../styles/radiant-ui.css';
2
-
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer properties;
3
+ @layer components {
4
+ .rui-floating {
5
+ position: fixed;
6
+ visibility: hidden;
7
+ }
8
+ }
3
9
  rui-tooltip {
4
- @apply inline-flex;
10
+ display: inline-flex;
5
11
  }
6
-
7
12
  @layer components {
8
- .rui-tooltip {
9
- @apply relative inline-flex;
10
- }
11
-
12
- .rui-tooltip__trigger {
13
- @apply inline-flex;
14
- }
15
-
16
- .rui-tooltip__content {
17
- @apply absolute z-overlay max-w-xs rounded-container bg-on-background px-2 py-1 text-xs text-background shadow-md;
18
- width: max-content;
19
- pointer-events: none;
20
- }
21
-
22
- .rui-tooltip__content[hidden] {
23
- display: none;
24
- }
13
+ .rui-tooltip {
14
+ position: relative;
15
+ display: inline-flex;
16
+ }
17
+ .rui-tooltip__trigger {
18
+ display: inline-flex;
19
+ }
20
+ .rui-tooltip__content {
21
+ z-index: var(--z-index-overlay, var(--z-overlay));
22
+ max-width: var(--container-xs, 20rem);
23
+ border-radius: var(--radius-container, var(--radius-container));
24
+ background-color: var(--color-on-background, var(--on-background));
25
+ padding-inline: var(--spacing-2, var(--space-2));
26
+ padding-block: var(--spacing-1, var(--space-1));
27
+ font-size: var(--text-xs, var(--text-xs));
28
+ line-height: var(--tw-leading, var(--text-xs--line-height, calc(1 / 0.75)));
29
+ color: var(--color-background, var(--background));
30
+ --tw-shadow: var(--shadow-overlay);
31
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
32
+ width: max-content;
33
+ pointer-events: none;
34
+ }
35
+ .rui-tooltip__content[hidden] {
36
+ display: none;
37
+ }
38
+ }
39
+ @property --tw-shadow {
40
+ syntax: "*";
41
+ inherits: false;
42
+ initial-value: 0 0 #0000;
43
+ }
44
+ @property --tw-shadow-color {
45
+ syntax: "*";
46
+ inherits: false;
47
+ }
48
+ @property --tw-shadow-alpha {
49
+ syntax: "<percentage>";
50
+ inherits: false;
51
+ initial-value: 100%;
52
+ }
53
+ @property --tw-inset-shadow {
54
+ syntax: "*";
55
+ inherits: false;
56
+ initial-value: 0 0 #0000;
57
+ }
58
+ @property --tw-inset-shadow-color {
59
+ syntax: "*";
60
+ inherits: false;
61
+ }
62
+ @property --tw-inset-shadow-alpha {
63
+ syntax: "<percentage>";
64
+ inherits: false;
65
+ initial-value: 100%;
66
+ }
67
+ @property --tw-ring-color {
68
+ syntax: "*";
69
+ inherits: false;
70
+ }
71
+ @property --tw-ring-shadow {
72
+ syntax: "*";
73
+ inherits: false;
74
+ initial-value: 0 0 #0000;
75
+ }
76
+ @property --tw-inset-ring-color {
77
+ syntax: "*";
78
+ inherits: false;
79
+ }
80
+ @property --tw-inset-ring-shadow {
81
+ syntax: "*";
82
+ inherits: false;
83
+ initial-value: 0 0 #0000;
84
+ }
85
+ @property --tw-ring-inset {
86
+ syntax: "*";
87
+ inherits: false;
88
+ }
89
+ @property --tw-ring-offset-width {
90
+ syntax: "<length>";
91
+ inherits: false;
92
+ initial-value: 0px;
93
+ }
94
+ @property --tw-ring-offset-color {
95
+ syntax: "*";
96
+ inherits: false;
97
+ initial-value: #fff;
98
+ }
99
+ @property --tw-ring-offset-shadow {
100
+ syntax: "*";
101
+ inherits: false;
102
+ initial-value: 0 0 #0000;
103
+ }
104
+ @layer properties {
105
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
106
+ *, ::before, ::after, ::backdrop {
107
+ --tw-shadow: 0 0 #0000;
108
+ --tw-shadow-color: initial;
109
+ --tw-shadow-alpha: 100%;
110
+ --tw-inset-shadow: 0 0 #0000;
111
+ --tw-inset-shadow-color: initial;
112
+ --tw-inset-shadow-alpha: 100%;
113
+ --tw-ring-color: initial;
114
+ --tw-ring-shadow: 0 0 #0000;
115
+ --tw-inset-ring-color: initial;
116
+ --tw-inset-ring-shadow: 0 0 #0000;
117
+ --tw-ring-inset: initial;
118
+ --tw-ring-offset-width: 0px;
119
+ --tw-ring-offset-color: #fff;
120
+ --tw-ring-offset-shadow: 0 0 #0000;
121
+ }
122
+ }
25
123
  }
@@ -1,10 +1,10 @@
1
1
  import { RadiantElement } from '@ecopages/radiant';
2
- import { type Placement } from '@floating-ui/dom';
2
+ import type { RuiPlacement } from '../shared/placement';
3
3
  export type RuiTooltipProps = {
4
4
  /** Accessible description shown in the tooltip. */
5
5
  content?: string;
6
- /** Floating-ui placement. Default: `top`. */
7
- placement?: Placement;
6
+ /** Placement of the tooltip surface relative to its anchor. Default: `top`. */
7
+ placement?: RuiPlacement;
8
8
  /** Delay in ms before showing on hover/focus. Default: `200`. */
9
9
  delay?: number;
10
10
  };
@@ -30,7 +30,7 @@ type RuiTooltipBindings = {
30
30
  */
31
31
  export declare class RuiTooltip extends RadiantElement<RuiTooltipBindings> {
32
32
  content: string;
33
- placement: Placement;
33
+ placement: RuiPlacement;
34
34
  delay: number;
35
35
  tooltipTarget: HTMLElement;
36
36
  /**
@@ -42,9 +42,9 @@ export declare class RuiTooltip extends RadiantElement<RuiTooltipBindings> {
42
42
  private open;
43
43
  private showTimer;
44
44
  private hideTimer;
45
- private cleanup;
46
45
  private tooltipId;
47
46
  private describedEl;
47
+ private cleanupFloating;
48
48
  /**
49
49
  * Pointer enter/leave must be host listeners: those events do not bubble, and
50
50
  * `@onEvent` only supports delegated (bubbling) listeners.
@@ -55,7 +55,7 @@ export declare class RuiTooltip extends RadiantElement<RuiTooltipBindings> {
55
55
  private teardownFloating;
56
56
  private getAnchor;
57
57
  private wireTrigger;
58
- updatePosition(): void;
58
+ private attachFloating;
59
59
  onDescribedPropsUpdated(): void;
60
60
  private setOpen;
61
61
  private scheduleShow;