@easemate/web-kit 0.2.0 → 0.3.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.
- package/build/decorators.cjs +921 -0
- package/build/decorators.cjs.map +1 -0
- package/build/decorators.d.cts +123 -0
- package/build/decorators.d.ts +123 -0
- package/build/decorators.js +889 -0
- package/build/decorators.js.map +1 -0
- package/build/elements.cjs +27604 -0
- package/build/elements.cjs.map +1 -0
- package/build/elements.d.cts +373 -0
- package/build/elements.d.ts +373 -0
- package/build/elements.js +27528 -0
- package/build/elements.js.map +1 -0
- package/build/{elements/monitor/index.d.ts → index-31iOHBv0.d.cts} +26 -5
- package/build/{elements/monitor/index.d.cts → index-31iOHBv0.d.ts} +26 -5
- package/build/{elements/panel/index.d.cts → index-NzGpn7ai.d.cts} +6 -3
- package/build/{elements/panel/index.d.ts → index-NzGpn7ai.d.ts} +6 -3
- package/build/{elements/state/index.d.ts → index-qZoNKsHn.d.cts} +46 -5
- package/build/{elements/state/index.d.cts → index-qZoNKsHn.d.ts} +46 -5
- package/build/index.cjs +38651 -38
- package/build/index.cjs.map +1 -0
- package/build/index.d.cts +85 -6
- package/build/index.d.ts +85 -6
- package/build/index.js +38535 -12
- package/build/index.js.map +1 -0
- package/build/init-B7gNNyTd.d.ts +235 -0
- package/build/init-DwVGVxkx.d.cts +235 -0
- package/build/jsx.cjs +31 -0
- package/build/jsx.cjs.map +1 -0
- package/build/jsx.d.cts +317 -0
- package/build/jsx.d.ts +317 -0
- package/build/jsx.js +6 -0
- package/build/jsx.js.map +1 -0
- package/build/outside-click-rZ3Di_WX.d.cts +16 -0
- package/build/outside-click-rZ3Di_WX.d.ts +16 -0
- package/build/react.cjs +37827 -0
- package/build/react.cjs.map +1 -0
- package/build/react.d.cts +356 -0
- package/build/react.d.ts +356 -0
- package/build/react.js +37802 -0
- package/build/react.js.map +1 -0
- package/build/register.cjs +35832 -36
- package/build/register.cjs.map +1 -0
- package/build/register.d.cts +4 -33
- package/build/register.d.ts +4 -33
- package/build/register.js +35831 -35
- package/build/register.js.map +1 -0
- package/build/register.server.cjs +19 -0
- package/build/register.server.cjs.map +1 -0
- package/build/register.server.d.cts +2 -0
- package/build/register.server.d.ts +2 -0
- package/build/register.server.js +1 -0
- package/build/register.server.js.map +1 -0
- package/build/registry-9GX9KTG1.d.cts +264 -0
- package/build/registry-9GX9KTG1.d.ts +264 -0
- package/build/template-helpers-CguLXtLD.d.cts +10 -0
- package/build/template-helpers-CguLXtLD.d.ts +10 -0
- package/build/theme.cjs +746 -0
- package/build/theme.cjs.map +1 -0
- package/build/{theme/index.d.cts → theme.d.cts} +41 -21
- package/build/{theme/index.d.ts → theme.d.ts} +41 -21
- package/build/theme.js +692 -0
- package/build/theme.js.map +1 -0
- package/build/utils.cjs +205 -0
- package/build/utils.cjs.map +1 -0
- package/build/utils.d.cts +26 -0
- package/build/utils.d.ts +26 -0
- package/build/utils.js +167 -0
- package/build/utils.js.map +1 -0
- package/package.json +47 -33
- package/build/components/code/index.cjs +0 -152
- package/build/components/code/index.d.cts +0 -11
- package/build/components/code/index.d.ts +0 -11
- package/build/components/code/index.js +0 -148
- package/build/components/code/utils/highlight-api.cjs +0 -18
- package/build/components/code/utils/highlight-api.d.cts +0 -7
- package/build/components/code/utils/highlight-api.d.ts +0 -7
- package/build/components/code/utils/highlight-api.js +0 -14
- package/build/components/code/utils/syntax-grammars.cjs +0 -62
- package/build/components/code/utils/syntax-grammars.d.cts +0 -7
- package/build/components/code/utils/syntax-grammars.d.ts +0 -7
- package/build/components/code/utils/syntax-grammars.js +0 -59
- package/build/components/code/utils/syntax-highlighter-theme.cjs +0 -27
- package/build/components/code/utils/syntax-highlighter-theme.d.cts +0 -3
- package/build/components/code/utils/syntax-highlighter-theme.d.ts +0 -3
- package/build/components/code/utils/syntax-highlighter-theme.js +0 -23
- package/build/components/code/utils/syntax-highlighter-types.cjs +0 -2
- package/build/components/code/utils/syntax-highlighter-types.d.cts +0 -12
- package/build/components/code/utils/syntax-highlighter-types.d.ts +0 -12
- package/build/components/code/utils/syntax-highlighter-types.js +0 -1
- package/build/components/code/utils/syntax-tokenizer.cjs +0 -63
- package/build/components/code/utils/syntax-tokenizer.d.cts +0 -3
- package/build/components/code/utils/syntax-tokenizer.d.ts +0 -3
- package/build/components/code/utils/syntax-tokenizer.js +0 -58
- package/build/components/curve/bezier-conversion.cjs +0 -23
- package/build/components/curve/bezier-conversion.d.cts +0 -2
- package/build/components/curve/bezier-conversion.d.ts +0 -2
- package/build/components/curve/bezier-conversion.js +0 -19
- package/build/components/curve/canvas-controls.cjs +0 -300
- package/build/components/curve/canvas-controls.d.cts +0 -12
- package/build/components/curve/canvas-controls.d.ts +0 -12
- package/build/components/curve/canvas-controls.js +0 -296
- package/build/components/curve/canvas.cjs +0 -1208
- package/build/components/curve/canvas.d.cts +0 -24
- package/build/components/curve/canvas.d.ts +0 -24
- package/build/components/curve/canvas.js +0 -1204
- package/build/components/curve/constants.cjs +0 -203
- package/build/components/curve/constants.d.cts +0 -23
- package/build/components/curve/constants.d.ts +0 -23
- package/build/components/curve/constants.js +0 -200
- package/build/components/curve/controls.cjs +0 -942
- package/build/components/curve/controls.d.cts +0 -37
- package/build/components/curve/controls.d.ts +0 -37
- package/build/components/curve/controls.js +0 -938
- package/build/components/curve/index.cjs +0 -335
- package/build/components/curve/index.d.cts +0 -31
- package/build/components/curve/index.d.ts +0 -31
- package/build/components/curve/index.js +0 -330
- package/build/components/curve/output.cjs +0 -141
- package/build/components/curve/output.d.cts +0 -19
- package/build/components/curve/output.d.ts +0 -19
- package/build/components/curve/output.js +0 -137
- package/build/components/curve/styles.cjs +0 -493
- package/build/components/curve/styles.d.cts +0 -6
- package/build/components/curve/styles.d.ts +0 -6
- package/build/components/curve/styles.js +0 -490
- package/build/components/curve/svg-renderer.cjs +0 -185
- package/build/components/curve/svg-renderer.d.cts +0 -9
- package/build/components/curve/svg-renderer.d.ts +0 -9
- package/build/components/curve/svg-renderer.js +0 -175
- package/build/components/curve/toolbar.cjs +0 -368
- package/build/components/curve/toolbar.d.cts +0 -26
- package/build/components/curve/toolbar.d.ts +0 -26
- package/build/components/curve/toolbar.js +0 -364
- package/build/components/curve/types.cjs +0 -10
- package/build/components/curve/types.d.cts +0 -33
- package/build/components/curve/types.d.ts +0 -33
- package/build/components/curve/types.js +0 -7
- package/build/components/curve/utils.cjs +0 -541
- package/build/components/curve/utils.d.cts +0 -33
- package/build/components/curve/utils.d.ts +0 -33
- package/build/components/curve/utils.js +0 -521
- package/build/components/index.cjs +0 -18
- package/build/components/index.d.cts +0 -2
- package/build/components/index.d.ts +0 -2
- package/build/components/index.js +0 -2
- package/build/decorators/Component.cjs +0 -127
- package/build/decorators/Component.d.cts +0 -28
- package/build/decorators/Component.d.ts +0 -28
- package/build/decorators/Component.js +0 -123
- package/build/decorators/Listen.cjs +0 -154
- package/build/decorators/Listen.d.cts +0 -18
- package/build/decorators/Listen.d.ts +0 -18
- package/build/decorators/Listen.js +0 -151
- package/build/decorators/OutsideClick.cjs +0 -64
- package/build/decorators/OutsideClick.d.cts +0 -16
- package/build/decorators/OutsideClick.d.ts +0 -16
- package/build/decorators/OutsideClick.js +0 -59
- package/build/decorators/Prop.cjs +0 -273
- package/build/decorators/Prop.d.cts +0 -22
- package/build/decorators/Prop.d.ts +0 -22
- package/build/decorators/Prop.js +0 -270
- package/build/decorators/Query.cjs +0 -79
- package/build/decorators/Query.d.cts +0 -27
- package/build/decorators/Query.d.ts +0 -27
- package/build/decorators/Query.js +0 -76
- package/build/decorators/Watch.cjs +0 -52
- package/build/decorators/Watch.d.cts +0 -11
- package/build/decorators/Watch.d.ts +0 -11
- package/build/decorators/Watch.js +0 -49
- package/build/decorators/index.cjs +0 -15
- package/build/decorators/index.d.cts +0 -6
- package/build/decorators/index.d.ts +0 -6
- package/build/decorators/index.js +0 -6
- package/build/elements/button/index.cjs +0 -214
- package/build/elements/button/index.d.cts +0 -11
- package/build/elements/button/index.d.ts +0 -11
- package/build/elements/button/index.js +0 -210
- package/build/elements/checkbox/index.cjs +0 -316
- package/build/elements/checkbox/index.d.cts +0 -14
- package/build/elements/checkbox/index.d.ts +0 -14
- package/build/elements/checkbox/index.js +0 -312
- package/build/elements/color/index.cjs +0 -154
- package/build/elements/color/index.d.cts +0 -18
- package/build/elements/color/index.d.ts +0 -18
- package/build/elements/color/index.js +0 -150
- package/build/elements/color/picker.cjs +0 -544
- package/build/elements/color/picker.d.cts +0 -37
- package/build/elements/color/picker.d.ts +0 -37
- package/build/elements/color/picker.js +0 -540
- package/build/elements/color/utils.cjs +0 -235
- package/build/elements/color/utils.d.cts +0 -37
- package/build/elements/color/utils.d.ts +0 -37
- package/build/elements/color/utils.js +0 -218
- package/build/elements/dropdown/index.cjs +0 -875
- package/build/elements/dropdown/index.d.cts +0 -30
- package/build/elements/dropdown/index.d.ts +0 -30
- package/build/elements/dropdown/index.js +0 -871
- package/build/elements/field/index.cjs +0 -82
- package/build/elements/field/index.d.cts +0 -4
- package/build/elements/field/index.d.ts +0 -4
- package/build/elements/field/index.js +0 -78
- package/build/elements/icons/animation/chevron.cjs +0 -57
- package/build/elements/icons/animation/chevron.d.cts +0 -10
- package/build/elements/icons/animation/chevron.d.ts +0 -10
- package/build/elements/icons/animation/chevron.js +0 -53
- package/build/elements/icons/animation/clear.cjs +0 -74
- package/build/elements/icons/animation/clear.d.cts +0 -3
- package/build/elements/icons/animation/clear.d.ts +0 -3
- package/build/elements/icons/animation/clear.js +0 -70
- package/build/elements/icons/animation/grid.cjs +0 -77
- package/build/elements/icons/animation/grid.d.cts +0 -8
- package/build/elements/icons/animation/grid.d.ts +0 -8
- package/build/elements/icons/animation/grid.js +0 -73
- package/build/elements/icons/animation/loading.cjs +0 -68
- package/build/elements/icons/animation/loading.d.cts +0 -3
- package/build/elements/icons/animation/loading.d.ts +0 -3
- package/build/elements/icons/animation/loading.js +0 -64
- package/build/elements/icons/animation/snap.cjs +0 -133
- package/build/elements/icons/animation/snap.d.cts +0 -8
- package/build/elements/icons/animation/snap.d.ts +0 -8
- package/build/elements/icons/animation/snap.js +0 -129
- package/build/elements/icons/index.cjs +0 -40
- package/build/elements/icons/index.d.cts +0 -24
- package/build/elements/icons/index.d.ts +0 -24
- package/build/elements/icons/index.js +0 -24
- package/build/elements/icons/interface/anchor-add.cjs +0 -35
- package/build/elements/icons/interface/anchor-add.d.cts +0 -3
- package/build/elements/icons/interface/anchor-add.d.ts +0 -3
- package/build/elements/icons/interface/anchor-add.js +0 -31
- package/build/elements/icons/interface/anchor-remove.cjs +0 -34
- package/build/elements/icons/interface/anchor-remove.d.cts +0 -3
- package/build/elements/icons/interface/anchor-remove.d.ts +0 -3
- package/build/elements/icons/interface/anchor-remove.js +0 -30
- package/build/elements/icons/interface/arrow-up.cjs +0 -30
- package/build/elements/icons/interface/arrow-up.d.cts +0 -3
- package/build/elements/icons/interface/arrow-up.d.ts +0 -3
- package/build/elements/icons/interface/arrow-up.js +0 -26
- package/build/elements/icons/interface/arrows-vertical.cjs +0 -30
- package/build/elements/icons/interface/arrows-vertical.d.cts +0 -3
- package/build/elements/icons/interface/arrows-vertical.d.ts +0 -3
- package/build/elements/icons/interface/arrows-vertical.js +0 -26
- package/build/elements/icons/interface/bezier-angle.cjs +0 -33
- package/build/elements/icons/interface/bezier-angle.d.cts +0 -3
- package/build/elements/icons/interface/bezier-angle.d.ts +0 -3
- package/build/elements/icons/interface/bezier-angle.js +0 -29
- package/build/elements/icons/interface/bezier-distribute.cjs +0 -34
- package/build/elements/icons/interface/bezier-distribute.d.cts +0 -3
- package/build/elements/icons/interface/bezier-distribute.d.ts +0 -3
- package/build/elements/icons/interface/bezier-distribute.js +0 -30
- package/build/elements/icons/interface/bezier-length.cjs +0 -31
- package/build/elements/icons/interface/bezier-length.d.cts +0 -3
- package/build/elements/icons/interface/bezier-length.d.ts +0 -3
- package/build/elements/icons/interface/bezier-length.js +0 -27
- package/build/elements/icons/interface/bezier-mirror.cjs +0 -31
- package/build/elements/icons/interface/bezier-mirror.d.cts +0 -3
- package/build/elements/icons/interface/bezier-mirror.d.ts +0 -3
- package/build/elements/icons/interface/bezier-mirror.js +0 -27
- package/build/elements/icons/interface/bezier.cjs +0 -26
- package/build/elements/icons/interface/bezier.d.cts +0 -3
- package/build/elements/icons/interface/bezier.d.ts +0 -3
- package/build/elements/icons/interface/bezier.js +0 -22
- package/build/elements/icons/interface/check.cjs +0 -30
- package/build/elements/icons/interface/check.d.cts +0 -3
- package/build/elements/icons/interface/check.d.ts +0 -3
- package/build/elements/icons/interface/check.js +0 -26
- package/build/elements/icons/interface/circle-arrow-left.cjs +0 -30
- package/build/elements/icons/interface/circle-arrow-left.d.cts +0 -3
- package/build/elements/icons/interface/circle-arrow-left.d.ts +0 -3
- package/build/elements/icons/interface/circle-arrow-left.js +0 -26
- package/build/elements/icons/interface/circle-arrow-right.cjs +0 -30
- package/build/elements/icons/interface/circle-arrow-right.d.cts +0 -3
- package/build/elements/icons/interface/circle-arrow-right.d.ts +0 -3
- package/build/elements/icons/interface/circle-arrow-right.js +0 -26
- package/build/elements/icons/interface/code.cjs +0 -30
- package/build/elements/icons/interface/code.d.cts +0 -3
- package/build/elements/icons/interface/code.d.ts +0 -3
- package/build/elements/icons/interface/code.js +0 -26
- package/build/elements/icons/interface/dots.cjs +0 -32
- package/build/elements/icons/interface/dots.d.cts +0 -3
- package/build/elements/icons/interface/dots.d.ts +0 -3
- package/build/elements/icons/interface/dots.js +0 -28
- package/build/elements/icons/interface/mention.cjs +0 -30
- package/build/elements/icons/interface/mention.d.cts +0 -3
- package/build/elements/icons/interface/mention.d.ts +0 -3
- package/build/elements/icons/interface/mention.js +0 -26
- package/build/elements/icons/interface/minus.cjs +0 -30
- package/build/elements/icons/interface/minus.d.cts +0 -3
- package/build/elements/icons/interface/minus.d.ts +0 -3
- package/build/elements/icons/interface/minus.js +0 -26
- package/build/elements/icons/interface/picker.cjs +0 -34
- package/build/elements/icons/interface/picker.d.cts +0 -3
- package/build/elements/icons/interface/picker.d.ts +0 -3
- package/build/elements/icons/interface/picker.js +0 -30
- package/build/elements/icons/interface/plus.cjs +0 -30
- package/build/elements/icons/interface/plus.d.cts +0 -3
- package/build/elements/icons/interface/plus.d.ts +0 -3
- package/build/elements/icons/interface/plus.js +0 -26
- package/build/elements/icons/interface/settings.cjs +0 -30
- package/build/elements/icons/interface/settings.d.cts +0 -3
- package/build/elements/icons/interface/settings.d.ts +0 -3
- package/build/elements/icons/interface/settings.js +0 -26
- package/build/elements/index.cjs +0 -65
- package/build/elements/index.d.cts +0 -23
- package/build/elements/index.d.ts +0 -23
- package/build/elements/index.js +0 -23
- package/build/elements/input/index.cjs +0 -273
- package/build/elements/input/index.d.cts +0 -17
- package/build/elements/input/index.d.ts +0 -17
- package/build/elements/input/index.js +0 -269
- package/build/elements/logo/index.cjs +0 -732
- package/build/elements/logo/index.d.cts +0 -17
- package/build/elements/logo/index.d.ts +0 -17
- package/build/elements/logo/index.js +0 -728
- package/build/elements/monitor/fps.cjs +0 -432
- package/build/elements/monitor/fps.d.cts +0 -21
- package/build/elements/monitor/fps.d.ts +0 -21
- package/build/elements/monitor/fps.js +0 -428
- package/build/elements/monitor/index.cjs +0 -670
- package/build/elements/monitor/index.js +0 -666
- package/build/elements/number/index.cjs +0 -173
- package/build/elements/number/index.d.cts +0 -19
- package/build/elements/number/index.d.ts +0 -19
- package/build/elements/number/index.js +0 -169
- package/build/elements/origin/index.cjs +0 -169
- package/build/elements/origin/index.d.cts +0 -12
- package/build/elements/origin/index.d.ts +0 -12
- package/build/elements/origin/index.js +0 -165
- package/build/elements/panel/index.cjs +0 -496
- package/build/elements/panel/index.js +0 -492
- package/build/elements/popover/index.cjs +0 -209
- package/build/elements/popover/index.d.cts +0 -19
- package/build/elements/popover/index.d.ts +0 -19
- package/build/elements/popover/index.js +0 -205
- package/build/elements/radio/index.cjs +0 -301
- package/build/elements/radio/index.d.cts +0 -13
- package/build/elements/radio/index.d.ts +0 -13
- package/build/elements/radio/index.js +0 -283
- package/build/elements/radio/input.cjs +0 -329
- package/build/elements/radio/input.d.cts +0 -15
- package/build/elements/radio/input.d.ts +0 -15
- package/build/elements/radio/input.js +0 -325
- package/build/elements/radio/option.cjs +0 -15
- package/build/elements/radio/option.d.cts +0 -3
- package/build/elements/radio/option.d.ts +0 -3
- package/build/elements/radio/option.js +0 -11
- package/build/elements/shared.cjs +0 -66
- package/build/elements/shared.d.cts +0 -40
- package/build/elements/shared.d.ts +0 -40
- package/build/elements/shared.js +0 -59
- package/build/elements/slider/index.cjs +0 -232
- package/build/elements/slider/index.d.cts +0 -20
- package/build/elements/slider/index.d.ts +0 -20
- package/build/elements/slider/index.js +0 -228
- package/build/elements/state/index.cjs +0 -274
- package/build/elements/state/index.js +0 -270
- package/build/elements/toggle/index.cjs +0 -151
- package/build/elements/toggle/index.d.cts +0 -9
- package/build/elements/toggle/index.d.ts +0 -9
- package/build/elements/toggle/index.js +0 -147
- package/build/elements/tooltip/index.cjs +0 -187
- package/build/elements/tooltip/index.d.cts +0 -17
- package/build/elements/tooltip/index.d.ts +0 -17
- package/build/elements/tooltip/index.js +0 -183
- package/build/init.cjs +0 -325
- package/build/init.d.cts +0 -157
- package/build/init.d.ts +0 -157
- package/build/init.js +0 -289
- package/build/internal/component-loaders.cjs +0 -208
- package/build/internal/component-loaders.d.cts +0 -52
- package/build/internal/component-loaders.d.ts +0 -52
- package/build/internal/component-loaders.js +0 -169
- package/build/internal/fonts.cjs +0 -128
- package/build/internal/fonts.d.cts +0 -32
- package/build/internal/fonts.d.ts +0 -32
- package/build/internal/fonts.js +0 -123
- package/build/internal/lazy-load.cjs +0 -89
- package/build/internal/lazy-load.d.cts +0 -32
- package/build/internal/lazy-load.d.ts +0 -32
- package/build/internal/lazy-load.js +0 -86
- package/build/internal/style-inject.cjs +0 -236
- package/build/internal/style-inject.d.cts +0 -44
- package/build/internal/style-inject.d.ts +0 -44
- package/build/internal/style-inject.js +0 -226
- package/build/react/events.cjs +0 -25
- package/build/react/events.d.cts +0 -39
- package/build/react/events.d.ts +0 -39
- package/build/react/events.js +0 -22
- package/build/react/index.cjs +0 -19
- package/build/react/index.d.cts +0 -13
- package/build/react/index.d.ts +0 -13
- package/build/react/index.js +0 -12
- package/build/react/provider.cjs +0 -134
- package/build/react/provider.d.cts +0 -81
- package/build/react/provider.d.ts +0 -81
- package/build/react/provider.js +0 -98
- package/build/react/types.cjs +0 -8
- package/build/react/types.d.cts +0 -55
- package/build/react/types.d.ts +0 -55
- package/build/react/types.js +0 -7
- package/build/react/use-ease-state.cjs +0 -129
- package/build/react/use-ease-state.d.cts +0 -95
- package/build/react/use-ease-state.d.ts +0 -95
- package/build/react/use-ease-state.js +0 -126
- package/build/react/use-web-kit.cjs +0 -150
- package/build/react/use-web-kit.d.cts +0 -80
- package/build/react/use-web-kit.d.ts +0 -80
- package/build/react/use-web-kit.js +0 -114
- package/build/theme/index.cjs +0 -452
- package/build/theme/index.js +0 -423
- package/build/theme/presets.cjs +0 -54
- package/build/theme/presets.d.cts +0 -19
- package/build/theme/presets.d.ts +0 -19
- package/build/theme/presets.js +0 -51
- package/build/theme/registry.cjs +0 -204
- package/build/theme/registry.d.cts +0 -99
- package/build/theme/registry.d.ts +0 -99
- package/build/theme/registry.js +0 -194
- package/build/theme/tokens.cjs +0 -148
- package/build/theme/tokens.d.cts +0 -163
- package/build/theme/tokens.d.ts +0 -163
- package/build/theme/tokens.js +0 -145
- package/build/utils/dismiss-controller.cjs +0 -77
- package/build/utils/dismiss-controller.d.cts +0 -14
- package/build/utils/dismiss-controller.d.ts +0 -14
- package/build/utils/dismiss-controller.js +0 -73
- package/build/utils/index.cjs +0 -18
- package/build/utils/index.d.cts +0 -3
- package/build/utils/index.d.ts +0 -3
- package/build/utils/index.js +0 -3
- package/build/utils/outside-click.cjs +0 -82
- package/build/utils/outside-click.d.cts +0 -18
- package/build/utils/outside-click.d.ts +0 -18
- package/build/utils/outside-click.js +0 -74
- package/build/utils/template-helpers.cjs +0 -39
- package/build/utils/template-helpers.d.cts +0 -13
- package/build/utils/template-helpers.d.ts +0 -13
- package/build/utils/template-helpers.js +0 -28
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
import { html, nothing } from 'lit-html';
|
|
2
|
-
import { setBooleanAttribute } from "../shared.js";
|
|
3
|
-
import { Component } from '../../decorators/Component';
|
|
4
|
-
import { Listen } from '../../decorators/Listen';
|
|
5
|
-
import { Prop } from '../../decorators/Prop';
|
|
6
|
-
import { Query } from '../../decorators/Query';
|
|
7
|
-
/**
|
|
8
|
-
* Panel component - visual container with optional tabs and header actions.
|
|
9
|
-
*
|
|
10
|
-
* Use this component when you want the panel UI without state management,
|
|
11
|
-
* or wrap it around `<ease-state>` for full functionality.
|
|
12
|
-
*
|
|
13
|
-
* @tag ease-panel
|
|
14
|
-
*
|
|
15
|
-
* @slot headline - Panel title text (hidden when tabs are present)
|
|
16
|
-
* @slot actions - Header action buttons, links, or dropdowns
|
|
17
|
-
* @slot - Default slot for main content
|
|
18
|
-
* @slot tab-{id} - Tab panel content (use `data-tab-label` for display name)
|
|
19
|
-
* @slot footer - Footer content below all panels
|
|
20
|
-
*
|
|
21
|
-
* @csspart section - Outer container
|
|
22
|
-
* @csspart header - Header row containing headline/tabs and actions
|
|
23
|
-
* @csspart headline - Title element
|
|
24
|
-
* @csspart tabs - Tab button container
|
|
25
|
-
* @csspart tab - Individual tab button
|
|
26
|
-
* @csspart actions - Actions container
|
|
27
|
-
* @csspart content - Content wrapper (handles height animations)
|
|
28
|
-
* @csspart body - Inner body container
|
|
29
|
-
* @csspart tab-panel - Individual tab panel
|
|
30
|
-
* @csspart footer - Footer container
|
|
31
|
-
*
|
|
32
|
-
* @fires tab-change - Fired when the active tab changes
|
|
33
|
-
*/
|
|
34
|
-
@Component({
|
|
35
|
-
tag: 'ease-panel',
|
|
36
|
-
shadowMode: 'open',
|
|
37
|
-
styles: `
|
|
38
|
-
:host {
|
|
39
|
-
--ease-panel-transition-duration: 120ms;
|
|
40
|
-
--ease-panel-transition-easing: cubic-bezier(.25, 0, .5, 1);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[part="section"] {
|
|
44
|
-
display: block;
|
|
45
|
-
width: 100%;
|
|
46
|
-
max-width: var(--ease-panel-max-width, 332px);
|
|
47
|
-
border-radius: var(--ease-panel-radius, 12px);
|
|
48
|
-
border: 1px solid var(--ease-panel-border-color, var(--color-white-6));
|
|
49
|
-
background-clip: padding-box;
|
|
50
|
-
background: var(--ease-panel-background, var(--color-gray-1000));
|
|
51
|
-
box-shadow: var(--ease-panel-shadow, 0 0 40px 0 var(--color-white-2) inset);
|
|
52
|
-
box-sizing: border-box;
|
|
53
|
-
padding: var(--ease-panel-padding, 12px);
|
|
54
|
-
margin: auto;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
[part="header"] {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
gap: 8px;
|
|
61
|
-
width: 100%;
|
|
62
|
-
margin-bottom: 12px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
[part="header"]:not(:has([part="headline"] slot[name="headline"]::slotted(*))):not(:has([part="tabs"]:not(:empty))):not(:has([part="actions"] slot[name="actions"]::slotted(*))) {
|
|
66
|
-
display: none;
|
|
67
|
-
margin-bottom: 0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
[part="headline"] {
|
|
71
|
-
font-size: var(--ease-panel-title-font-size, 14px);
|
|
72
|
-
font-weight: var(--ease-panel-title-font-weight, 500);
|
|
73
|
-
line-height: var(--ease-panel-title-line-height, 24px);
|
|
74
|
-
font-family: var(--ease-font-family, "Instrument Sans", sans-serif);
|
|
75
|
-
color: var(--ease-panel-title-color, var(--color-blue-100));
|
|
76
|
-
margin: 0 0 0 4px;
|
|
77
|
-
flex-grow: 1;
|
|
78
|
-
text-ellipsis: ellipsis;
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
[part="headline"]:has(+ [part="tabs"]:not(:empty)) {
|
|
84
|
-
display: none;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
[part="tabs"] {
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
gap: 2px;
|
|
91
|
-
flex-grow: 1;
|
|
92
|
-
margin: 0 0 0 4px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
[part="tabs"]:empty {
|
|
96
|
-
display: none;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
[part="tab"] {
|
|
100
|
-
appearance: none;
|
|
101
|
-
font-size: var(--ease-panel-tab-font-size, 13px);
|
|
102
|
-
font-weight: var(--ease-panel-tab-font-weight, 500);
|
|
103
|
-
line-height: var(--ease-panel-tab-line-height, 24px);
|
|
104
|
-
font-family: var(--ease-font-family, "Instrument Sans", sans-serif);
|
|
105
|
-
color: var(--ease-panel-tab-color, var(--color-gray-600));
|
|
106
|
-
background: transparent;
|
|
107
|
-
border: none;
|
|
108
|
-
padding: 4px 8px;
|
|
109
|
-
margin: 0;
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
border-radius: var(--ease-panel-tab-radius, 6px);
|
|
112
|
-
transition: color 0.2s, background-color 0.2s;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
[part="tab"]:hover {
|
|
116
|
-
color: var(--ease-panel-tab-color-hover, var(--color-blue-100));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
[part="tab"][aria-selected="true"] {
|
|
120
|
-
color: var(--ease-panel-tab-color-active, var(--color-blue-100));
|
|
121
|
-
background: var(--ease-panel-tab-background-active, var(--color-white-4));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
[part="actions"] {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
gap: 4px;
|
|
128
|
-
margin-left: auto;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
slot[name="actions"]::slotted(button),
|
|
132
|
-
slot[name="actions"]::slotted(a) {
|
|
133
|
-
--ease-icon-size: var(--ease-panel-action-icon-size, 16px);
|
|
134
|
-
|
|
135
|
-
appearance: none;
|
|
136
|
-
flex: 0 0 24px;
|
|
137
|
-
border: none;
|
|
138
|
-
outline: none;
|
|
139
|
-
background-color: transparent;
|
|
140
|
-
padding: 4px;
|
|
141
|
-
margin: 0;
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
color: var(--color-gray-600);
|
|
144
|
-
transition: color 0.2s;
|
|
145
|
-
text-decoration: none;
|
|
146
|
-
display: flex;
|
|
147
|
-
align-items: center;
|
|
148
|
-
justify-content: center;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
slot[name="actions"]::slotted(button:hover),
|
|
152
|
-
slot[name="actions"]::slotted(button:focus-visible),
|
|
153
|
-
slot[name="actions"]::slotted(a:hover),
|
|
154
|
-
slot[name="actions"]::slotted(a:focus-visible) {
|
|
155
|
-
color: var(--color-blue-100);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
slot[name="actions"]::slotted(ease-dropdown) {
|
|
159
|
-
flex: 0 0 auto;
|
|
160
|
-
width: auto;
|
|
161
|
-
|
|
162
|
-
--ease-icon-size: var(--ease-panel-action-icon-size, 16px);
|
|
163
|
-
--ease-dropdown-trigger-padding: 4px;
|
|
164
|
-
--ease-dropdown-radius: 6px;
|
|
165
|
-
--ease-dropdown-background: transparent;
|
|
166
|
-
--ease-dropdown-background-hover: transparent;
|
|
167
|
-
--ease-dropdown-shadow: none;
|
|
168
|
-
--ease-dropdown-color: var(--color-gray-600);
|
|
169
|
-
--ease-popover-placement: bottom-end;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
slot[name="actions"]::slotted(ease-dropdown:hover),
|
|
173
|
-
slot[name="actions"]::slotted(ease-dropdown:focus-within) {
|
|
174
|
-
--ease-dropdown-color: var(--color-blue-100);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
[part="content"] {
|
|
178
|
-
display: block;
|
|
179
|
-
width: 100%;
|
|
180
|
-
box-sizing: border-box;
|
|
181
|
-
margin: auto;
|
|
182
|
-
overflow: hidden;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
[part="content"][data-animating="true"] {
|
|
186
|
-
transition: height var(--ease-panel-transition-duration) var(--ease-panel-transition-easing);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
[part="body"] {
|
|
190
|
-
width: 100%;
|
|
191
|
-
position: relative;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
[part="tab-panel"] {
|
|
195
|
-
width: 100%;
|
|
196
|
-
pointer-events: none;
|
|
197
|
-
display: none;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
[part="tab-panel"][data-state="active"] {
|
|
201
|
-
display: block;
|
|
202
|
-
pointer-events: auto;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
[part="tab-panel"][data-state="hidden"] {
|
|
206
|
-
display: none;
|
|
207
|
-
pointer-events: none;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
[part="footer"] {
|
|
211
|
-
display: flex;
|
|
212
|
-
align-items: center;
|
|
213
|
-
justify-content: space-between;
|
|
214
|
-
width: 100%;
|
|
215
|
-
padding: var(--ease-panel-footer-padding, 12px);
|
|
216
|
-
box-sizing: border-box;
|
|
217
|
-
border-top: 1px solid var(--color-white-4);
|
|
218
|
-
|
|
219
|
-
&:not(:has([data-has-content="true"])) {
|
|
220
|
-
display: none;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
::slotted(:not([slot])),
|
|
225
|
-
::slotted([slot^="tab-"]) {
|
|
226
|
-
display: grid;
|
|
227
|
-
gap: 12px;
|
|
228
|
-
box-sizing: border-box;
|
|
229
|
-
width: 100%;
|
|
230
|
-
}
|
|
231
|
-
`
|
|
232
|
-
})
|
|
233
|
-
export class Panel extends HTMLElement {
|
|
234
|
-
#tabs = [];
|
|
235
|
-
#isAnimating = false;
|
|
236
|
-
@Prop({
|
|
237
|
-
type: Number,
|
|
238
|
-
reflect: true,
|
|
239
|
-
attribute: 'active-tab',
|
|
240
|
-
defaultValue: 0,
|
|
241
|
-
onChange(next, previous) {
|
|
242
|
-
const self = this;
|
|
243
|
-
if (next !== previous && previous !== undefined) {
|
|
244
|
-
self.handleActiveTabChange(previous, next);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
})
|
|
248
|
-
accessor activeTab = 0;
|
|
249
|
-
/** @internal */
|
|
250
|
-
handleActiveTabChange(previous, next) {
|
|
251
|
-
this.performTabAnimation(previous, next);
|
|
252
|
-
}
|
|
253
|
-
@Query('[part="content"]')
|
|
254
|
-
accessor contentElement;
|
|
255
|
-
@Query('[part="body"]')
|
|
256
|
-
accessor bodyElement;
|
|
257
|
-
/**
|
|
258
|
-
* Get the tab configuration
|
|
259
|
-
*/
|
|
260
|
-
get tabs() {
|
|
261
|
-
return this.#tabs;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Switch to a specific tab by index
|
|
265
|
-
* @param index - The tab index (0-based)
|
|
266
|
-
*/
|
|
267
|
-
setTab(index) {
|
|
268
|
-
if (index >= 0 && index < this.#tabs.length && index !== this.activeTab) {
|
|
269
|
-
this.activeTab = index;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
connectedCallback() {
|
|
273
|
-
this.#syncTabs();
|
|
274
|
-
}
|
|
275
|
-
afterRender() {
|
|
276
|
-
this.#syncTabs();
|
|
277
|
-
}
|
|
278
|
-
render() {
|
|
279
|
-
const hasTabs = this.#tabs.length > 0;
|
|
280
|
-
return html `
|
|
281
|
-
<section part="section">
|
|
282
|
-
<div part="header">
|
|
283
|
-
<h3 part="headline"><slot name="headline"></slot></h3>
|
|
284
|
-
${this.#renderTabs()}
|
|
285
|
-
<div part="actions">
|
|
286
|
-
<slot name="actions"></slot>
|
|
287
|
-
</div>
|
|
288
|
-
</div>
|
|
289
|
-
<div part="content">
|
|
290
|
-
<div part="body">
|
|
291
|
-
${hasTabs ? this.#renderTabPanels() : html `<slot></slot>`}
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
<div part="footer">
|
|
295
|
-
<slot name="footer"></slot>
|
|
296
|
-
</div>
|
|
297
|
-
</section>
|
|
298
|
-
`;
|
|
299
|
-
}
|
|
300
|
-
#renderTabs() {
|
|
301
|
-
if (this.#tabs.length === 0) {
|
|
302
|
-
return nothing;
|
|
303
|
-
}
|
|
304
|
-
return html `
|
|
305
|
-
<div part="tabs" role="tablist">
|
|
306
|
-
${this.#tabs.map((tab, index) => html `
|
|
307
|
-
<button
|
|
308
|
-
part="tab"
|
|
309
|
-
role="tab"
|
|
310
|
-
aria-selected=${index === this.activeTab ? 'true' : 'false'}
|
|
311
|
-
aria-controls=${`panel-${tab.id}`}
|
|
312
|
-
tabindex=${index === this.activeTab ? 0 : -1}
|
|
313
|
-
@click=${(e) => this.#handleTabClick(index, tab.id, e)}
|
|
314
|
-
@keydown=${(e) => this.#handleTabKeydown(e, index)}
|
|
315
|
-
>
|
|
316
|
-
${tab.label}
|
|
317
|
-
</button>
|
|
318
|
-
`)}
|
|
319
|
-
</div>
|
|
320
|
-
`;
|
|
321
|
-
}
|
|
322
|
-
#renderTabPanels() {
|
|
323
|
-
return html `
|
|
324
|
-
${this.#tabs.map((tab, index) => html `
|
|
325
|
-
<div
|
|
326
|
-
part="tab-panel"
|
|
327
|
-
role="tabpanel"
|
|
328
|
-
id=${`panel-${tab.id}`}
|
|
329
|
-
aria-labelledby=${`tab-${tab.id}`}
|
|
330
|
-
data-state=${index === this.activeTab ? 'active' : 'hidden'}
|
|
331
|
-
data-index=${index}
|
|
332
|
-
>
|
|
333
|
-
<slot name=${`tab-${tab.id}`}></slot>
|
|
334
|
-
</div>
|
|
335
|
-
`)}
|
|
336
|
-
`;
|
|
337
|
-
}
|
|
338
|
-
#handleTabClick(index, id, event) {
|
|
339
|
-
if (index === this.activeTab) {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
this.activeTab = index;
|
|
343
|
-
this.dispatchEvent(new CustomEvent('tab-change', {
|
|
344
|
-
detail: { index, id, event },
|
|
345
|
-
bubbles: true,
|
|
346
|
-
composed: true
|
|
347
|
-
}));
|
|
348
|
-
}
|
|
349
|
-
#handleTabKeydown(event, currentIndex) {
|
|
350
|
-
let newIndex = currentIndex;
|
|
351
|
-
switch (event.key) {
|
|
352
|
-
case 'ArrowLeft':
|
|
353
|
-
event.preventDefault();
|
|
354
|
-
newIndex = currentIndex > 0 ? currentIndex - 1 : this.#tabs.length - 1;
|
|
355
|
-
break;
|
|
356
|
-
case 'ArrowRight':
|
|
357
|
-
event.preventDefault();
|
|
358
|
-
newIndex = currentIndex < this.#tabs.length - 1 ? currentIndex + 1 : 0;
|
|
359
|
-
break;
|
|
360
|
-
case 'Home':
|
|
361
|
-
event.preventDefault();
|
|
362
|
-
newIndex = 0;
|
|
363
|
-
break;
|
|
364
|
-
case 'End':
|
|
365
|
-
event.preventDefault();
|
|
366
|
-
newIndex = this.#tabs.length - 1;
|
|
367
|
-
break;
|
|
368
|
-
default:
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
if (newIndex !== currentIndex) {
|
|
372
|
-
this.activeTab = newIndex;
|
|
373
|
-
// Focus the new tab button
|
|
374
|
-
queueMicrotask(() => {
|
|
375
|
-
const tabButtons = this.shadowRoot?.querySelectorAll('[part="tab"]');
|
|
376
|
-
const newTabButton = tabButtons?.[newIndex];
|
|
377
|
-
newTabButton?.focus();
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
async performTabAnimation(fromIndex, toIndex) {
|
|
382
|
-
if (this.#isAnimating) {
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
this.#isAnimating = true;
|
|
386
|
-
const duration = 120;
|
|
387
|
-
const easing = 'cubic-bezier(.25, 0, .5, 1)';
|
|
388
|
-
const content = this.contentElement;
|
|
389
|
-
if (!content) {
|
|
390
|
-
this.#isAnimating = false;
|
|
391
|
-
this.requestRender();
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
// Get the panels by data-index attribute for reliability
|
|
395
|
-
const fromPanel = this.shadowRoot?.querySelector(`[part="tab-panel"][data-index="${fromIndex}"]`);
|
|
396
|
-
const toPanel = this.shadowRoot?.querySelector(`[part="tab-panel"][data-index="${toIndex}"]`);
|
|
397
|
-
if (!fromPanel || !toPanel) {
|
|
398
|
-
this.#isAnimating = false;
|
|
399
|
-
this.requestRender();
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
// Lock the current height
|
|
403
|
-
const startHeight = content.getBoundingClientRect().height;
|
|
404
|
-
content.style.height = `${startHeight}px`;
|
|
405
|
-
// FIX: Ensure the new panel is hidden immediately.
|
|
406
|
-
toPanel.style.display = 'none';
|
|
407
|
-
toPanel.style.opacity = '0';
|
|
408
|
-
// Fade out old content via WAAPI
|
|
409
|
-
try {
|
|
410
|
-
const fadeOut = fromPanel.animate([{ opacity: 1 }, { opacity: 0 }], { duration, easing, fill: 'forwards' });
|
|
411
|
-
await fadeOut.finished;
|
|
412
|
-
fadeOut.cancel();
|
|
413
|
-
}
|
|
414
|
-
catch {
|
|
415
|
-
// ignore
|
|
416
|
-
}
|
|
417
|
-
fromPanel.setAttribute('data-state', 'hidden');
|
|
418
|
-
// Prepare and measure new panel while completely invisible
|
|
419
|
-
const previousToState = toPanel.getAttribute('data-state');
|
|
420
|
-
toPanel.style.display = 'block';
|
|
421
|
-
toPanel.style.visibility = 'hidden';
|
|
422
|
-
toPanel.style.opacity = '0';
|
|
423
|
-
// Force layout, then measure
|
|
424
|
-
void toPanel.offsetHeight;
|
|
425
|
-
const endHeight = toPanel.getBoundingClientRect().height;
|
|
426
|
-
// Animate height
|
|
427
|
-
if (startHeight !== endHeight) {
|
|
428
|
-
content.setAttribute('data-animating', 'true');
|
|
429
|
-
void content.offsetHeight;
|
|
430
|
-
content.style.height = `${endHeight}px`;
|
|
431
|
-
await this.#wait(duration);
|
|
432
|
-
}
|
|
433
|
-
// Show panel but keep opacity at 0, then fade in
|
|
434
|
-
toPanel.style.visibility = 'visible';
|
|
435
|
-
toPanel.style.opacity = '0';
|
|
436
|
-
void toPanel.offsetHeight;
|
|
437
|
-
try {
|
|
438
|
-
const fadeIn = toPanel.animate([{ opacity: 0 }, { opacity: 1 }], { duration, easing, fill: 'forwards' });
|
|
439
|
-
await fadeIn.finished;
|
|
440
|
-
fadeIn.cancel();
|
|
441
|
-
}
|
|
442
|
-
catch {
|
|
443
|
-
// ignore
|
|
444
|
-
}
|
|
445
|
-
// Finalize new tab state and cleanup
|
|
446
|
-
toPanel.style.display = '';
|
|
447
|
-
toPanel.style.visibility = '';
|
|
448
|
-
toPanel.style.opacity = '';
|
|
449
|
-
if (previousToState !== 'active') {
|
|
450
|
-
toPanel.setAttribute('data-state', 'active');
|
|
451
|
-
}
|
|
452
|
-
content.style.height = '';
|
|
453
|
-
content.removeAttribute('data-animating');
|
|
454
|
-
this.#isAnimating = false;
|
|
455
|
-
}
|
|
456
|
-
#wait(ms) {
|
|
457
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
458
|
-
}
|
|
459
|
-
#syncTabs() {
|
|
460
|
-
const tabs = [];
|
|
461
|
-
for (const child of Array.from(this.children)) {
|
|
462
|
-
const slot = child.getAttribute('slot');
|
|
463
|
-
if (slot?.startsWith('tab-')) {
|
|
464
|
-
const id = slot.replace('tab-', '');
|
|
465
|
-
const label = child.getAttribute('data-tab-label') || id;
|
|
466
|
-
tabs.push({ id, label });
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
this.#tabs = tabs.slice(0, 3);
|
|
470
|
-
if (this.activeTab >= this.#tabs.length && this.#tabs.length > 0) {
|
|
471
|
-
this.activeTab = 0;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
@Listen('slotchange', { selector: 'slot[name="footer"]' })
|
|
475
|
-
onFooterSlotChange() {
|
|
476
|
-
this.updateFooterAttribute();
|
|
477
|
-
}
|
|
478
|
-
@Listen('slotchange', { selector: 'slot:not([name])' })
|
|
479
|
-
onDefaultSlotChange() {
|
|
480
|
-
this.#syncTabs();
|
|
481
|
-
this.requestRender();
|
|
482
|
-
}
|
|
483
|
-
updateFooterAttribute() {
|
|
484
|
-
const footer = this.shadowRoot?.querySelector('[part="footer"]');
|
|
485
|
-
if (!footer) {
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
|
-
const footerSlot = this.shadowRoot?.querySelector('slot[name="footer"]');
|
|
489
|
-
const hasFooter = Boolean(footerSlot?.assignedNodes({ flatten: true }).length > 0);
|
|
490
|
-
setBooleanAttribute(footer, 'data-has-content', hasFooter);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Popover = void 0;
|
|
4
|
-
const lit_html_1 = require("lit-html");
|
|
5
|
-
const Component_1 = require("../../decorators/Component");
|
|
6
|
-
const Prop_1 = require("../../decorators/Prop");
|
|
7
|
-
const nextAnchorName = () => `--ease-popover-anchor-${crypto.randomUUID()}`;
|
|
8
|
-
@(0, Component_1.Component)({
|
|
9
|
-
tag: 'ease-popover',
|
|
10
|
-
autoSlot: false,
|
|
11
|
-
shadowMode: 'open',
|
|
12
|
-
styles: `
|
|
13
|
-
:host {
|
|
14
|
-
display: contents;
|
|
15
|
-
--ease-popover-offset: 8px;
|
|
16
|
-
--ease-popover-anchor-name: --ease-popover-anchor;
|
|
17
|
-
--ease-popover-transform-origin: center center;
|
|
18
|
-
--ease-popover-duration: 200ms;
|
|
19
|
-
--ease-popover-content-min-width: auto;
|
|
20
|
-
--ease-popover-content-max-width: none;
|
|
21
|
-
--ease-popover-content-width: max-content;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
::slotted([slot="trigger"]) {
|
|
25
|
-
anchor-name: var(--ease-popover-anchor-name);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[part="content"] {
|
|
29
|
-
position-anchor: var(--ease-popover-anchor-name);
|
|
30
|
-
position: fixed;
|
|
31
|
-
margin: 0;
|
|
32
|
-
transform-origin: var(--ease-popover-transform-origin);
|
|
33
|
-
width: var(--ease-popover-content-width);
|
|
34
|
-
min-width: var(--ease-popover-content-min-width);
|
|
35
|
-
max-width: var(--ease-popover-content-max-width);
|
|
36
|
-
box-sizing: border-box;
|
|
37
|
-
overscroll-behavior: contain;
|
|
38
|
-
z-index: 100;
|
|
39
|
-
display: none;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:host([open]) [part="content"] {
|
|
43
|
-
display: block;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:host([placement="top-start"]) [part="content"] {
|
|
47
|
-
position-area: top right;
|
|
48
|
-
top: anchor(bottom);
|
|
49
|
-
left: anchor(left);
|
|
50
|
-
translate: 0 calc(var(--ease-popover-offset) * -1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host([placement="top-center"]) [part="content"] {
|
|
54
|
-
position-area: top center;
|
|
55
|
-
top: anchor(top);
|
|
56
|
-
left: anchor(center);
|
|
57
|
-
translate: 0 calc(var(--ease-popover-offset) * -1);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
:host([placement="top-end"]) [part="content"] {
|
|
61
|
-
position-area: top right;
|
|
62
|
-
top: anchor(bottom);
|
|
63
|
-
right: anchor(right);
|
|
64
|
-
translate: 0 calc(var(--ease-popover-offset) * -1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
:host([placement="bottom-start"]) [part="content"] {
|
|
68
|
-
position-area: bottom right;
|
|
69
|
-
top: anchor(bottom);
|
|
70
|
-
left: anchor(left);
|
|
71
|
-
translate: 0 var(--ease-popover-offset);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
:host([placement="bottom-center"]) [part="content"] {
|
|
75
|
-
position-area: bottom center;
|
|
76
|
-
top: anchor(bottom);
|
|
77
|
-
left: anchor(left);
|
|
78
|
-
translate: 0 var(--ease-popover-offset);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
:host([placement="bottom-end"]) [part="content"] {
|
|
82
|
-
position-area: bottom left;
|
|
83
|
-
top: anchor(bottom);
|
|
84
|
-
right: anchor(right);
|
|
85
|
-
translate: 0 var(--ease-popover-offset);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
:host([placement="left-start"]) [part="content"] {
|
|
89
|
-
position-area: left bottom;
|
|
90
|
-
top: anchor(top);
|
|
91
|
-
left: anchor(left);
|
|
92
|
-
translate: calc(var(--ease-popover-offset) * -1) 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
:host([placement="left-center"]) [part="content"] {
|
|
96
|
-
position-area: left center;
|
|
97
|
-
top: anchor(top);
|
|
98
|
-
left: anchor(left);
|
|
99
|
-
translate: calc(var(--ease-popover-offset) * -1) 0;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
:host([placement="left-end"]) [part="content"] {
|
|
103
|
-
position-area: left top;
|
|
104
|
-
top: anchor(top);
|
|
105
|
-
left: anchor(left);
|
|
106
|
-
translate: calc(var(--ease-popover-offset) * -1) 0;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
:host([placement="right-start"]) [part="content"] {
|
|
110
|
-
position-area: right end;
|
|
111
|
-
top: anchor(top);
|
|
112
|
-
left: anchor(right);
|
|
113
|
-
translate: var(--ease-popover-offset) 0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
:host([placement="right-center"]) [part="content"] {
|
|
117
|
-
position-area: right center;
|
|
118
|
-
top: anchor(top);
|
|
119
|
-
left: anchor(right);
|
|
120
|
-
translate: var(--ease-popover-offset) 0;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
:host([placement="right-end"]) [part="content"] {
|
|
124
|
-
position-area: right start;
|
|
125
|
-
top: anchor(top);
|
|
126
|
-
left: anchor(right);
|
|
127
|
-
translate: var(--ease-popover-offset) 0;
|
|
128
|
-
}
|
|
129
|
-
`
|
|
130
|
-
})
|
|
131
|
-
class Popover extends HTMLElement {
|
|
132
|
-
#anchorName = nextAnchorName();
|
|
133
|
-
#contentElement = null;
|
|
134
|
-
#initialized = false;
|
|
135
|
-
get contentElement() {
|
|
136
|
-
return this.#contentElement;
|
|
137
|
-
}
|
|
138
|
-
@(0, Prop_1.Prop)({
|
|
139
|
-
reflect: true,
|
|
140
|
-
defaultValue: 'bottom-start',
|
|
141
|
-
onChange() {
|
|
142
|
-
this.handlePlacementChange();
|
|
143
|
-
}
|
|
144
|
-
})
|
|
145
|
-
accessor placement;
|
|
146
|
-
@(0, Prop_1.Prop)({
|
|
147
|
-
type: Number,
|
|
148
|
-
reflect: true,
|
|
149
|
-
defaultValue: 8,
|
|
150
|
-
onChange() {
|
|
151
|
-
this.handleOffsetChange();
|
|
152
|
-
}
|
|
153
|
-
})
|
|
154
|
-
accessor offset = 8;
|
|
155
|
-
@(0, Prop_1.Prop)({ type: Boolean, reflect: true })
|
|
156
|
-
accessor open = false;
|
|
157
|
-
connectedCallback() {
|
|
158
|
-
this.#syncAnchorName();
|
|
159
|
-
this.#syncOffset();
|
|
160
|
-
}
|
|
161
|
-
disconnectedCallback() {
|
|
162
|
-
this.#contentElement = null;
|
|
163
|
-
this.#initialized = false;
|
|
164
|
-
}
|
|
165
|
-
render() {
|
|
166
|
-
return (0, lit_html_1.html) `
|
|
167
|
-
<slot slot="trigger" name="trigger"></slot>
|
|
168
|
-
<div
|
|
169
|
-
part="content"
|
|
170
|
-
data-popover-content
|
|
171
|
-
role="region"
|
|
172
|
-
data-placement=${this.placement}
|
|
173
|
-
>
|
|
174
|
-
<slot></slot>
|
|
175
|
-
</div>
|
|
176
|
-
`;
|
|
177
|
-
}
|
|
178
|
-
handlePlacementChange() {
|
|
179
|
-
if (!this.#initialized) {
|
|
180
|
-
this.requestRender();
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
this.#syncPlacement();
|
|
184
|
-
}
|
|
185
|
-
handleOffsetChange() {
|
|
186
|
-
if (!this.#initialized) {
|
|
187
|
-
this.requestRender();
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
this.#syncOffset();
|
|
191
|
-
}
|
|
192
|
-
#syncPlacement() {
|
|
193
|
-
this.dataset.placement = this.placement;
|
|
194
|
-
if (this.#contentElement) {
|
|
195
|
-
this.#contentElement.dataset.placement = this.placement;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
#syncOffset() {
|
|
199
|
-
const offset = Number.isFinite(this.offset) ? this.offset : 0;
|
|
200
|
-
this.style.setProperty('--ease-popover-offset', `${offset}px`);
|
|
201
|
-
}
|
|
202
|
-
#syncAnchorName() {
|
|
203
|
-
this.style.setProperty('--ease-popover-anchor-name', this.#anchorName);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
exports.Popover = Popover;
|
|
207
|
-
exports.default = {
|
|
208
|
-
Popover
|
|
209
|
-
};
|