lapikit 0.4.13 → 0.4.14
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/README.md +1 -1
- package/dist/@legacy/components/accordion/accordion.svelte +39 -0
- package/dist/{labs → @legacy}/components/accordion/accordion.svelte.d.ts +1 -1
- package/dist/@legacy/components/accordion/modules/accordion-item.svelte +94 -0
- package/dist/{labs → @legacy}/components/accordion/modules/accordion-item.svelte.d.ts +1 -1
- package/dist/@legacy/components/alert/alert.svelte +89 -0
- package/dist/{labs → @legacy}/components/alert/alert.svelte.d.ts +1 -1
- package/dist/@legacy/components/app/app.svelte +79 -0
- package/dist/@legacy/components/app/app.svelte.d.ts +4 -0
- package/dist/@legacy/components/appbar/appbar.svelte +40 -0
- package/dist/{labs → @legacy}/components/appbar/appbar.svelte.d.ts +1 -1
- package/dist/@legacy/components/aspect-ratio/aspect-ratio.svelte +25 -0
- package/dist/{labs → @legacy}/components/aspect-ratio/aspect-ratio.svelte.d.ts +2 -2
- package/dist/@legacy/components/avatar/avatar.svelte +46 -0
- package/dist/{labs → @legacy}/components/avatar/avatar.svelte.d.ts +1 -1
- package/dist/@legacy/components/card/card.svelte +67 -0
- package/dist/{labs → @legacy}/components/card/card.svelte.d.ts +1 -1
- package/dist/@legacy/components/chip/chip.svelte +131 -0
- package/dist/{labs → @legacy}/components/chip/chip.svelte.d.ts +2 -2
- package/dist/@legacy/components/dialog/dialog.svelte +67 -0
- package/dist/{labs → @legacy}/components/dialog/dialog.svelte.d.ts +1 -1
- package/dist/@legacy/components/dropdown/dropdown.svelte +115 -0
- package/dist/{labs → @legacy}/components/dropdown/dropdown.svelte.d.ts +2 -2
- package/dist/@legacy/components/icon/icon.svelte +49 -0
- package/dist/{labs → @legacy}/components/icon/icon.svelte.d.ts +1 -1
- package/dist/@legacy/components/index.d.ts +22 -0
- package/dist/@legacy/components/index.js +23 -0
- package/dist/@legacy/components/list/list.svelte +44 -0
- package/dist/{labs → @legacy}/components/list/list.svelte.d.ts +1 -1
- package/dist/@legacy/components/list/modules/list-item.svelte +76 -0
- package/dist/{labs → @legacy}/components/list/modules/list-item.svelte.d.ts +1 -1
- package/dist/@legacy/components/modal/modal.svelte +118 -0
- package/dist/{labs → @legacy}/components/modal/modal.svelte.d.ts +1 -1
- package/dist/@legacy/components/popover/popover.svelte +73 -0
- package/dist/{labs → @legacy}/components/popover/popover.svelte.d.ts +2 -2
- package/dist/@legacy/components/separator/separator.svelte +37 -0
- package/dist/{labs → @legacy}/components/separator/separator.svelte.d.ts +2 -2
- package/dist/@legacy/components/spacer/spacer.svelte +7 -0
- package/dist/{labs → @legacy}/components/spacer/spacer.svelte.d.ts +1 -1
- package/dist/{components → @legacy/components}/spacer/types.d.ts +1 -1
- package/dist/@legacy/components/textfield/textfield.svelte +193 -0
- package/dist/{labs → @legacy}/components/textfield/textfield.svelte.d.ts +1 -1
- package/dist/@legacy/components/toolbar/toolbar.svelte +47 -0
- package/dist/{labs → @legacy}/components/toolbar/toolbar.svelte.d.ts +1 -1
- package/dist/@legacy/components/tooltip/tooltip.svelte +113 -0
- package/dist/{labs → @legacy}/components/tooltip/tooltip.svelte.d.ts +2 -2
- package/dist/{components → @legacy/components}/tooltip/types.d.ts +1 -1
- package/dist/{labs/animations → animations}/ripple.d.ts +1 -1
- package/dist/compiler/index.d.ts +1 -0
- package/dist/compiler/index.js +1 -0
- package/dist/{labs/compiler → compiler}/mapped-code.d.ts +2 -2
- package/dist/{labs/compiler → compiler}/preprocess/decode-sourcemap.d.ts +1 -1
- package/dist/{labs/compiler → compiler}/preprocess/decode-sourcemap.js +1 -1
- package/dist/compiler/preprocess/index.d.ts +1 -0
- package/dist/compiler/preprocess/index.js +1 -0
- package/dist/{labs/compiler → compiler}/preprocess/lili.d.ts +1 -1
- package/dist/{labs/compiler → compiler}/preprocess/lili.js +4 -4
- package/dist/{labs/compiler → compiler}/preprocess/source-import.d.ts +1 -1
- package/dist/{labs/compiler → compiler}/preprocess/source-import.js +1 -1
- package/dist/compiler/types/index.d.ts +2 -0
- package/dist/compiler/types/index.js +1 -0
- package/dist/components/accordion/accordion.svelte +117 -23
- package/dist/components/accordion/accordion.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/accordion/accordion.types.d.ts +1 -1
- package/dist/components/accordion/modules/accordion-item.svelte +207 -60
- package/dist/components/accordion/modules/accordion-item.svelte.d.ts +1 -1
- package/dist/components/alert/alert.svelte +247 -50
- package/dist/components/alert/alert.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/alert/alert.types.d.ts +1 -1
- package/dist/components/app/app.svelte +141 -74
- package/dist/components/app/app.svelte.d.ts +4 -2
- package/dist/components/appbar/appbar.svelte +174 -18
- package/dist/components/appbar/appbar.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/appbar/appbar.types.d.ts +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +122 -17
- package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +2 -2
- package/dist/{labs/components → components}/aspect-ratio/aspect-ratio.types.d.ts +1 -1
- package/dist/components/avatar/avatar.svelte +127 -28
- package/dist/components/avatar/avatar.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/avatar/avatar.types.d.ts +1 -1
- package/dist/{labs/components → components}/btn/btn.svelte +3 -3
- package/dist/{labs/components → components}/btn/btn.types.d.ts +1 -1
- package/dist/components/card/card.svelte +265 -45
- package/dist/components/card/card.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/card/card.types.d.ts +1 -1
- package/dist/components/chip/chip.svelte +465 -95
- package/dist/components/chip/chip.svelte.d.ts +2 -2
- package/dist/{labs/components → components}/chip/chip.types.d.ts +1 -1
- package/dist/components/dialog/dialog.svelte +238 -43
- package/dist/components/dialog/dialog.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/dialog/dialog.types.d.ts +1 -1
- package/dist/components/dropdown/dropdown.svelte +185 -51
- package/dist/components/dropdown/dropdown.svelte.d.ts +2 -2
- package/dist/{labs/components → components}/dropdown/dropdown.types.d.ts +1 -1
- package/dist/components/icon/icon.svelte +177 -40
- package/dist/components/icon/icon.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/icon/icon.types.d.ts +1 -1
- package/dist/components/index.d.ts +23 -22
- package/dist/components/index.js +23 -22
- package/dist/components/list/list.svelte +172 -26
- package/dist/components/list/list.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/list/list.types.d.ts +1 -1
- package/dist/components/list/modules/list-item.svelte +171 -52
- package/dist/components/list/modules/list-item.svelte.d.ts +1 -1
- package/dist/components/modal/modal.svelte +249 -44
- package/dist/components/modal/modal.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/modal/modal.types.d.ts +1 -1
- package/dist/components/popover/popover.svelte +145 -30
- package/dist/components/popover/popover.svelte.d.ts +2 -2
- package/dist/{labs/components → components}/popover/popover.types.d.ts +1 -1
- package/dist/components/separator/separator.svelte +116 -20
- package/dist/components/separator/separator.svelte.d.ts +2 -2
- package/dist/{labs/components → components}/separator/separator.types.d.ts +1 -1
- package/dist/{labs/components → components}/sheet/sheet.svelte +2 -2
- package/dist/components/spacer/spacer.svelte +40 -3
- package/dist/components/spacer/spacer.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/spacer/spacer.types.d.ts +1 -1
- package/dist/components/textfield/textfield.svelte +473 -79
- package/dist/components/textfield/textfield.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/textfield/textfield.types.d.ts +1 -1
- package/dist/components/toolbar/toolbar.svelte +237 -22
- package/dist/components/toolbar/toolbar.svelte.d.ts +1 -1
- package/dist/{labs/components → components}/toolbar/toolbar.types.d.ts +1 -1
- package/dist/components/tooltip/tooltip.svelte +312 -53
- package/dist/components/tooltip/tooltip.svelte.d.ts +2 -2
- package/dist/{labs/components → components}/tooltip/tooltip.types.d.ts +1 -1
- package/dist/entry-bundler.d.ts +1 -1
- package/dist/entry-bundler.js +1 -1
- package/dist/{labs/utils → utils}/components.d.ts +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/{labs/utils → utils}/outside.d.ts +1 -1
- package/dist/{labs/utils → utils}/types/index.d.ts +1 -1
- package/package.json +17 -17
- package/dist/labs/compiler/index.d.ts +0 -1
- package/dist/labs/compiler/index.js +0 -1
- package/dist/labs/compiler/preprocess/index.d.ts +0 -1
- package/dist/labs/compiler/preprocess/index.js +0 -1
- package/dist/labs/compiler/types/index.d.ts +0 -2
- package/dist/labs/compiler/types/index.js +0 -1
- package/dist/labs/components/accordion/accordion.svelte +0 -133
- package/dist/labs/components/accordion/modules/accordion-item.svelte +0 -241
- package/dist/labs/components/alert/alert.svelte +0 -286
- package/dist/labs/components/app/app.svelte +0 -146
- package/dist/labs/components/app/app.svelte.d.ts +0 -6
- package/dist/labs/components/appbar/appbar.svelte +0 -196
- package/dist/labs/components/aspect-ratio/aspect-ratio.svelte +0 -130
- package/dist/labs/components/avatar/avatar.svelte +0 -145
- package/dist/labs/components/card/card.svelte +0 -287
- package/dist/labs/components/chip/chip.svelte +0 -501
- package/dist/labs/components/dialog/dialog.svelte +0 -262
- package/dist/labs/components/dropdown/dropdown.svelte +0 -249
- package/dist/labs/components/icon/icon.svelte +0 -186
- package/dist/labs/components/index.d.ts +0 -23
- package/dist/labs/components/index.js +0 -24
- package/dist/labs/components/list/list.svelte +0 -190
- package/dist/labs/components/list/modules/list-item.svelte +0 -195
- package/dist/labs/components/modal/modal.svelte +0 -317
- package/dist/labs/components/popover/popover.svelte +0 -188
- package/dist/labs/components/separator/separator.svelte +0 -133
- package/dist/labs/components/spacer/spacer.svelte +0 -44
- package/dist/labs/components/textfield/textfield.svelte +0 -587
- package/dist/labs/components/toolbar/toolbar.svelte +0 -262
- package/dist/labs/components/tooltip/tooltip.svelte +0 -372
- package/dist/labs/utils/index.d.ts +0 -2
- package/dist/labs/utils/index.js +0 -2
- /package/dist/{actions → @legacy/actions}/accordion.svelte.d.ts +0 -0
- /package/dist/{actions → @legacy/actions}/accordion.svelte.js +0 -0
- /package/dist/{actions → @legacy/actions}/index.d.ts +0 -0
- /package/dist/{actions → @legacy/actions}/index.js +0 -0
- /package/dist/{actions → @legacy/actions}/use-theme.d.ts +0 -0
- /package/dist/{actions → @legacy/actions}/use-theme.js +0 -0
- /package/dist/{assets → @legacy/assets}/icons/arrow-down.svelte +0 -0
- /package/dist/{assets → @legacy/assets}/icons/arrow-down.svelte.d.ts +0 -0
- /package/dist/{assets → @legacy/assets}/icons/arrow-up.svelte +0 -0
- /package/dist/{assets → @legacy/assets}/icons/arrow-up.svelte.d.ts +0 -0
- /package/dist/{assets → @legacy/assets}/icons/close-fill.svelte +0 -0
- /package/dist/{assets → @legacy/assets}/icons/close-fill.svelte.d.ts +0 -0
- /package/dist/{assets → @legacy/assets}/icons/loading-fill.svelte +0 -0
- /package/dist/{assets → @legacy/assets}/icons/loading-fill.svelte.d.ts +0 -0
- /package/dist/{components → @legacy/components}/accordion/accordion.css +0 -0
- /package/dist/{components → @legacy/components}/accordion/modules/accordion-item.css +0 -0
- /package/dist/{components → @legacy/components}/accordion/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/accordion/types.js +0 -0
- /package/dist/{components → @legacy/components}/alert/alert.css +0 -0
- /package/dist/{components → @legacy/components}/alert/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/alert/types.js +0 -0
- /package/dist/{components → @legacy/components}/app/app.css +0 -0
- /package/dist/{components → @legacy/components}/app/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/app/types.js +0 -0
- /package/dist/{components → @legacy/components}/appbar/appbar.css +0 -0
- /package/dist/{components → @legacy/components}/appbar/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/appbar/types.js +0 -0
- /package/dist/{components → @legacy/components}/aspect-ratio/aspect-ratio.css +0 -0
- /package/dist/{components → @legacy/components}/aspect-ratio/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/aspect-ratio/types.js +0 -0
- /package/dist/{components → @legacy/components}/avatar/avatar.css +0 -0
- /package/dist/{components → @legacy/components}/avatar/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/avatar/types.js +0 -0
- /package/dist/{components → @legacy/components}/button/button.css +0 -0
- /package/dist/{components → @legacy/components}/button/button.svelte +0 -0
- /package/dist/{components → @legacy/components}/button/button.svelte.d.ts +0 -0
- /package/dist/{components → @legacy/components}/button/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/button/types.js +0 -0
- /package/dist/{components → @legacy/components}/card/card.css +0 -0
- /package/dist/{components → @legacy/components}/card/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/card/types.js +0 -0
- /package/dist/{components → @legacy/components}/chip/chip.css +0 -0
- /package/dist/{components → @legacy/components}/chip/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/chip/types.js +0 -0
- /package/dist/{components → @legacy/components}/dialog/dialog.css +0 -0
- /package/dist/{components → @legacy/components}/dialog/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/dialog/types.js +0 -0
- /package/dist/{components → @legacy/components}/dropdown/dropdown.css +0 -0
- /package/dist/{components → @legacy/components}/dropdown/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/dropdown/types.js +0 -0
- /package/dist/{components → @legacy/components}/icon/icon.css +0 -0
- /package/dist/{components → @legacy/components}/icon/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/icon/types.js +0 -0
- /package/dist/{components → @legacy/components}/list/list.css +0 -0
- /package/dist/{components → @legacy/components}/list/modules/list-item.css +0 -0
- /package/dist/{components → @legacy/components}/list/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/list/types.js +0 -0
- /package/dist/{components → @legacy/components}/modal/modal.css +0 -0
- /package/dist/{components → @legacy/components}/modal/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/modal/types.js +0 -0
- /package/dist/{components → @legacy/components}/popover/popover.css +0 -0
- /package/dist/{components → @legacy/components}/popover/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/popover/types.js +0 -0
- /package/dist/{components → @legacy/components}/separator/separator.css +0 -0
- /package/dist/{components → @legacy/components}/separator/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/separator/types.js +0 -0
- /package/dist/{components → @legacy/components}/spacer/spacer.css +0 -0
- /package/dist/{components → @legacy/components}/spacer/types.js +0 -0
- /package/dist/{components → @legacy/components}/textfield/textfield.css +0 -0
- /package/dist/{components → @legacy/components}/textfield/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/textfield/types.js +0 -0
- /package/dist/{components → @legacy/components}/toolbar/toolbar.css +0 -0
- /package/dist/{components → @legacy/components}/toolbar/types.d.ts +0 -0
- /package/dist/{components → @legacy/components}/toolbar/types.js +0 -0
- /package/dist/{components → @legacy/components}/tooltip/tooltip.css +0 -0
- /package/dist/{components → @legacy/components}/tooltip/types.js +0 -0
- /package/dist/{index.d.ts → @legacy/index.d.ts} +0 -0
- /package/dist/{index.js → @legacy/index.js} +0 -0
- /package/dist/{internal → @legacy/internal}/config/presets.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/config/presets.js +0 -0
- /package/dist/{internal → @legacy/internal}/config/variables.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/config/variables.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/assets.svelte.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/assets.svelte.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/dropdown.svelte.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/dropdown.svelte.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/popover.svelte.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/popover.svelte.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/tooltip.svelte.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/actions/tooltip.svelte.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/animations/ripple.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/animations/ripple.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/bin/ansi.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/bin/ansi.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/bin/terminal.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/bin/terminal.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/css.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/css.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/component.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/component.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/device.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/device.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/index.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/index.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/style.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/style.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/theme.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/theme.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/typography.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/formatter/typography.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/minify.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/minify.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/standard-colors.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/standard-colors.js +0 -0
- /package/dist/{internal → @legacy/internal}/core/x11-colors.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/core/x11-colors.js +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/colors.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/colors.js +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/convert.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/convert.js +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/deep-merge.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/deep-merge.js +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/outside.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/outside.js +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/parser.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/parser.js +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/scroll.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/helpers/scroll.js +0 -0
- /package/dist/{internal → @legacy/internal}/plugins/vite.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/plugins/vite.js +0 -0
- /package/dist/{internal → @legacy/internal}/types/components.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/types/components.js +0 -0
- /package/dist/{internal → @legacy/internal}/types/configuration.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/types/configuration.js +0 -0
- /package/dist/{internal → @legacy/internal}/types/index.d.ts +0 -0
- /package/dist/{internal → @legacy/internal}/types/index.js +0 -0
- /package/dist/{stores → @legacy/stores}/breakpoints.d.ts +0 -0
- /package/dist/{stores → @legacy/stores}/breakpoints.js +0 -0
- /package/dist/{stores → @legacy/stores}/components.d.ts +0 -0
- /package/dist/{stores → @legacy/stores}/components.js +0 -0
- /package/dist/{stores → @legacy/stores}/devices.d.ts +0 -0
- /package/dist/{stores → @legacy/stores}/devices.js +0 -0
- /package/dist/{stores → @legacy/stores}/index.d.ts +0 -0
- /package/dist/{stores → @legacy/stores}/index.js +0 -0
- /package/dist/{stores → @legacy/stores}/themes.d.ts +0 -0
- /package/dist/{stores → @legacy/stores}/themes.js +0 -0
- /package/dist/{stores → @legacy/stores}/viewport.d.ts +0 -0
- /package/dist/{stores → @legacy/stores}/viewport.js +0 -0
- /package/dist/{styles → @legacy/styles}/animation.css +0 -0
- /package/dist/{styles → @legacy/styles}/keyframes.css +0 -0
- /package/dist/{styles → @legacy/styles}/reset.css +0 -0
- /package/dist/{styles.css → @legacy/styles.css} +0 -0
- /package/dist/{styles.css.d.ts → @legacy/styles.css.d.ts} +0 -0
- /package/dist/{themes.css → @legacy/themes.css} +0 -0
- /package/dist/{themes.css.d.ts → @legacy/themes.css.d.ts} +0 -0
- /package/dist/{labs/animations → animations}/index.d.ts +0 -0
- /package/dist/{labs/animations → animations}/index.js +0 -0
- /package/dist/{labs/animations → animations}/ripple.js +0 -0
- /package/dist/{labs/assets → assets}/icon.svg +0 -0
- /package/dist/{labs/compiler → compiler}/components.d.ts +0 -0
- /package/dist/{labs/compiler → compiler}/components.js +0 -0
- /package/dist/{labs/compiler → compiler}/mapped-code.js +0 -0
- /package/dist/{labs/compiler → compiler}/plugins.d.ts +0 -0
- /package/dist/{labs/compiler → compiler}/plugins.js +0 -0
- /package/dist/{labs/compiler → compiler}/preprocess/finding.d.ts +0 -0
- /package/dist/{labs/compiler → compiler}/preprocess/finding.js +0 -0
- /package/dist/{labs/compiler → compiler}/types/dom.d.ts +0 -0
- /package/dist/{labs/compiler → compiler}/types/dom.js +0 -0
- /package/dist/{labs/compiler → compiler}/types/options.d.ts +0 -0
- /package/dist/{labs/compiler → compiler}/types/options.js +0 -0
- /package/dist/{labs/components → components}/accordion/accordion.types.js +0 -0
- /package/dist/{labs/components → components}/alert/alert.types.js +0 -0
- /package/dist/{labs/components → components}/appbar/appbar.types.js +0 -0
- /package/dist/{labs/components → components}/aspect-ratio/aspect-ratio.types.js +0 -0
- /package/dist/{labs/components → components}/avatar/avatar.types.js +0 -0
- /package/dist/{labs/components → components}/btn/btn.svelte.d.ts +0 -0
- /package/dist/{labs/components → components}/btn/btn.types.js +0 -0
- /package/dist/{labs/components → components}/card/card.types.js +0 -0
- /package/dist/{labs/components → components}/chip/chip.types.js +0 -0
- /package/dist/{labs/components → components}/dialog/dialog.types.js +0 -0
- /package/dist/{labs/components → components}/dropdown/dropdown.svelte.js +0 -0
- /package/dist/{labs/components → components}/dropdown/dropdown.types.js +0 -0
- /package/dist/{labs/components → components}/icon/icon.types.js +0 -0
- /package/dist/{labs/components → components}/list/list.types.js +0 -0
- /package/dist/{labs/components → components}/modal/modal.types.js +0 -0
- /package/dist/{labs/components → components}/popover/popover.svelte.js +0 -0
- /package/dist/{labs/components → components}/popover/popover.types.js +0 -0
- /package/dist/{labs/components → components}/separator/separator.types.js +0 -0
- /package/dist/{labs/components → components}/sheet/sheet.svelte.d.ts +0 -0
- /package/dist/{labs/components → components}/spacer/spacer.types.js +0 -0
- /package/dist/{labs/components → components}/textfield/textfield.types.js +0 -0
- /package/dist/{labs/components → components}/toolbar/toolbar.types.js +0 -0
- /package/dist/{labs/components → components}/tooltip/tooltip.svelte.js +0 -0
- /package/dist/{labs/components → components}/tooltip/tooltip.types.js +0 -0
- /package/dist/{labs/utils → utils}/components.js +0 -0
- /package/dist/{labs/utils → utils}/outside.js +0 -0
- /package/dist/{labs/utils → utils}/types/index.js +0 -0
|
@@ -1,79 +1,146 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import { useTheme } from '../../actions/use-theme.js';
|
|
4
|
-
import { modalOpen, setOpenModal } from '../../stores/components.js';
|
|
5
|
-
|
|
6
|
-
import { viewport } from '../../stores/viewport.js';
|
|
7
|
-
import type { AppProps } from './types.js';
|
|
8
|
-
|
|
9
|
-
let {
|
|
10
|
-
ref = $bindable(),
|
|
11
|
-
children,
|
|
12
|
-
themes,
|
|
13
|
-
storageKey = '@lapikit/theme',
|
|
14
|
-
light,
|
|
15
|
-
dark,
|
|
16
|
-
...rest
|
|
17
|
-
}: AppProps = $props();
|
|
18
|
-
|
|
19
|
-
$effect.pre(() => {
|
|
20
|
-
if (!BROWSER) return;
|
|
21
|
-
const colorScheme = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
22
|
-
? 'dark'
|
|
23
|
-
: 'light';
|
|
24
|
-
const localTheme = localStorage.getItem(storageKey);
|
|
25
|
-
|
|
26
|
-
if (localTheme) {
|
|
27
|
-
useTheme(localTheme);
|
|
28
|
-
} else if (colorScheme) {
|
|
29
|
-
if (typeof themes === 'string') {
|
|
30
|
-
useTheme(themes);
|
|
31
|
-
} else if (typeof themes === 'object' && Array.isArray(themes)) {
|
|
32
|
-
if (colorScheme === 'dark') useTheme(themes[1] ?? themes[0]);
|
|
33
|
-
else useTheme(themes[0]);
|
|
34
|
-
} else {
|
|
35
|
-
useTheme(colorScheme);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Met à jour le store viewport à l'init et sur resize
|
|
40
|
-
function updateViewport() {
|
|
41
|
-
viewport.set({
|
|
42
|
-
innerWidth: window.innerWidth,
|
|
43
|
-
outerWidth: window.outerWidth,
|
|
44
|
-
innerHeight: window.innerHeight,
|
|
45
|
-
outerHeight: window.outerHeight
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
updateViewport();
|
|
49
|
-
window.addEventListener('resize', updateViewport);
|
|
50
|
-
return () => {
|
|
51
|
-
window.removeEventListener('resize', updateViewport);
|
|
52
|
-
};
|
|
53
|
-
});
|
|
2
|
+
let { ref = $bindable(), children, ...rest } = $props();
|
|
54
3
|
</script>
|
|
55
4
|
|
|
56
|
-
<div
|
|
57
|
-
id="kit-app"
|
|
58
|
-
bind:this={ref}
|
|
59
|
-
{...rest}
|
|
60
|
-
class={[
|
|
61
|
-
'kit-application',
|
|
62
|
-
light && 'light',
|
|
63
|
-
dark && 'dark',
|
|
64
|
-
light && 'kit-theme--light',
|
|
65
|
-
dark && 'kit-theme--dark',
|
|
66
|
-
rest.class
|
|
67
|
-
]}
|
|
68
|
-
>
|
|
5
|
+
<div id="kit-app" bind:this={ref} {...rest} class={['kit-application', rest.class]}>
|
|
69
6
|
{@render children?.()}
|
|
70
|
-
|
|
71
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
72
|
-
{#if $modalOpen}
|
|
73
|
-
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
74
|
-
<div
|
|
75
|
-
class={['kit-overlay', $modalOpen === 'persistent' && 'kit-overlay--persistent']}
|
|
76
|
-
onclick={() => $modalOpen !== 'persistent' && setOpenModal(false)}
|
|
77
|
-
></div>
|
|
78
|
-
{/if}
|
|
79
7
|
</div>
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
:root {
|
|
11
|
+
color-scheme: light;
|
|
12
|
+
|
|
13
|
+
--kit-h-neutral: 220;
|
|
14
|
+
--kit-h-success: 145;
|
|
15
|
+
--kit-h-warning: 35;
|
|
16
|
+
--kit-h-danger: 5;
|
|
17
|
+
--kit-h-info: 205;
|
|
18
|
+
|
|
19
|
+
--kit-bg: hsl(0 0% 100%);
|
|
20
|
+
--kit-fg: hsl(222 20% 10%);
|
|
21
|
+
--kit-muted: hsl(220 10% 45%);
|
|
22
|
+
|
|
23
|
+
--kit-surface-1: hsl(0 0% 100%);
|
|
24
|
+
--kit-surface-2: hsl(220 20% 98%);
|
|
25
|
+
--kit-surface-3: hsl(220 18% 94%);
|
|
26
|
+
|
|
27
|
+
--kit-border: hsl(220 16% 88%);
|
|
28
|
+
|
|
29
|
+
--kit-accent: hsl(220 90% 56%);
|
|
30
|
+
|
|
31
|
+
--kit-radius-1: 8px;
|
|
32
|
+
--kit-radius-2: 12px;
|
|
33
|
+
--kit-space-1: 6px;
|
|
34
|
+
--kit-space-2: 10px;
|
|
35
|
+
--kit-space-3: 14px;
|
|
36
|
+
|
|
37
|
+
--kit-focus: hsl(35, 90%, 56%);
|
|
38
|
+
|
|
39
|
+
--kit-disabled-opacity: 0.55;
|
|
40
|
+
|
|
41
|
+
--kit-font:
|
|
42
|
+
ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
43
|
+
'Segoe UI Symbol', 'Noto Color Emoji';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:root {
|
|
47
|
+
--kit-neutral-bg: color-mix(in oklab, var(--kit-neutral), var(--kit-bg) 85%);
|
|
48
|
+
--kit-neutral-bd: color-mix(in oklab, var(--kit-neutral), var(--kit-border) 70%);
|
|
49
|
+
--kit-neutral-fg: var(--kit-fg);
|
|
50
|
+
|
|
51
|
+
--kit-success-bg: color-mix(in oklab, var(--kit-success), var(--kit-bg) 85%);
|
|
52
|
+
--kit-success-bd: color-mix(in oklab, var(--kit-success), var(--kit-border) 70%);
|
|
53
|
+
--kit-success-fg: var(--kit-fg);
|
|
54
|
+
|
|
55
|
+
--kit-warning-bg: color-mix(in oklab, var(--kit-warning), var(--kit-bg) 85%);
|
|
56
|
+
--kit-warning-bd: color-mix(in oklab, var(--kit-warning), var(--kit-border) 70%);
|
|
57
|
+
--kit-warning-fg: var(--kit-fg);
|
|
58
|
+
|
|
59
|
+
--kit-danger-bg: color-mix(in oklab, var(--kit-danger), var(--kit-bg) 85%);
|
|
60
|
+
--kit-danger-bd: color-mix(in oklab, var(--kit-danger), var(--kit-border) 70%);
|
|
61
|
+
--kit-danger-fg: var(--kit-fg);
|
|
62
|
+
|
|
63
|
+
--kit-info-bg: color-mix(in oklab, var(--kit-info), var(--kit-bg) 85%);
|
|
64
|
+
--kit-info-bd: color-mix(in oklab, var(--kit-info), var(--kit-border) 70%);
|
|
65
|
+
--kit-info-fg: var(--kit-fg);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:root {
|
|
69
|
+
--kit-outline-w: 1px;
|
|
70
|
+
--btn-radius: 8px;
|
|
71
|
+
|
|
72
|
+
--kit-btn-gap: 8px;
|
|
73
|
+
|
|
74
|
+
--bg: #111827;
|
|
75
|
+
--fg: #ffffff;
|
|
76
|
+
--bg-hover: #0b1220;
|
|
77
|
+
--border: rgba(255, 255, 255, 0.08);
|
|
78
|
+
--focus: blue;
|
|
79
|
+
--font:
|
|
80
|
+
ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
81
|
+
'Segoe UI Symbol', 'Noto Color Emoji';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:global(.outline) {
|
|
85
|
+
--container-shape-start-start: var(--btn-radius);
|
|
86
|
+
--container-shape-start-end: var(--btn-radius);
|
|
87
|
+
--container-shape-end-start: var(--btn-radius);
|
|
88
|
+
--container-shape-end-end: var(--btn-radius);
|
|
89
|
+
|
|
90
|
+
border-width: var(--kit-outline-w);
|
|
91
|
+
inset: 0;
|
|
92
|
+
border-style: solid;
|
|
93
|
+
position: absolute;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
border-color: var(--outline-color);
|
|
96
|
+
z-index: 1;
|
|
97
|
+
border-start-start-radius: var(--container-shape-start-start);
|
|
98
|
+
border-start-end-radius: var(--container-shape-start-end);
|
|
99
|
+
border-end-start-radius: var(--container-shape-end-start);
|
|
100
|
+
border-end-end-radius: var(--container-shape-end-end);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:global(.kit-ripple) {
|
|
104
|
+
background-color: currentColor;
|
|
105
|
+
opacity: 0.1;
|
|
106
|
+
position: absolute;
|
|
107
|
+
border-radius: 50%;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
-webkit-transition: 0.6s;
|
|
110
|
+
transition: 0.6s;
|
|
111
|
+
-webkit-animation: animation-l-ripple var(--system-animation-ripple-duration, 0.4s)
|
|
112
|
+
cubic-bezier(0.4, 0, 0.2, 1);
|
|
113
|
+
animation: animation-l-ripple var(--system-animation-ripple-duration, 0.4s)
|
|
114
|
+
cubic-bezier(0.4, 0, 0.2, 1);
|
|
115
|
+
border-radius: var(--system-ripple-radius);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:global(.kit-ripple--center) {
|
|
119
|
+
top: 50% !important;
|
|
120
|
+
left: 50% !important;
|
|
121
|
+
translate: -50% -50% !important;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:global(.kit-ripple--effect) {
|
|
125
|
+
position: absolute;
|
|
126
|
+
left: 0;
|
|
127
|
+
right: 0;
|
|
128
|
+
top: 0;
|
|
129
|
+
bottom: 0;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
background: none;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
z-index: 999;
|
|
134
|
+
border-radius: var(--system-ripple-radius);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@keyframes -global-animation-l-ripple {
|
|
138
|
+
from {
|
|
139
|
+
scale: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
to {
|
|
143
|
+
scale: 1;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const App: import("svelte").Component<{
|
|
2
|
+
ref?: any;
|
|
3
|
+
children: any;
|
|
4
|
+
} & Record<string, any>, {}, "ref">;
|
|
3
5
|
type App = ReturnType<typeof App>;
|
|
4
6
|
export default App;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { useClassName, useStyles } from '../../utils';
|
|
3
|
+
import { makeComponentProps } from '../../compiler/mapped-code';
|
|
4
|
+
import type { AppbarProps } from './appbar.types.js';
|
|
4
5
|
|
|
5
6
|
let {
|
|
6
|
-
children,
|
|
7
7
|
ref = $bindable(),
|
|
8
8
|
is = 'header',
|
|
9
|
+
children,
|
|
10
|
+
class: className = '',
|
|
11
|
+
style: styleAttr = '',
|
|
12
|
+
's-class': sClass,
|
|
13
|
+
's-style': sStyle,
|
|
9
14
|
classContent,
|
|
10
|
-
light,
|
|
11
|
-
dark,
|
|
15
|
+
light = false,
|
|
16
|
+
dark = false,
|
|
17
|
+
variant = 'outline',
|
|
12
18
|
rounded,
|
|
13
19
|
background,
|
|
14
20
|
color,
|
|
@@ -16,25 +22,175 @@
|
|
|
16
22
|
...rest
|
|
17
23
|
}: AppbarProps = $props();
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
let safeVariant = $derived(
|
|
26
|
+
typeof variant === 'string' && (variant === 'outline' || variant === 'text')
|
|
27
|
+
? variant
|
|
28
|
+
: 'outline'
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
let safeDensity = $derived(
|
|
32
|
+
typeof density === 'string' &&
|
|
33
|
+
(density === 'compact' || density === 'comfortable' || density === 'default')
|
|
34
|
+
? density
|
|
35
|
+
: 'default'
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
let { classProps, styleProps, restProps } = $derived(
|
|
39
|
+
makeComponentProps(rest as Record<string, unknown>)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
let componentClass = $derived(
|
|
43
|
+
useClassName({
|
|
44
|
+
baseClass: 'kit-appbar',
|
|
45
|
+
className: `${className ?? ''}`.trim(),
|
|
46
|
+
sClass,
|
|
47
|
+
classProps
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
let normalizedClassContent = $derived(
|
|
52
|
+
Array.isArray(classContent) ? classContent.filter(Boolean).join(' ') : classContent
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
let wrapperClass = $derived(
|
|
56
|
+
useClassName({
|
|
57
|
+
baseClass: 'kit-appbar__wrapper',
|
|
58
|
+
className: normalizedClassContent
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
let componentStyle = $derived(
|
|
63
|
+
useStyles({
|
|
64
|
+
styleAttr,
|
|
65
|
+
sStyle,
|
|
66
|
+
styleProps
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
let mergedStyle = $derived(
|
|
71
|
+
[
|
|
72
|
+
componentStyle,
|
|
73
|
+
background ? `--kit-appbar-background:${background}` : '',
|
|
74
|
+
color ? `--kit-appbar-color:${color}` : '',
|
|
75
|
+
typeof rounded === 'string' && rounded.includes('px') ? `--kit-appbar-radius:${rounded}` : ''
|
|
76
|
+
]
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.join('; ')
|
|
79
|
+
);
|
|
20
80
|
</script>
|
|
21
81
|
|
|
22
82
|
<svelte:element
|
|
23
83
|
this={is}
|
|
24
84
|
bind:this={ref}
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
style:--appbar-background={assets.color(background)}
|
|
34
|
-
style:--appbar-color={assets.color(color)}
|
|
35
|
-
style:--appbar-shape={assets.shape(rounded)}
|
|
85
|
+
class={componentClass}
|
|
86
|
+
style={mergedStyle}
|
|
87
|
+
{...restProps}
|
|
88
|
+
data-variant={safeVariant}
|
|
89
|
+
data-density={safeDensity}
|
|
90
|
+
data-light={light || undefined}
|
|
91
|
+
data-dark={dark || undefined}
|
|
92
|
+
data-rounded={rounded}
|
|
36
93
|
>
|
|
37
|
-
|
|
94
|
+
{#if safeVariant === 'outline'}
|
|
95
|
+
<span class="outline"></span>
|
|
96
|
+
{/if}
|
|
97
|
+
|
|
98
|
+
<div class={wrapperClass}>
|
|
38
99
|
{@render children?.()}
|
|
39
100
|
</div>
|
|
40
101
|
</svelte:element>
|
|
102
|
+
|
|
103
|
+
<style>
|
|
104
|
+
.kit-appbar {
|
|
105
|
+
--kit-appbar-background: var(--kit-surface-2);
|
|
106
|
+
--kit-appbar-color: var(--kit-fg);
|
|
107
|
+
--kit-appbar-radius: 1rem;
|
|
108
|
+
--kit-appbar-size: 4rem;
|
|
109
|
+
--kit-appbar-padding-x: 1rem;
|
|
110
|
+
--kit-appbar-padding-wrapper: 0;
|
|
111
|
+
--kit-appbar-border: color-mix(in oklab, var(--kit-appbar-color), transparent 88%);
|
|
112
|
+
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
position: relative;
|
|
117
|
+
width: 100%;
|
|
118
|
+
min-height: var(--kit-appbar-size);
|
|
119
|
+
padding-inline: var(--kit-appbar-padding-x);
|
|
120
|
+
border-radius: var(--kit-appbar-radius);
|
|
121
|
+
color: var(--kit-appbar-color);
|
|
122
|
+
background-color: var(--kit-appbar-background);
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.kit-appbar[data-variant='text'] {
|
|
127
|
+
--kit-appbar-border: transparent;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.kit-appbar[data-density='compact'] {
|
|
131
|
+
--kit-appbar-size: 3.5rem;
|
|
132
|
+
--kit-appbar-padding-x: 0.75rem;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.kit-appbar[data-density='default'] {
|
|
136
|
+
--kit-appbar-size: 4rem;
|
|
137
|
+
--kit-appbar-padding-x: 1rem;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.kit-appbar[data-density='comfortable'] {
|
|
141
|
+
--kit-appbar-size: 4.5rem;
|
|
142
|
+
--kit-appbar-padding-x: 1.5rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.kit-appbar[data-light='true'] {
|
|
146
|
+
--kit-appbar-background: color-mix(in oklab, white 88%, var(--kit-surface-1));
|
|
147
|
+
--kit-appbar-color: var(--kit-fg);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.kit-appbar[data-dark='true'] {
|
|
151
|
+
--kit-appbar-background: color-mix(in oklab, black 72%, var(--kit-surface-3));
|
|
152
|
+
--kit-appbar-color: white;
|
|
153
|
+
--kit-appbar-border: color-mix(in oklab, white, transparent 78%);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.kit-appbar[data-rounded='0'] {
|
|
157
|
+
--kit-appbar-radius: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.kit-appbar[data-rounded='xs'] {
|
|
161
|
+
--kit-appbar-radius: 2px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.kit-appbar[data-rounded='sm'] {
|
|
165
|
+
--kit-appbar-radius: 4px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.kit-appbar[data-rounded='md'] {
|
|
169
|
+
--kit-appbar-radius: 8px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.kit-appbar[data-rounded='lg'] {
|
|
173
|
+
--kit-appbar-radius: 16px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.kit-appbar[data-rounded='xl'] {
|
|
177
|
+
--kit-appbar-radius: 99999px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.kit-appbar__wrapper {
|
|
181
|
+
position: relative;
|
|
182
|
+
z-index: 1;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
flex-direction: row;
|
|
186
|
+
gap: 0.75rem;
|
|
187
|
+
width: 100%;
|
|
188
|
+
margin: 0 auto;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.kit-appbar .outline {
|
|
192
|
+
--outline-color: var(--kit-appbar-border);
|
|
193
|
+
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
}
|
|
196
|
+
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, RoundedType } from '../../utils/types
|
|
1
|
+
import type { Component, RoundedType } from '../../utils/types';
|
|
2
2
|
type Density = 'compact' | 'comfortable' | 'default';
|
|
3
3
|
type Variant = 'outline' | 'text';
|
|
4
4
|
export interface AppbarProps extends Component {
|
|
@@ -1,25 +1,130 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { useClassName, useStyles } from '../../utils';
|
|
3
|
+
import { makeComponentProps } from '../../compiler/mapped-code';
|
|
4
|
+
import type { AspectRatioFit, AspectRatioProps, AspectRatioValue } from './aspect-ratio.types.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const FALLBACK_RATIO = 16 / 9;
|
|
7
|
+
const FALLBACK_FIT: AspectRatioFit = 'cover';
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
paddingBottom = (height / width) * 100;
|
|
9
|
+
function resolveRatio(value: AspectRatioValue | undefined): number {
|
|
10
|
+
if (typeof value === 'number') {
|
|
11
|
+
return Number.isFinite(value) && value > 0 ? value : FALLBACK_RATIO;
|
|
11
12
|
}
|
|
12
|
-
});
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const [width, height] = aspectRatio.split('/').map(Number);
|
|
17
|
-
paddingBottom = (height / width) * 100;
|
|
14
|
+
if (typeof value !== 'string') {
|
|
15
|
+
return FALLBACK_RATIO;
|
|
18
16
|
}
|
|
19
|
-
|
|
17
|
+
|
|
18
|
+
const normalized = value.trim();
|
|
19
|
+
if (!normalized) {
|
|
20
|
+
return FALLBACK_RATIO;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (normalized.includes('/') || normalized.includes(':')) {
|
|
24
|
+
const separator = normalized.includes('/') ? '/' : ':';
|
|
25
|
+
const [w, h] = normalized.split(separator).map((part) => Number(part.trim()));
|
|
26
|
+
|
|
27
|
+
if (Number.isFinite(w) && Number.isFinite(h) && w > 0 && h > 0) {
|
|
28
|
+
return w / h;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const asNumber = Number(normalized);
|
|
33
|
+
return Number.isFinite(asNumber) && asNumber > 0 ? asNumber : FALLBACK_RATIO;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function resolveFit(value: AspectRatioFit | undefined): AspectRatioFit {
|
|
37
|
+
return value === 'cover' || value === 'contain' || value === 'fill' ? value : FALLBACK_FIT;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let {
|
|
41
|
+
ref = $bindable(),
|
|
42
|
+
is = 'div',
|
|
43
|
+
children = undefined,
|
|
44
|
+
class: className = '',
|
|
45
|
+
style: styleAttr = '',
|
|
46
|
+
's-class': sClass,
|
|
47
|
+
's-style': sStyle,
|
|
48
|
+
ratio = undefined,
|
|
49
|
+
aspectRatio = undefined,
|
|
50
|
+
fit = 'cover',
|
|
51
|
+
inline = false,
|
|
52
|
+
...rest
|
|
53
|
+
}: AspectRatioProps = $props();
|
|
54
|
+
|
|
55
|
+
let { classProps, styleProps, restProps } = $derived(
|
|
56
|
+
makeComponentProps(rest as Record<string, unknown>)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
let componentClass = $derived(
|
|
60
|
+
useClassName({
|
|
61
|
+
baseClass: 'kit-aspect-ratio',
|
|
62
|
+
className: `${className ?? ''}`.trim(),
|
|
63
|
+
sClass,
|
|
64
|
+
classProps
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
let componentStyle = $derived(
|
|
69
|
+
useStyles({
|
|
70
|
+
styleAttr,
|
|
71
|
+
sStyle,
|
|
72
|
+
styleProps
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
let resolvedRatio = $derived(resolveRatio(ratio ?? aspectRatio));
|
|
77
|
+
let resolvedFit = $derived(resolveFit(fit));
|
|
78
|
+
let mergedStyle = $derived(
|
|
79
|
+
[componentStyle, `--kit-aspect-ratio: ${resolvedRatio}`, `--kit-aspect-fit: ${resolvedFit}`]
|
|
80
|
+
.filter(Boolean)
|
|
81
|
+
.join('; ')
|
|
82
|
+
);
|
|
20
83
|
</script>
|
|
21
84
|
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
|
|
85
|
+
<svelte:element
|
|
86
|
+
this={is}
|
|
87
|
+
bind:this={ref}
|
|
88
|
+
class={componentClass}
|
|
89
|
+
style={mergedStyle}
|
|
90
|
+
data-inline={inline}
|
|
91
|
+
{...restProps}
|
|
92
|
+
>
|
|
93
|
+
<div class="kit-aspect-ratio__inner">
|
|
94
|
+
{@render children?.()}
|
|
95
|
+
</div>
|
|
96
|
+
</svelte:element>
|
|
97
|
+
|
|
98
|
+
<style>
|
|
99
|
+
.kit-aspect-ratio {
|
|
100
|
+
display: block;
|
|
101
|
+
position: relative;
|
|
102
|
+
width: 100%;
|
|
103
|
+
max-width: 100%;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
aspect-ratio: var(--kit-aspect-ratio, 1.7777777778);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.kit-aspect-ratio[data-inline='true'] {
|
|
109
|
+
display: inline-block;
|
|
110
|
+
width: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.kit-aspect-ratio__inner {
|
|
114
|
+
position: absolute;
|
|
115
|
+
inset: 0;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.kit-aspect-ratio :global(img),
|
|
121
|
+
.kit-aspect-ratio :global(video),
|
|
122
|
+
.kit-aspect-ratio :global(iframe),
|
|
123
|
+
.kit-aspect-ratio :global(canvas),
|
|
124
|
+
.kit-aspect-ratio :global(svg) {
|
|
125
|
+
display: block;
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 100%;
|
|
128
|
+
object-fit: var(--kit-aspect-fit, cover);
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const AspectRatio: import("svelte").Component<
|
|
1
|
+
import type { AspectRatioProps } from './aspect-ratio.types.ts';
|
|
2
|
+
declare const AspectRatio: import("svelte").Component<AspectRatioProps, {}, "ref">;
|
|
3
3
|
type AspectRatio = ReturnType<typeof AspectRatio>;
|
|
4
4
|
export default AspectRatio;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from '../../utils/types
|
|
1
|
+
import type { Component } from '../../utils/types';
|
|
2
2
|
export type AspectRatioValue = string | number;
|
|
3
3
|
export type AspectRatioFit = 'cover' | 'contain' | 'fill';
|
|
4
4
|
export interface AspectRatioProps extends Component {
|