@und-ui/core 0.1.0 → 0.2.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/README.md +6 -0
- package/custom-elements.json +45231 -9574
- package/dist/alert-dialog.d.ts +9 -0
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +9 -0
- package/dist/alert-dialog.js.map +1 -0
- package/dist/all.d.ts +69 -0
- package/dist/all.d.ts.map +1 -1
- package/dist/all.js +70 -0
- package/dist/all.js.map +1 -1
- package/dist/app-shell.d.ts +2 -0
- package/dist/app-shell.d.ts.map +1 -0
- package/dist/app-shell.js +8 -0
- package/dist/app-shell.js.map +1 -0
- package/dist/aspect-ratio.d.ts +2 -0
- package/dist/aspect-ratio.d.ts.map +1 -0
- package/dist/aspect-ratio.js +8 -0
- package/dist/aspect-ratio.js.map +1 -0
- package/dist/autoloader.d.ts +9 -0
- package/dist/autoloader.js +135 -0
- package/dist/banner.d.ts +2 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +8 -0
- package/dist/banner.js.map +1 -0
- package/dist/blockquote.d.ts +2 -0
- package/dist/blockquote.d.ts.map +1 -0
- package/dist/blockquote.js +8 -0
- package/dist/blockquote.js.map +1 -0
- package/dist/bottom-sheet.d.ts +2 -0
- package/dist/bottom-sheet.d.ts.map +1 -0
- package/dist/bottom-sheet.js +8 -0
- package/dist/bottom-sheet.js.map +1 -0
- package/dist/button-group.d.ts +2 -0
- package/dist/button-group.d.ts.map +1 -0
- package/dist/button-group.js +8 -0
- package/dist/button-group.js.map +1 -0
- package/dist/calendar.d.ts +2 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +8 -0
- package/dist/calendar.js.map +1 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +8 -0
- package/dist/carousel.js.map +1 -0
- package/dist/cdn/accordion.js +1 -0
- package/dist/cdn/alert.js +177 -0
- package/dist/cdn/all.js +12500 -0
- package/dist/cdn/app-shell.js +170 -0
- package/dist/cdn/aspect-ratio.js +62 -0
- package/dist/cdn/autoloader.js +1 -0
- package/dist/cdn/avatar-group.js +76 -0
- package/dist/cdn/avatar.js +1 -0
- package/dist/cdn/badge.js +139 -0
- package/dist/cdn/banner.js +197 -0
- package/dist/cdn/blockquote.js +51 -0
- package/dist/cdn/bottom-sheet.js +92 -0
- package/dist/cdn/breadcrumb-item.js +1 -0
- package/dist/cdn/breadcrumb.js +1 -0
- package/dist/cdn/button-group.js +1 -0
- package/dist/cdn/button.js +1 -0
- package/dist/cdn/calendar.js +1 -0
- package/dist/cdn/card.js +1 -0
- package/dist/cdn/carousel.js +227 -0
- package/dist/cdn/center.js +38 -0
- package/dist/cdn/chat-composer.js +235 -0
- package/dist/cdn/chat-layout.js +146 -0
- package/dist/cdn/chat-message.js +304 -0
- package/dist/cdn/checkbox-list.js +118 -0
- package/dist/cdn/checkbox.js +1 -0
- package/dist/cdn/chunks/2GOGJDSU.js +47 -0
- package/dist/cdn/chunks/2ILG5UCH.js +320 -0
- package/dist/cdn/chunks/2JGSCE32.js +1 -0
- package/dist/cdn/chunks/2NKWY2MD.js +1 -0
- package/dist/cdn/chunks/2POJ73H3.js +127 -0
- package/dist/cdn/chunks/2ZNYEI2K.js +153 -0
- package/dist/cdn/chunks/4V5OZW5S.js +138 -0
- package/dist/cdn/chunks/53R7LH57.js +1 -0
- package/dist/cdn/chunks/5RXWAJYI.js +209 -0
- package/dist/cdn/chunks/6PVRHMKB.js +136 -0
- package/dist/cdn/chunks/7FX3ODJD.js +1 -0
- package/dist/cdn/chunks/7Q37LUBP.js +1 -0
- package/dist/cdn/chunks/7ZRZJJTR.js +1 -0
- package/dist/cdn/chunks/AFVQZOYK.js +1 -0
- package/dist/cdn/chunks/AH74TYPT.js +1 -0
- package/dist/cdn/chunks/ASRBZKJQ.js +110 -0
- package/dist/cdn/chunks/BC5GCW6V.js +70 -0
- package/dist/cdn/chunks/BZSCKO2L.js +498 -0
- package/dist/cdn/chunks/CQAYRYSN.js +183 -0
- package/dist/cdn/chunks/DDMOITKE.js +1 -0
- package/dist/cdn/chunks/DLMHPPVT.js +9 -0
- package/dist/cdn/chunks/E4ULE3CZ.js +28 -0
- package/dist/cdn/chunks/ERZVCCWG.js +1 -0
- package/dist/cdn/chunks/EXHS4XM7.js +75 -0
- package/dist/cdn/chunks/F4UDAUDP.js +95 -0
- package/dist/cdn/chunks/FQ5Z2ADE.js +1 -0
- package/dist/cdn/chunks/FRDRK7S4.js +192 -0
- package/dist/cdn/chunks/FVWYLBE6.js +1 -0
- package/dist/cdn/chunks/G2MFKC6X.js +1 -0
- package/dist/cdn/chunks/GBWHWWM7.js +1 -0
- package/dist/cdn/chunks/GVFRCF4L.js +1 -0
- package/dist/cdn/chunks/H3EXQADC.js +1 -0
- package/dist/cdn/chunks/HJLUTHQ4.js +28 -0
- package/dist/cdn/chunks/HQG5G3NW.js +294 -0
- package/dist/cdn/chunks/IRDJ2SED.js +227 -0
- package/dist/cdn/chunks/ITULBQXQ.js +77 -0
- package/dist/cdn/chunks/IYPIGVNK.js +1 -0
- package/dist/cdn/chunks/JFRG4OYS.js +174 -0
- package/dist/cdn/chunks/JIAFHSB3.js +1 -0
- package/dist/cdn/chunks/JSGBG32L.js +1 -0
- package/dist/cdn/chunks/JTCY7VA6.js +16 -0
- package/dist/cdn/chunks/KJKMJ4CJ.js +1 -0
- package/dist/cdn/chunks/LAHY3QCY.js +1 -0
- package/dist/cdn/chunks/LILDP4YG.js +228 -0
- package/dist/cdn/chunks/LUMZDQSN.js +1 -0
- package/dist/cdn/chunks/MCMKNHE4.js +243 -0
- package/dist/cdn/chunks/MQR6SWE3.js +1 -0
- package/dist/cdn/chunks/NBCCLQGT.js +2 -0
- package/dist/cdn/chunks/NOAT4MJU.js +1 -0
- package/dist/cdn/chunks/NSGFRI4V.js +1 -0
- package/dist/cdn/chunks/PFTG732C.js +120 -0
- package/dist/cdn/chunks/PYS73CGQ.js +1 -0
- package/dist/cdn/chunks/QFHEFAZM.js +228 -0
- package/dist/cdn/chunks/QSGNQDXL.js +83 -0
- package/dist/cdn/chunks/QXFKH4UN.js +80 -0
- package/dist/cdn/chunks/R7XE3NCT.js +104 -0
- package/dist/cdn/chunks/RBKCBV34.js +10 -0
- package/dist/cdn/chunks/RDI7SHXP.js +161 -0
- package/dist/cdn/chunks/U7MPBIQK.js +15 -0
- package/dist/cdn/chunks/VJW5CINE.js +289 -0
- package/dist/cdn/chunks/VWGB35YM.js +1 -0
- package/dist/cdn/chunks/W3C5YK34.js +25 -0
- package/dist/cdn/chunks/WPLY7F3R.js +1 -0
- package/dist/cdn/chunks/XDXEEO2D.js +189 -0
- package/dist/cdn/chunks/YCLUSLYF.js +155 -0
- package/dist/cdn/chunks/YTJ6WTZW.js +253 -0
- package/dist/cdn/chunks/YUWOEVYA.js +19 -0
- package/dist/cdn/chunks/YYIQMFRC.js +168 -0
- package/dist/cdn/chunks/Z5CQ6NOH.js +1 -0
- package/dist/cdn/citation.js +98 -0
- package/dist/cdn/clickable-card.js +31 -0
- package/dist/cdn/code-block.js +231 -0
- package/dist/cdn/code.js +28 -0
- package/dist/cdn/collapsible.js +11 -0
- package/dist/cdn/combobox.js +1 -0
- package/dist/cdn/command-palette.js +234 -0
- package/dist/cdn/context-menu.js +15 -0
- package/dist/cdn/date-input.js +1 -0
- package/dist/cdn/date-range-input.js +1 -0
- package/dist/cdn/date-time-input.js +9 -0
- package/dist/cdn/dialog.js +1 -0
- package/dist/cdn/divider.js +74 -0
- package/dist/cdn/drawer.js +1 -0
- package/dist/cdn/empty-state.js +99 -0
- package/dist/cdn/file-input.js +190 -0
- package/dist/cdn/form-field.js +13 -0
- package/dist/cdn/form-layout.js +66 -0
- package/dist/cdn/grid-item.js +1 -0
- package/dist/cdn/grid.js +62 -0
- package/dist/cdn/heading.js +57 -0
- package/dist/cdn/hover-card.js +7 -0
- package/dist/cdn/icon-button.js +37 -0
- package/dist/cdn/icon.js +52 -0
- package/dist/cdn/info-tip.js +94 -0
- package/dist/cdn/input-group.js +64 -0
- package/dist/cdn/kbd.js +36 -0
- package/dist/cdn/lightbox.js +259 -0
- package/dist/cdn/link.js +160 -0
- package/dist/cdn/list-item.js +1 -0
- package/dist/cdn/list.js +1 -0
- package/dist/cdn/markdown.js +1 -0
- package/dist/cdn/menu-group.js +1 -0
- package/dist/cdn/menu-item.js +1 -0
- package/dist/cdn/menu-separator.js +1 -0
- package/dist/cdn/menu.js +1 -0
- package/dist/cdn/metadata-item.js +1 -0
- package/dist/cdn/metadata-list.js +1 -0
- package/dist/cdn/mobile-nav.js +88 -0
- package/dist/cdn/more-menu.js +58 -0
- package/dist/cdn/multi-select.js +70 -0
- package/dist/cdn/number-input.js +103 -0
- package/dist/cdn/outline.js +100 -0
- package/dist/cdn/overflow-list.js +124 -0
- package/dist/cdn/pagination.js +181 -0
- package/dist/cdn/popover.js +1 -0
- package/dist/cdn/progress.js +180 -0
- package/dist/cdn/radio-group.js +1 -0
- package/dist/cdn/radio-list.js +76 -0
- package/dist/cdn/radio.js +1 -0
- package/dist/cdn/resize-handle.js +73 -0
- package/dist/cdn/scroll-area.js +79 -0
- package/dist/cdn/section.js +36 -0
- package/dist/cdn/segmented-control-item.js +1 -0
- package/dist/cdn/segmented-control.js +1 -0
- package/dist/cdn/select.js +43 -0
- package/dist/cdn/selectable-card.js +161 -0
- package/dist/cdn/side-nav-heading.js +1 -0
- package/dist/cdn/side-nav-item.js +1 -0
- package/dist/cdn/side-nav-section.js +1 -0
- package/dist/cdn/side-nav.js +1 -0
- package/dist/cdn/skeleton.js +80 -0
- package/dist/cdn/slider.js +182 -0
- package/dist/cdn/spinner.js +65 -0
- package/dist/cdn/stack.js +72 -0
- package/dist/cdn/status-dot.js +66 -0
- package/dist/cdn/step.js +1 -0
- package/dist/cdn/stepper.js +1 -0
- package/dist/cdn/switch.js +178 -0
- package/dist/cdn/tab-menu.js +121 -0
- package/dist/cdn/tab-panel.js +1 -0
- package/dist/cdn/tab.js +1 -0
- package/dist/cdn/table.js +365 -0
- package/dist/cdn/tabs.js +1 -0
- package/dist/cdn/text-field.js +1 -0
- package/dist/cdn/text.js +102 -0
- package/dist/cdn/textarea.js +102 -0
- package/dist/cdn/thumbnail.js +92 -0
- package/dist/cdn/time-input.js +1 -0
- package/dist/cdn/timer.js +33 -0
- package/dist/cdn/timestamp.js +16 -0
- package/dist/cdn/toast.js +1 -0
- package/dist/cdn/toaster.js +1 -0
- package/dist/cdn/toggle-button-group.js +1 -0
- package/dist/cdn/token.js +1 -0
- package/dist/cdn/tokenizer.js +181 -0
- package/dist/cdn/toolbar.js +37 -0
- package/dist/cdn/tooltip.js +50 -0
- package/dist/cdn/top-nav-item.js +1 -0
- package/dist/cdn/top-nav-menu.js +1 -0
- package/dist/cdn/top-nav.js +1 -0
- package/dist/cdn/tree-item.js +1 -0
- package/dist/cdn/tree-list.js +1 -0
- package/dist/cdn/typeahead.js +1 -0
- package/dist/cdn/visually-hidden.js +18 -0
- package/dist/center.d.ts +2 -0
- package/dist/center.d.ts.map +1 -0
- package/dist/center.js +8 -0
- package/dist/center.js.map +1 -0
- package/dist/chat-composer.d.ts +2 -0
- package/dist/chat-composer.d.ts.map +1 -0
- package/dist/chat-composer.js +8 -0
- package/dist/chat-composer.js.map +1 -0
- package/dist/chat-layout.d.ts +2 -0
- package/dist/chat-layout.d.ts.map +1 -0
- package/dist/chat-layout.js +8 -0
- package/dist/chat-layout.js.map +1 -0
- package/dist/chat-message.d.ts +2 -0
- package/dist/chat-message.d.ts.map +1 -0
- package/dist/chat-message.js +11 -0
- package/dist/chat-message.js.map +1 -0
- package/dist/checkbox-list.d.ts +3 -0
- package/dist/checkbox-list.d.ts.map +1 -0
- package/dist/checkbox-list.js +11 -0
- package/dist/checkbox-list.js.map +1 -0
- package/dist/citation.d.ts +2 -0
- package/dist/citation.d.ts.map +1 -0
- package/dist/citation.js +8 -0
- package/dist/citation.js.map +1 -0
- package/dist/clickable-card.d.ts +2 -0
- package/dist/clickable-card.d.ts.map +1 -0
- package/dist/clickable-card.js +8 -0
- package/dist/clickable-card.js.map +1 -0
- package/dist/code-block.d.ts +2 -0
- package/dist/code-block.d.ts.map +1 -0
- package/dist/code-block.js +8 -0
- package/dist/code-block.js.map +1 -0
- package/dist/code.d.ts +2 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +8 -0
- package/dist/code.js.map +1 -0
- package/dist/collapsible.d.ts +2 -0
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +8 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/command-palette.d.ts +2 -0
- package/dist/command-palette.d.ts.map +1 -0
- package/dist/command-palette.js +8 -0
- package/dist/command-palette.js.map +1 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +26 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog/alert-dialog.js +79 -0
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +102 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +285 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +45 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +105 -0
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -0
- package/dist/components/banner/banner.d.ts +111 -0
- package/dist/components/banner/banner.d.ts.map +1 -0
- package/dist/components/banner/banner.js +287 -0
- package/dist/components/banner/banner.js.map +1 -0
- package/dist/components/blockquote/blockquote.d.ts +42 -0
- package/dist/components/blockquote/blockquote.d.ts.map +1 -0
- package/dist/components/blockquote/blockquote.js +90 -0
- package/dist/components/blockquote/blockquote.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +128 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.js +279 -0
- package/dist/components/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.d.ts +7 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.d.ts.map +1 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js +83 -0
- package/dist/components/bottom-sheet/bottom-sheet.styles.js.map +1 -0
- package/dist/components/button-group/button-group.d.ts +60 -0
- package/dist/components/button-group/button-group.d.ts.map +1 -0
- package/dist/components/button-group/button-group.js +126 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/calendar/calendar.d.ts +163 -0
- package/dist/components/calendar/calendar.d.ts.map +1 -0
- package/dist/components/calendar/calendar.js +411 -0
- package/dist/components/calendar/calendar.js.map +1 -0
- package/dist/components/calendar/calendar.styles.d.ts +3 -0
- package/dist/components/calendar/calendar.styles.d.ts.map +1 -0
- package/dist/components/calendar/calendar.styles.js +219 -0
- package/dist/components/calendar/calendar.styles.js.map +1 -0
- package/dist/components/card/card.d.ts +6 -2
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +19 -11
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/carousel/carousel.d.ts +171 -0
- package/dist/components/carousel/carousel.d.ts.map +1 -0
- package/dist/components/carousel/carousel.js +340 -0
- package/dist/components/carousel/carousel.js.map +1 -0
- package/dist/components/carousel/carousel.styles.d.ts +3 -0
- package/dist/components/carousel/carousel.styles.d.ts.map +1 -0
- package/dist/components/carousel/carousel.styles.js +171 -0
- package/dist/components/carousel/carousel.styles.js.map +1 -0
- package/dist/components/center/center.d.ts +50 -0
- package/dist/components/center/center.d.ts.map +1 -0
- package/dist/components/center/center.js +69 -0
- package/dist/components/center/center.js.map +1 -0
- package/dist/components/chat/chat-composer.d.ts +172 -0
- package/dist/components/chat/chat-composer.d.ts.map +1 -0
- package/dist/components/chat/chat-composer.js +252 -0
- package/dist/components/chat/chat-composer.js.map +1 -0
- package/dist/components/chat/chat-composer.styles.d.ts +5 -0
- package/dist/components/chat/chat-composer.styles.d.ts.map +1 -0
- package/dist/components/chat/chat-composer.styles.js +206 -0
- package/dist/components/chat/chat-composer.styles.js.map +1 -0
- package/dist/components/chat/chat-layout.d.ts +112 -0
- package/dist/components/chat/chat-layout.d.ts.map +1 -0
- package/dist/components/chat/chat-layout.js +204 -0
- package/dist/components/chat/chat-layout.js.map +1 -0
- package/dist/components/chat/chat-layout.styles.d.ts +3 -0
- package/dist/components/chat/chat-layout.styles.d.ts.map +1 -0
- package/dist/components/chat/chat-layout.styles.js +114 -0
- package/dist/components/chat/chat-layout.styles.js.map +1 -0
- package/dist/components/chat/chat-message.d.ts +164 -0
- package/dist/components/chat/chat-message.d.ts.map +1 -0
- package/dist/components/chat/chat-message.js +257 -0
- package/dist/components/chat/chat-message.js.map +1 -0
- package/dist/components/chat/chat-message.styles.d.ts +3 -0
- package/dist/components/chat/chat-message.styles.d.ts.map +1 -0
- package/dist/components/chat/chat-message.styles.js +249 -0
- package/dist/components/chat/chat-message.styles.js.map +1 -0
- package/dist/components/checkbox-list/checkbox-list.d.ts +109 -0
- package/dist/components/checkbox-list/checkbox-list.d.ts.map +1 -0
- package/dist/components/checkbox-list/checkbox-list.js +230 -0
- package/dist/components/checkbox-list/checkbox-list.js.map +1 -0
- package/dist/components/checkbox-list/checkbox-list.styles.d.ts +3 -0
- package/dist/components/checkbox-list/checkbox-list.styles.d.ts.map +1 -0
- package/dist/components/checkbox-list/checkbox-list.styles.js +104 -0
- package/dist/components/checkbox-list/checkbox-list.styles.js.map +1 -0
- package/dist/components/citation/citation.d.ts +81 -0
- package/dist/components/citation/citation.d.ts.map +1 -0
- package/dist/components/citation/citation.js +173 -0
- package/dist/components/citation/citation.js.map +1 -0
- package/dist/components/clickable-card/clickable-card.d.ts +61 -0
- package/dist/components/clickable-card/clickable-card.d.ts.map +1 -0
- package/dist/components/clickable-card/clickable-card.js +84 -0
- package/dist/components/clickable-card/clickable-card.js.map +1 -0
- package/dist/components/code/code.d.ts +28 -0
- package/dist/components/code/code.d.ts.map +1 -0
- package/dist/components/code/code.js +52 -0
- package/dist/components/code/code.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +183 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.js +237 -0
- package/dist/components/code-block/code-block.js.map +1 -0
- package/dist/components/code-block/code-block.styles.d.ts +11 -0
- package/dist/components/code-block/code-block.styles.d.ts.map +1 -0
- package/dist/components/code-block/code-block.styles.js +194 -0
- package/dist/components/code-block/code-block.styles.js.map +1 -0
- package/dist/components/collapsible/collapsible.d.ts +57 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.js +95 -0
- package/dist/components/collapsible/collapsible.js.map +1 -0
- package/dist/components/collapsible/collapsible.styles.d.ts +10 -0
- package/dist/components/collapsible/collapsible.styles.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.styles.js +22 -0
- package/dist/components/collapsible/collapsible.styles.js.map +1 -0
- package/dist/components/command-palette/command-palette.d.ts +188 -0
- package/dist/components/command-palette/command-palette.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.js +367 -0
- package/dist/components/command-palette/command-palette.js.map +1 -0
- package/dist/components/command-palette/command-palette.styles.d.ts +6 -0
- package/dist/components/command-palette/command-palette.styles.d.ts.map +1 -0
- package/dist/components/command-palette/command-palette.styles.js +173 -0
- package/dist/components/command-palette/command-palette.styles.js.map +1 -0
- package/dist/components/context-menu/context-menu.d.ts +79 -0
- package/dist/components/context-menu/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu/context-menu.js +144 -0
- package/dist/components/context-menu/context-menu.js.map +1 -0
- package/dist/components/context-menu/context-menu.styles.d.ts +3 -0
- package/dist/components/context-menu/context-menu.styles.d.ts.map +1 -0
- package/dist/components/context-menu/context-menu.styles.js +18 -0
- package/dist/components/context-menu/context-menu.styles.js.map +1 -0
- package/dist/components/date-input/date-input.d.ts +150 -0
- package/dist/components/date-input/date-input.d.ts.map +1 -0
- package/dist/components/date-input/date-input.js +273 -0
- package/dist/components/date-input/date-input.js.map +1 -0
- package/dist/components/date-range-input/date-range-input.d.ts +158 -0
- package/dist/components/date-range-input/date-range-input.d.ts.map +1 -0
- package/dist/components/date-range-input/date-range-input.js +387 -0
- package/dist/components/date-range-input/date-range-input.js.map +1 -0
- package/dist/components/date-time-input/date-time-input.d.ts +178 -0
- package/dist/components/date-time-input/date-time-input.d.ts.map +1 -0
- package/dist/components/date-time-input/date-time-input.js +276 -0
- package/dist/components/date-time-input/date-time-input.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +13 -1
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +36 -24
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/empty-state/empty-state.d.ts +57 -0
- package/dist/components/empty-state/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state.js +162 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/file-input/file-input.d.ts +122 -0
- package/dist/components/file-input/file-input.d.ts.map +1 -0
- package/dist/components/file-input/file-input.js +364 -0
- package/dist/components/file-input/file-input.js.map +1 -0
- package/dist/components/file-input/file-input.styles.d.ts +3 -0
- package/dist/components/file-input/file-input.styles.d.ts.map +1 -0
- package/dist/components/file-input/file-input.styles.js +195 -0
- package/dist/components/file-input/file-input.styles.js.map +1 -0
- package/dist/components/form-layout/form-layout.d.ts +40 -0
- package/dist/components/form-layout/form-layout.d.ts.map +1 -0
- package/dist/components/form-layout/form-layout.js +41 -0
- package/dist/components/form-layout/form-layout.js.map +1 -0
- package/dist/components/form-layout/form-layout.styles.d.ts +3 -0
- package/dist/components/form-layout/form-layout.styles.d.ts.map +1 -0
- package/dist/components/form-layout/form-layout.styles.js +71 -0
- package/dist/components/form-layout/form-layout.styles.js.map +1 -0
- package/dist/components/grid/grid-item.d.ts +36 -0
- package/dist/components/grid/grid-item.d.ts.map +1 -0
- package/dist/components/grid/grid-item.js +42 -0
- package/dist/components/grid/grid-item.js.map +1 -0
- package/dist/components/grid/grid.d.ts +69 -0
- package/dist/components/grid/grid.d.ts.map +1 -0
- package/dist/components/grid/grid.js +97 -0
- package/dist/components/grid/grid.js.map +1 -0
- package/dist/components/heading/heading.d.ts +61 -0
- package/dist/components/heading/heading.d.ts.map +1 -0
- package/dist/components/heading/heading.js +50 -0
- package/dist/components/heading/heading.js.map +1 -0
- package/dist/components/heading/heading.styles.d.ts +6 -0
- package/dist/components/heading/heading.styles.d.ts.map +1 -0
- package/dist/components/heading/heading.styles.js +64 -0
- package/dist/components/heading/heading.styles.js.map +1 -0
- package/dist/components/hover-card/hover-card.d.ts +116 -0
- package/dist/components/hover-card/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card/hover-card.js +291 -0
- package/dist/components/hover-card/hover-card.js.map +1 -0
- package/dist/components/icon/icon-registry.d.ts +60 -0
- package/dist/components/icon/icon-registry.d.ts.map +1 -0
- package/dist/components/icon/icon-registry.js +136 -0
- package/dist/components/icon/icon-registry.js.map +1 -0
- package/dist/components/icon/icon.d.ts +84 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +126 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/info-tip/info-tip.d.ts +73 -0
- package/dist/components/info-tip/info-tip.d.ts.map +1 -0
- package/dist/components/info-tip/info-tip.js +184 -0
- package/dist/components/info-tip/info-tip.js.map +1 -0
- package/dist/components/input-group/input-group.d.ts +41 -0
- package/dist/components/input-group/input-group.d.ts.map +1 -0
- package/dist/components/input-group/input-group.js +79 -0
- package/dist/components/input-group/input-group.js.map +1 -0
- package/dist/components/input-group/input-group.styles.d.ts +3 -0
- package/dist/components/input-group/input-group.styles.d.ts.map +1 -0
- package/dist/components/input-group/input-group.styles.js +69 -0
- package/dist/components/input-group/input-group.styles.js.map +1 -0
- package/dist/components/kbd/kbd.d.ts +31 -0
- package/dist/components/kbd/kbd.d.ts.map +1 -0
- package/dist/components/kbd/kbd.js +63 -0
- package/dist/components/kbd/kbd.js.map +1 -0
- package/dist/components/lightbox/lightbox.d.ts +167 -0
- package/dist/components/lightbox/lightbox.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.js +272 -0
- package/dist/components/lightbox/lightbox.js.map +1 -0
- package/dist/components/lightbox/lightbox.styles.d.ts +7 -0
- package/dist/components/lightbox/lightbox.styles.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.styles.js +188 -0
- package/dist/components/lightbox/lightbox.styles.js.map +1 -0
- package/dist/components/list/list-item.d.ts +52 -0
- package/dist/components/list/list-item.d.ts.map +1 -0
- package/dist/components/list/list-item.js +131 -0
- package/dist/components/list/list-item.js.map +1 -0
- package/dist/components/list/list.d.ts +53 -0
- package/dist/components/list/list.d.ts.map +1 -0
- package/dist/components/list/list.js +77 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/markdown/markdown.d.ts +103 -0
- package/dist/components/markdown/markdown.d.ts.map +1 -0
- package/dist/components/markdown/markdown.js +111 -0
- package/dist/components/markdown/markdown.js.map +1 -0
- package/dist/components/markdown/markdown.styles.d.ts +6 -0
- package/dist/components/markdown/markdown.styles.d.ts.map +1 -0
- package/dist/components/markdown/markdown.styles.js +178 -0
- package/dist/components/markdown/markdown.styles.js.map +1 -0
- package/dist/components/markdown/parser.d.ts +67 -0
- package/dist/components/markdown/parser.d.ts.map +1 -0
- package/dist/components/markdown/parser.js +511 -0
- package/dist/components/markdown/parser.js.map +1 -0
- package/dist/components/markdown/render.d.ts +15 -0
- package/dist/components/markdown/render.d.ts.map +1 -0
- package/dist/components/markdown/render.js +170 -0
- package/dist/components/markdown/render.js.map +1 -0
- package/dist/components/menu/menu.d.ts +21 -2
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/menu/menu.js +83 -15
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/metadata-list/metadata-item.d.ts +35 -0
- package/dist/components/metadata-list/metadata-item.d.ts.map +1 -0
- package/dist/components/metadata-list/metadata-item.js +39 -0
- package/dist/components/metadata-list/metadata-item.js.map +1 -0
- package/dist/components/metadata-list/metadata-list.d.ts +65 -0
- package/dist/components/metadata-list/metadata-list.d.ts.map +1 -0
- package/dist/components/metadata-list/metadata-list.js +151 -0
- package/dist/components/metadata-list/metadata-list.js.map +1 -0
- package/dist/components/mobile-nav/mobile-nav.d.ts +91 -0
- package/dist/components/mobile-nav/mobile-nav.d.ts.map +1 -0
- package/dist/components/mobile-nav/mobile-nav.js +138 -0
- package/dist/components/mobile-nav/mobile-nav.js.map +1 -0
- package/dist/components/mobile-nav/mobile-nav.styles.d.ts +3 -0
- package/dist/components/mobile-nav/mobile-nav.styles.d.ts.map +1 -0
- package/dist/components/mobile-nav/mobile-nav.styles.js +57 -0
- package/dist/components/mobile-nav/mobile-nav.styles.js.map +1 -0
- package/dist/components/more-menu/more-menu.d.ts +57 -0
- package/dist/components/more-menu/more-menu.d.ts.map +1 -0
- package/dist/components/more-menu/more-menu.js +59 -0
- package/dist/components/more-menu/more-menu.js.map +1 -0
- package/dist/components/more-menu/more-menu.styles.d.ts +3 -0
- package/dist/components/more-menu/more-menu.styles.d.ts.map +1 -0
- package/dist/components/more-menu/more-menu.styles.js +50 -0
- package/dist/components/more-menu/more-menu.styles.js.map +1 -0
- package/dist/components/multi-select/multi-select.d.ts +211 -0
- package/dist/components/multi-select/multi-select.d.ts.map +1 -0
- package/dist/components/multi-select/multi-select.js +562 -0
- package/dist/components/multi-select/multi-select.js.map +1 -0
- package/dist/components/multi-select/multi-select.styles.d.ts +6 -0
- package/dist/components/multi-select/multi-select.styles.d.ts.map +1 -0
- package/dist/components/multi-select/multi-select.styles.js +27 -0
- package/dist/components/multi-select/multi-select.styles.js.map +1 -0
- package/dist/components/number-input/number-format.d.ts +38 -0
- package/dist/components/number-input/number-format.d.ts.map +1 -0
- package/dist/components/number-input/number-format.js +114 -0
- package/dist/components/number-input/number-format.js.map +1 -0
- package/dist/components/number-input/number-input.d.ts +204 -0
- package/dist/components/number-input/number-input.d.ts.map +1 -0
- package/dist/components/number-input/number-input.js +470 -0
- package/dist/components/number-input/number-input.js.map +1 -0
- package/dist/components/number-input/number-input.styles.d.ts +3 -0
- package/dist/components/number-input/number-input.styles.d.ts.map +1 -0
- package/dist/components/number-input/number-input.styles.js +108 -0
- package/dist/components/number-input/number-input.styles.js.map +1 -0
- package/dist/components/outline/outline.d.ts +117 -0
- package/dist/components/outline/outline.d.ts.map +1 -0
- package/dist/components/outline/outline.js +283 -0
- package/dist/components/outline/outline.js.map +1 -0
- package/dist/components/outline/outline.styles.d.ts +7 -0
- package/dist/components/outline/outline.styles.d.ts.map +1 -0
- package/dist/components/outline/outline.styles.js +92 -0
- package/dist/components/outline/outline.styles.js.map +1 -0
- package/dist/components/overflow-list/overflow-list.d.ts +78 -0
- package/dist/components/overflow-list/overflow-list.d.ts.map +1 -0
- package/dist/components/overflow-list/overflow-list.js +211 -0
- package/dist/components/overflow-list/overflow-list.js.map +1 -0
- package/dist/components/overflow-list/overflow-list.styles.d.ts +3 -0
- package/dist/components/overflow-list/overflow-list.styles.d.ts.map +1 -0
- package/dist/components/overflow-list/overflow-list.styles.js +112 -0
- package/dist/components/overflow-list/overflow-list.styles.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/pagination/pagination.js +2 -2
- package/dist/components/radio-group/radio-group.d.ts +6 -2
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +8 -2
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/radio-group/radio.d.ts +6 -2
- package/dist/components/radio-group/radio.d.ts.map +1 -1
- package/dist/components/radio-group/radio.js +14 -6
- package/dist/components/radio-group/radio.js.map +1 -1
- package/dist/components/radio-list/radio-list.d.ts +33 -0
- package/dist/components/radio-list/radio-list.d.ts.map +1 -0
- package/dist/components/radio-list/radio-list.js +32 -0
- package/dist/components/radio-list/radio-list.js.map +1 -0
- package/dist/components/radio-list/radio-list.styles.d.ts +3 -0
- package/dist/components/radio-list/radio-list.styles.d.ts.map +1 -0
- package/dist/components/radio-list/radio-list.styles.js +81 -0
- package/dist/components/radio-list/radio-list.styles.js.map +1 -0
- package/dist/components/resize-handle/resize-handle.d.ts +130 -0
- package/dist/components/resize-handle/resize-handle.d.ts.map +1 -0
- package/dist/components/resize-handle/resize-handle.js +343 -0
- package/dist/components/resize-handle/resize-handle.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +63 -0
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area/scroll-area.js +186 -0
- package/dist/components/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/section/section.d.ts +62 -0
- package/dist/components/section/section.d.ts.map +1 -0
- package/dist/components/section/section.js +88 -0
- package/dist/components/section/section.js.map +1 -0
- package/dist/components/segmented-control/segmented-control.d.ts +69 -0
- package/dist/components/segmented-control/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control/segmented-control.js +206 -0
- package/dist/components/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/segmented-control/segmented-control.styles.d.ts +3 -0
- package/dist/components/segmented-control/segmented-control.styles.d.ts.map +1 -0
- package/dist/components/segmented-control/segmented-control.styles.js +149 -0
- package/dist/components/segmented-control/segmented-control.styles.js.map +1 -0
- package/dist/components/selectable-card/selectable-card.d.ts +55 -0
- package/dist/components/selectable-card/selectable-card.d.ts.map +1 -0
- package/dist/components/selectable-card/selectable-card.js +122 -0
- package/dist/components/selectable-card/selectable-card.js.map +1 -0
- package/dist/components/selectable-card/selectable-card.styles.d.ts +3 -0
- package/dist/components/selectable-card/selectable-card.styles.d.ts.map +1 -0
- package/dist/components/selectable-card/selectable-card.styles.js +166 -0
- package/dist/components/selectable-card/selectable-card.styles.js.map +1 -0
- package/dist/components/shared/calendar-picker.d.ts +47 -0
- package/dist/components/shared/calendar-picker.d.ts.map +1 -0
- package/dist/components/shared/calendar-picker.js +154 -0
- package/dist/components/shared/calendar-picker.js.map +1 -0
- package/dist/components/shared/date-check.d.ts +18 -0
- package/dist/components/shared/date-check.d.ts.map +1 -0
- package/dist/components/shared/date-check.js +44 -0
- package/dist/components/shared/date-check.js.map +1 -0
- package/dist/components/shared/date-field.styles.d.ts +3 -0
- package/dist/components/shared/date-field.styles.d.ts.map +1 -0
- package/dist/components/shared/date-field.styles.js +158 -0
- package/dist/components/shared/date-field.styles.js.map +1 -0
- package/dist/components/shared/date-strings.d.ts +51 -0
- package/dist/components/shared/date-strings.d.ts.map +1 -0
- package/dist/components/shared/date-strings.js +44 -0
- package/dist/components/shared/date-strings.js.map +1 -0
- package/dist/components/shared/date-utils.d.ts +90 -0
- package/dist/components/shared/date-utils.d.ts.map +1 -0
- package/dist/components/shared/date-utils.js +305 -0
- package/dist/components/shared/date-utils.js.map +1 -0
- package/dist/components/shared/heading-tag.d.ts +10 -0
- package/dist/components/shared/heading-tag.d.ts.map +1 -0
- package/dist/components/shared/heading-tag.js +27 -0
- package/dist/components/shared/heading-tag.js.map +1 -0
- package/dist/components/shared/host-aria.d.ts +15 -0
- package/dist/components/shared/host-aria.d.ts.map +1 -0
- package/dist/components/shared/host-aria.js +48 -0
- package/dist/components/shared/host-aria.js.map +1 -0
- package/dist/components/shared/indic.d.ts +15 -0
- package/dist/components/shared/indic.d.ts.map +1 -0
- package/dist/components/shared/indic.js +33 -0
- package/dist/components/shared/indic.js.map +1 -0
- package/dist/components/shared/layout.d.ts +8 -0
- package/dist/components/shared/layout.d.ts.map +1 -0
- package/dist/components/shared/layout.js +36 -0
- package/dist/components/shared/layout.js.map +1 -0
- package/dist/components/shared/status-icons.d.ts +8 -0
- package/dist/components/shared/status-icons.d.ts.map +1 -0
- package/dist/components/shared/status-icons.js +24 -0
- package/dist/components/shared/status-icons.js.map +1 -0
- package/dist/components/shared/strings.d.ts +17 -0
- package/dist/components/shared/strings.d.ts.map +1 -0
- package/dist/components/shared/strings.js +21 -0
- package/dist/components/shared/strings.js.map +1 -0
- package/dist/components/side-nav/side-nav.d.ts +255 -0
- package/dist/components/side-nav/side-nav.d.ts.map +1 -0
- package/dist/components/side-nav/side-nav.js +335 -0
- package/dist/components/side-nav/side-nav.js.map +1 -0
- package/dist/components/side-nav/side-nav.styles.d.ts +11 -0
- package/dist/components/side-nav/side-nav.styles.d.ts.map +1 -0
- package/dist/components/side-nav/side-nav.styles.js +443 -0
- package/dist/components/side-nav/side-nav.styles.js.map +1 -0
- package/dist/components/stack/stack.d.ts +78 -0
- package/dist/components/stack/stack.d.ts.map +1 -0
- package/dist/components/stack/stack.js +108 -0
- package/dist/components/stack/stack.js.map +1 -0
- package/dist/components/status-dot/status-dot.d.ts +53 -0
- package/dist/components/status-dot/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot/status-dot.js +126 -0
- package/dist/components/status-dot/status-dot.js.map +1 -0
- package/dist/components/stepper/stepper.d.ts +185 -0
- package/dist/components/stepper/stepper.d.ts.map +1 -0
- package/dist/components/stepper/stepper.js +203 -0
- package/dist/components/stepper/stepper.js.map +1 -0
- package/dist/components/stepper/stepper.styles.d.ts +7 -0
- package/dist/components/stepper/stepper.styles.d.ts.map +1 -0
- package/dist/components/stepper/stepper.styles.js +220 -0
- package/dist/components/stepper/stepper.styles.js.map +1 -0
- package/dist/components/tab-menu/tab-menu.d.ts +61 -0
- package/dist/components/tab-menu/tab-menu.d.ts.map +1 -0
- package/dist/components/tab-menu/tab-menu.js +52 -0
- package/dist/components/tab-menu/tab-menu.js.map +1 -0
- package/dist/components/tab-menu/tab-menu.styles.d.ts +8 -0
- package/dist/components/tab-menu/tab-menu.styles.d.ts.map +1 -0
- package/dist/components/tab-menu/tab-menu.styles.js +127 -0
- package/dist/components/tab-menu/tab-menu.styles.js.map +1 -0
- package/dist/components/table/sort.d.ts +22 -0
- package/dist/components/table/sort.d.ts.map +1 -0
- package/dist/components/table/sort.js +36 -0
- package/dist/components/table/sort.js.map +1 -0
- package/dist/components/table/table.d.ts +92 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +359 -23
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/table.styles.d.ts.map +1 -1
- package/dist/components/table/table.styles.js +202 -0
- package/dist/components/table/table.styles.js.map +1 -1
- package/dist/components/text/text.d.ts +81 -0
- package/dist/components/text/text.d.ts.map +1 -0
- package/dist/components/text/text.js +59 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/text/text.styles.d.ts +6 -0
- package/dist/components/text/text.styles.d.ts.map +1 -0
- package/dist/components/text/text.styles.js +107 -0
- package/dist/components/text/text.styles.js.map +1 -0
- package/dist/components/thumbnail/thumbnail.d.ts +79 -0
- package/dist/components/thumbnail/thumbnail.d.ts.map +1 -0
- package/dist/components/thumbnail/thumbnail.js +186 -0
- package/dist/components/thumbnail/thumbnail.js.map +1 -0
- package/dist/components/time-input/time-input.d.ts +128 -0
- package/dist/components/time-input/time-input.d.ts.map +1 -0
- package/dist/components/time-input/time-input.js +261 -0
- package/dist/components/time-input/time-input.js.map +1 -0
- package/dist/components/timer/timer.d.ts +113 -0
- package/dist/components/timer/timer.d.ts.map +1 -0
- package/dist/components/timer/timer.js +187 -0
- package/dist/components/timer/timer.js.map +1 -0
- package/dist/components/timer/timer.styles.d.ts +3 -0
- package/dist/components/timer/timer.styles.d.ts.map +1 -0
- package/dist/components/timer/timer.styles.js +34 -0
- package/dist/components/timer/timer.styles.js.map +1 -0
- package/dist/components/timestamp/timestamp.d.ts +112 -0
- package/dist/components/timestamp/timestamp.d.ts.map +1 -0
- package/dist/components/timestamp/timestamp.js +191 -0
- package/dist/components/timestamp/timestamp.js.map +1 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +123 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts.map +1 -0
- package/dist/components/toggle-button-group/toggle-button-group.js +201 -0
- package/dist/components/toggle-button-group/toggle-button-group.js.map +1 -0
- package/dist/components/token/token.d.ts +82 -0
- package/dist/components/token/token.d.ts.map +1 -0
- package/dist/components/token/token.js +86 -0
- package/dist/components/token/token.js.map +1 -0
- package/dist/components/token/token.styles.d.ts +6 -0
- package/dist/components/token/token.styles.d.ts.map +1 -0
- package/dist/components/token/token.styles.js +117 -0
- package/dist/components/token/token.styles.js.map +1 -0
- package/dist/components/tokenizer/tokenizer.d.ts +252 -0
- package/dist/components/tokenizer/tokenizer.d.ts.map +1 -0
- package/dist/components/tokenizer/tokenizer.js +637 -0
- package/dist/components/tokenizer/tokenizer.js.map +1 -0
- package/dist/components/tokenizer/tokenizer.styles.d.ts +7 -0
- package/dist/components/tokenizer/tokenizer.styles.d.ts.map +1 -0
- package/dist/components/tokenizer/tokenizer.styles.js +122 -0
- package/dist/components/tokenizer/tokenizer.styles.js.map +1 -0
- package/dist/components/toolbar/toolbar.d.ts +57 -0
- package/dist/components/toolbar/toolbar.d.ts.map +1 -0
- package/dist/components/toolbar/toolbar.js +145 -0
- package/dist/components/toolbar/toolbar.js.map +1 -0
- package/dist/components/top-nav/top-nav.d.ts +155 -0
- package/dist/components/top-nav/top-nav.d.ts.map +1 -0
- package/dist/components/top-nav/top-nav.js +236 -0
- package/dist/components/top-nav/top-nav.js.map +1 -0
- package/dist/components/top-nav/top-nav.styles.d.ts +9 -0
- package/dist/components/top-nav/top-nav.styles.d.ts.map +1 -0
- package/dist/components/top-nav/top-nav.styles.js +267 -0
- package/dist/components/top-nav/top-nav.styles.js.map +1 -0
- package/dist/components/tree-list/tree-list.d.ts +194 -0
- package/dist/components/tree-list/tree-list.d.ts.map +1 -0
- package/dist/components/tree-list/tree-list.js +501 -0
- package/dist/components/tree-list/tree-list.js.map +1 -0
- package/dist/components/tree-list/tree-list.styles.d.ts +8 -0
- package/dist/components/tree-list/tree-list.styles.d.ts.map +1 -0
- package/dist/components/tree-list/tree-list.styles.js +171 -0
- package/dist/components/tree-list/tree-list.styles.js.map +1 -0
- package/dist/components/typeahead/typeahead.d.ts +102 -0
- package/dist/components/typeahead/typeahead.d.ts.map +1 -0
- package/dist/components/typeahead/typeahead.js +69 -0
- package/dist/components/typeahead/typeahead.js.map +1 -0
- package/dist/context-menu.d.ts +3 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +9 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/date-input.d.ts +2 -0
- package/dist/date-input.d.ts.map +1 -0
- package/dist/date-input.js +8 -0
- package/dist/date-input.js.map +1 -0
- package/dist/date-range-input.d.ts +2 -0
- package/dist/date-range-input.d.ts.map +1 -0
- package/dist/date-range-input.js +8 -0
- package/dist/date-range-input.js.map +1 -0
- package/dist/date-time-input.d.ts +2 -0
- package/dist/date-time-input.d.ts.map +1 -0
- package/dist/date-time-input.js +8 -0
- package/dist/date-time-input.js.map +1 -0
- package/dist/empty-state.d.ts +2 -0
- package/dist/empty-state.d.ts.map +1 -0
- package/dist/empty-state.js +8 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/file-input.d.ts +2 -0
- package/dist/file-input.d.ts.map +1 -0
- package/dist/file-input.js +8 -0
- package/dist/file-input.js.map +1 -0
- package/dist/form-layout.d.ts +2 -0
- package/dist/form-layout.d.ts.map +1 -0
- package/dist/form-layout.js +8 -0
- package/dist/form-layout.js.map +1 -0
- package/dist/grid-item.d.ts +2 -0
- package/dist/grid-item.d.ts.map +1 -0
- package/dist/grid-item.js +8 -0
- package/dist/grid-item.js.map +1 -0
- package/dist/grid.d.ts +3 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +11 -0
- package/dist/grid.js.map +1 -0
- package/dist/heading.d.ts +2 -0
- package/dist/heading.d.ts.map +1 -0
- package/dist/heading.js +8 -0
- package/dist/heading.js.map +1 -0
- package/dist/hover-card.d.ts +2 -0
- package/dist/hover-card.d.ts.map +1 -0
- package/dist/hover-card.js +8 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/icon.d.ts +3 -0
- package/dist/icon.d.ts.map +1 -0
- package/dist/icon.js +9 -0
- package/dist/icon.js.map +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -1
- package/dist/info-tip.d.ts +2 -0
- package/dist/info-tip.d.ts.map +1 -0
- package/dist/info-tip.js +8 -0
- package/dist/info-tip.js.map +1 -0
- package/dist/input-group.d.ts +2 -0
- package/dist/input-group.d.ts.map +1 -0
- package/dist/input-group.js +8 -0
- package/dist/input-group.js.map +1 -0
- package/dist/internal/autoload.d.ts +27 -0
- package/dist/internal/autoload.d.ts.map +1 -0
- package/dist/internal/autoload.js +72 -0
- package/dist/internal/autoload.js.map +1 -0
- package/dist/kbd.d.ts +2 -0
- package/dist/kbd.d.ts.map +1 -0
- package/dist/kbd.js +8 -0
- package/dist/kbd.js.map +1 -0
- package/dist/lightbox.d.ts +2 -0
- package/dist/lightbox.d.ts.map +1 -0
- package/dist/lightbox.js +8 -0
- package/dist/lightbox.js.map +1 -0
- package/dist/list-item.d.ts +6 -0
- package/dist/list-item.d.ts.map +1 -0
- package/dist/list-item.js +6 -0
- package/dist/list-item.js.map +1 -0
- package/dist/list.d.ts +3 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +11 -0
- package/dist/list.js.map +1 -0
- package/dist/markdown.d.ts +2 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +8 -0
- package/dist/markdown.js.map +1 -0
- package/dist/metadata-item.d.ts +6 -0
- package/dist/metadata-item.d.ts.map +1 -0
- package/dist/metadata-item.js +6 -0
- package/dist/metadata-item.js.map +1 -0
- package/dist/metadata-list.d.ts +3 -0
- package/dist/metadata-list.d.ts.map +1 -0
- package/dist/metadata-list.js +11 -0
- package/dist/metadata-list.js.map +1 -0
- package/dist/mobile-nav.d.ts +2 -0
- package/dist/mobile-nav.d.ts.map +1 -0
- package/dist/mobile-nav.js +10 -0
- package/dist/mobile-nav.js.map +1 -0
- package/dist/more-menu.d.ts +3 -0
- package/dist/more-menu.d.ts.map +1 -0
- package/dist/more-menu.js +9 -0
- package/dist/more-menu.js.map +1 -0
- package/dist/multi-select.d.ts +7 -0
- package/dist/multi-select.d.ts.map +1 -0
- package/dist/multi-select.js +9 -0
- package/dist/multi-select.js.map +1 -0
- package/dist/number-input.d.ts +2 -0
- package/dist/number-input.d.ts.map +1 -0
- package/dist/number-input.js +8 -0
- package/dist/number-input.js.map +1 -0
- package/dist/outline.d.ts +2 -0
- package/dist/outline.d.ts.map +1 -0
- package/dist/outline.js +8 -0
- package/dist/outline.js.map +1 -0
- package/dist/overflow-list.d.ts +2 -0
- package/dist/overflow-list.d.ts.map +1 -0
- package/dist/overflow-list.js +8 -0
- package/dist/overflow-list.js.map +1 -0
- package/dist/radio-list.d.ts +3 -0
- package/dist/radio-list.d.ts.map +1 -0
- package/dist/radio-list.js +11 -0
- package/dist/radio-list.js.map +1 -0
- package/dist/resize-handle.d.ts +2 -0
- package/dist/resize-handle.d.ts.map +1 -0
- package/dist/resize-handle.js +8 -0
- package/dist/resize-handle.js.map +1 -0
- package/dist/scroll-area.d.ts +2 -0
- package/dist/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area.js +8 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/section.d.ts +2 -0
- package/dist/section.d.ts.map +1 -0
- package/dist/section.js +8 -0
- package/dist/section.js.map +1 -0
- package/dist/segmented-control-item.d.ts +6 -0
- package/dist/segmented-control-item.d.ts.map +1 -0
- package/dist/segmented-control-item.js +6 -0
- package/dist/segmented-control-item.js.map +1 -0
- package/dist/segmented-control.d.ts +2 -0
- package/dist/segmented-control.d.ts.map +1 -0
- package/dist/segmented-control.js +9 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/selectable-card.d.ts +2 -0
- package/dist/selectable-card.d.ts.map +1 -0
- package/dist/selectable-card.js +8 -0
- package/dist/selectable-card.js.map +1 -0
- package/dist/side-nav-heading.d.ts +6 -0
- package/dist/side-nav-heading.d.ts.map +1 -0
- package/dist/side-nav-heading.js +6 -0
- package/dist/side-nav-heading.js.map +1 -0
- package/dist/side-nav-item.d.ts +6 -0
- package/dist/side-nav-item.d.ts.map +1 -0
- package/dist/side-nav-item.js +6 -0
- package/dist/side-nav-item.js.map +1 -0
- package/dist/side-nav-section.d.ts +6 -0
- package/dist/side-nav-section.d.ts.map +1 -0
- package/dist/side-nav-section.js +6 -0
- package/dist/side-nav-section.js.map +1 -0
- package/dist/side-nav.d.ts +2 -0
- package/dist/side-nav.d.ts.map +1 -0
- package/dist/side-nav.js +12 -0
- package/dist/side-nav.js.map +1 -0
- package/dist/stack.d.ts +2 -0
- package/dist/stack.d.ts.map +1 -0
- package/dist/stack.js +8 -0
- package/dist/stack.js.map +1 -0
- package/dist/status-dot.d.ts +2 -0
- package/dist/status-dot.d.ts.map +1 -0
- package/dist/status-dot.js +8 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/step.d.ts +6 -0
- package/dist/step.d.ts.map +1 -0
- package/dist/step.js +6 -0
- package/dist/step.js.map +1 -0
- package/dist/stepper.d.ts +2 -0
- package/dist/stepper.d.ts.map +1 -0
- package/dist/stepper.js +9 -0
- package/dist/stepper.js.map +1 -0
- package/dist/tab-menu.d.ts +2 -0
- package/dist/tab-menu.d.ts.map +1 -0
- package/dist/tab-menu.js +8 -0
- package/dist/tab-menu.js.map +1 -0
- package/dist/text.d.ts +2 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +8 -0
- package/dist/text.js.map +1 -0
- package/dist/thumbnail.d.ts +2 -0
- package/dist/thumbnail.d.ts.map +1 -0
- package/dist/thumbnail.js +8 -0
- package/dist/thumbnail.js.map +1 -0
- package/dist/time-input.d.ts +2 -0
- package/dist/time-input.d.ts.map +1 -0
- package/dist/time-input.js +8 -0
- package/dist/time-input.js.map +1 -0
- package/dist/timer.d.ts +2 -0
- package/dist/timer.d.ts.map +1 -0
- package/dist/timer.js +8 -0
- package/dist/timer.js.map +1 -0
- package/dist/timestamp.d.ts +2 -0
- package/dist/timestamp.d.ts.map +1 -0
- package/dist/timestamp.js +8 -0
- package/dist/timestamp.js.map +1 -0
- package/dist/toggle-button-group.d.ts +2 -0
- package/dist/toggle-button-group.d.ts.map +1 -0
- package/dist/toggle-button-group.js +8 -0
- package/dist/toggle-button-group.js.map +1 -0
- package/dist/token.d.ts +2 -0
- package/dist/token.d.ts.map +1 -0
- package/dist/token.js +8 -0
- package/dist/token.js.map +1 -0
- package/dist/tokenizer.d.ts +7 -0
- package/dist/tokenizer.d.ts.map +1 -0
- package/dist/tokenizer.js +9 -0
- package/dist/tokenizer.js.map +1 -0
- package/dist/toolbar.d.ts +2 -0
- package/dist/toolbar.d.ts.map +1 -0
- package/dist/toolbar.js +8 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/top-nav-item.d.ts +6 -0
- package/dist/top-nav-item.d.ts.map +1 -0
- package/dist/top-nav-item.js +6 -0
- package/dist/top-nav-item.js.map +1 -0
- package/dist/top-nav-menu.d.ts +6 -0
- package/dist/top-nav-menu.d.ts.map +1 -0
- package/dist/top-nav-menu.js +6 -0
- package/dist/top-nav-menu.js.map +1 -0
- package/dist/top-nav.d.ts +2 -0
- package/dist/top-nav.d.ts.map +1 -0
- package/dist/top-nav.js +10 -0
- package/dist/top-nav.js.map +1 -0
- package/dist/tree-item.d.ts +6 -0
- package/dist/tree-item.d.ts.map +1 -0
- package/dist/tree-item.js +6 -0
- package/dist/tree-item.js.map +1 -0
- package/dist/tree-list.d.ts +2 -0
- package/dist/tree-list.d.ts.map +1 -0
- package/dist/tree-list.js +9 -0
- package/dist/tree-list.js.map +1 -0
- package/dist/typeahead.d.ts +2 -0
- package/dist/typeahead.d.ts.map +1 -0
- package/dist/typeahead.js +8 -0
- package/dist/typeahead.js.map +1 -0
- package/package.json +402 -4
- package/src/alert-dialog.ts +9 -0
- package/src/all.ts +70 -0
- package/src/app-shell.ts +9 -0
- package/src/aspect-ratio.ts +9 -0
- package/src/banner.ts +9 -0
- package/src/blockquote.ts +9 -0
- package/src/bottom-sheet.ts +9 -0
- package/src/button-group.ts +9 -0
- package/src/calendar.ts +9 -0
- package/src/carousel.ts +9 -0
- package/src/center.ts +9 -0
- package/src/chat-composer.ts +9 -0
- package/src/chat-layout.ts +9 -0
- package/src/chat-message.ts +12 -0
- package/src/checkbox-list.ts +12 -0
- package/src/citation.ts +9 -0
- package/src/clickable-card.ts +9 -0
- package/src/code-block.ts +9 -0
- package/src/code.ts +9 -0
- package/src/collapsible.ts +9 -0
- package/src/command-palette.ts +9 -0
- package/src/components/alert-dialog/alert-dialog.ts +108 -0
- package/src/components/app-shell/app-shell.ts +328 -0
- package/src/components/aspect-ratio/aspect-ratio.ts +121 -0
- package/src/components/banner/banner.ts +351 -0
- package/src/components/blockquote/blockquote.ts +108 -0
- package/src/components/bottom-sheet/bottom-sheet.styles.ts +83 -0
- package/src/components/bottom-sheet/bottom-sheet.ts +328 -0
- package/src/components/button-group/button-group.ts +158 -0
- package/src/components/calendar/calendar.styles.ts +219 -0
- package/src/components/calendar/calendar.ts +559 -0
- package/src/components/card/card.ts +23 -15
- package/src/components/carousel/carousel.styles.ts +171 -0
- package/src/components/carousel/carousel.ts +441 -0
- package/src/components/center/center.ts +93 -0
- package/src/components/chat/chat-composer.styles.ts +207 -0
- package/src/components/chat/chat-composer.ts +346 -0
- package/src/components/chat/chat-layout.styles.ts +114 -0
- package/src/components/chat/chat-layout.ts +246 -0
- package/src/components/chat/chat-message.styles.ts +249 -0
- package/src/components/chat/chat-message.ts +381 -0
- package/src/components/checkbox-list/checkbox-list.styles.ts +104 -0
- package/src/components/checkbox-list/checkbox-list.ts +287 -0
- package/src/components/citation/citation.ts +222 -0
- package/src/components/clickable-card/clickable-card.ts +103 -0
- package/src/components/code/code.ts +60 -0
- package/src/components/code-block/code-block.styles.ts +194 -0
- package/src/components/code-block/code-block.ts +348 -0
- package/src/components/collapsible/collapsible.styles.ts +25 -0
- package/src/components/collapsible/collapsible.ts +119 -0
- package/src/components/command-palette/command-palette.styles.ts +173 -0
- package/src/components/command-palette/command-palette.ts +486 -0
- package/src/components/context-menu/context-menu.styles.ts +18 -0
- package/src/components/context-menu/context-menu.ts +172 -0
- package/src/components/date-input/date-input.ts +375 -0
- package/src/components/date-range-input/date-range-input.ts +488 -0
- package/src/components/date-time-input/date-time-input.ts +387 -0
- package/src/components/dialog/dialog.ts +38 -25
- package/src/components/empty-state/empty-state.ts +196 -0
- package/src/components/file-input/file-input.styles.ts +195 -0
- package/src/components/file-input/file-input.ts +418 -0
- package/src/components/form-layout/form-layout.styles.ts +71 -0
- package/src/components/form-layout/form-layout.ts +53 -0
- package/src/components/grid/grid-item.ts +65 -0
- package/src/components/grid/grid.ts +138 -0
- package/src/components/heading/heading.styles.ts +64 -0
- package/src/components/heading/heading.ts +82 -0
- package/src/components/hover-card/hover-card.ts +361 -0
- package/src/components/icon/icon-registry.ts +168 -0
- package/src/components/icon/icon.ts +180 -0
- package/src/components/info-tip/info-tip.ts +217 -0
- package/src/components/input-group/input-group.styles.ts +69 -0
- package/src/components/input-group/input-group.ts +95 -0
- package/src/components/kbd/kbd.ts +71 -0
- package/src/components/lightbox/lightbox.styles.ts +188 -0
- package/src/components/lightbox/lightbox.ts +350 -0
- package/src/components/list/list-item.ts +163 -0
- package/src/components/list/list.ts +106 -0
- package/src/components/markdown/markdown.styles.ts +178 -0
- package/src/components/markdown/markdown.ts +170 -0
- package/src/components/markdown/parser.ts +549 -0
- package/src/components/markdown/render.ts +199 -0
- package/src/components/menu/menu.ts +88 -18
- package/src/components/metadata-list/metadata-item.ts +55 -0
- package/src/components/metadata-list/metadata-list.ts +186 -0
- package/src/components/mobile-nav/mobile-nav.styles.ts +57 -0
- package/src/components/mobile-nav/mobile-nav.ts +190 -0
- package/src/components/more-menu/more-menu.styles.ts +50 -0
- package/src/components/more-menu/more-menu.ts +75 -0
- package/src/components/multi-select/multi-select.styles.ts +27 -0
- package/src/components/multi-select/multi-select.ts +702 -0
- package/src/components/number-input/number-format.ts +129 -0
- package/src/components/number-input/number-input.styles.ts +108 -0
- package/src/components/number-input/number-input.ts +583 -0
- package/src/components/outline/outline.styles.ts +92 -0
- package/src/components/outline/outline.ts +356 -0
- package/src/components/overflow-list/overflow-list.styles.ts +112 -0
- package/src/components/overflow-list/overflow-list.ts +243 -0
- package/src/components/pagination/pagination.ts +2 -2
- package/src/components/radio-group/radio-group.ts +11 -3
- package/src/components/radio-group/radio.ts +18 -7
- package/src/components/radio-list/radio-list.styles.ts +81 -0
- package/src/components/radio-list/radio-list.ts +38 -0
- package/src/components/resize-handle/resize-handle.ts +405 -0
- package/src/components/scroll-area/scroll-area.ts +214 -0
- package/src/components/section/section.ts +115 -0
- package/src/components/segmented-control/segmented-control.styles.ts +149 -0
- package/src/components/segmented-control/segmented-control.ts +225 -0
- package/src/components/selectable-card/selectable-card.styles.ts +166 -0
- package/src/components/selectable-card/selectable-card.ts +144 -0
- package/src/components/shared/calendar-picker.ts +192 -0
- package/src/components/shared/date-check.ts +61 -0
- package/src/components/shared/date-field.styles.ts +158 -0
- package/src/components/shared/date-strings.ts +90 -0
- package/src/components/shared/date-utils.ts +376 -0
- package/src/components/shared/heading-tag.ts +35 -0
- package/src/components/shared/host-aria.ts +59 -0
- package/src/components/shared/indic.ts +35 -0
- package/src/components/shared/layout.ts +45 -0
- package/src/components/shared/status-icons.ts +29 -0
- package/src/components/shared/strings.ts +35 -0
- package/src/components/side-nav/side-nav.styles.ts +446 -0
- package/src/components/side-nav/side-nav.ts +472 -0
- package/src/components/stack/stack.ts +152 -0
- package/src/components/status-dot/status-dot.ts +158 -0
- package/src/components/stepper/stepper.styles.ts +221 -0
- package/src/components/stepper/stepper.ts +300 -0
- package/src/components/tab-menu/tab-menu.styles.ts +127 -0
- package/src/components/tab-menu/tab-menu.ts +75 -0
- package/src/components/table/sort.ts +45 -0
- package/src/components/table/table.styles.ts +202 -0
- package/src/components/table/table.ts +405 -23
- package/src/components/text/text.styles.ts +107 -0
- package/src/components/text/text.ts +103 -0
- package/src/components/thumbnail/thumbnail.ts +234 -0
- package/src/components/time-input/time-input.ts +347 -0
- package/src/components/timer/timer.styles.ts +34 -0
- package/src/components/timer/timer.ts +255 -0
- package/src/components/timestamp/timestamp.ts +262 -0
- package/src/components/toggle-button-group/toggle-button-group.ts +263 -0
- package/src/components/token/token.styles.ts +117 -0
- package/src/components/token/token.ts +131 -0
- package/src/components/tokenizer/tokenizer.styles.ts +122 -0
- package/src/components/tokenizer/tokenizer.ts +817 -0
- package/src/components/toolbar/toolbar.ts +176 -0
- package/src/components/top-nav/top-nav.styles.ts +271 -0
- package/src/components/top-nav/top-nav.ts +296 -0
- package/src/components/tree-list/tree-list.styles.ts +172 -0
- package/src/components/tree-list/tree-list.ts +580 -0
- package/src/components/typeahead/typeahead.ts +95 -0
- package/src/context-menu.ts +10 -0
- package/src/date-input.ts +9 -0
- package/src/date-range-input.ts +9 -0
- package/src/date-time-input.ts +9 -0
- package/src/empty-state.ts +9 -0
- package/src/file-input.ts +9 -0
- package/src/form-layout.ts +9 -0
- package/src/grid-item.ts +9 -0
- package/src/grid.ts +12 -0
- package/src/heading.ts +9 -0
- package/src/hover-card.ts +9 -0
- package/src/icon.ts +10 -0
- package/src/index.ts +77 -0
- package/src/info-tip.ts +9 -0
- package/src/input-group.ts +9 -0
- package/src/internal/autoload.ts +93 -0
- package/src/kbd.ts +9 -0
- package/src/lightbox.ts +9 -0
- package/src/list-item.ts +5 -0
- package/src/list.ts +12 -0
- package/src/markdown.ts +9 -0
- package/src/metadata-item.ts +5 -0
- package/src/metadata-list.ts +12 -0
- package/src/mobile-nav.ts +11 -0
- package/src/more-menu.ts +10 -0
- package/src/multi-select.ts +10 -0
- package/src/number-input.ts +9 -0
- package/src/outline.ts +9 -0
- package/src/overflow-list.ts +9 -0
- package/src/radio-list.ts +12 -0
- package/src/resize-handle.ts +9 -0
- package/src/scroll-area.ts +9 -0
- package/src/section.ts +9 -0
- package/src/segmented-control-item.ts +5 -0
- package/src/segmented-control.ts +13 -0
- package/src/selectable-card.ts +9 -0
- package/src/side-nav-heading.ts +5 -0
- package/src/side-nav-item.ts +5 -0
- package/src/side-nav-section.ts +5 -0
- package/src/side-nav.ts +18 -0
- package/src/stack.ts +9 -0
- package/src/status-dot.ts +9 -0
- package/src/step.ts +5 -0
- package/src/stepper.ts +10 -0
- package/src/tab-menu.ts +9 -0
- package/src/text.ts +9 -0
- package/src/thumbnail.ts +9 -0
- package/src/time-input.ts +9 -0
- package/src/timer.ts +9 -0
- package/src/timestamp.ts +9 -0
- package/src/toggle-button-group.ts +9 -0
- package/src/token.ts +9 -0
- package/src/tokenizer.ts +10 -0
- package/src/toolbar.ts +9 -0
- package/src/top-nav-item.ts +5 -0
- package/src/top-nav-menu.ts +5 -0
- package/src/top-nav.ts +11 -0
- package/src/tree-item.ts +5 -0
- package/src/tree-list.ts +10 -0
- package/src/typeahead.ts +9 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shadow styles for `und-code-block`. `@und-ui/css` (`.und-code-block`) reads
|
|
5
|
+
* the same custom properties; a parity test keeps the two lists in sync.
|
|
6
|
+
*
|
|
7
|
+
* Syntax highlighting is not built in. The `--und-code-token-*` properties and
|
|
8
|
+
* the `.tok-*` classes are the hook: a later highlighter (or your own
|
|
9
|
+
* subclass) renders token spans (DOM, never an HTML string) and only has to
|
|
10
|
+
* add the class; the colors already follow the theme.
|
|
11
|
+
*/
|
|
12
|
+
export const codeBlockStyles = css`
|
|
13
|
+
@layer und.components {
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([hidden]) {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.block {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
border: var(--und-border-width-thin, 1px) solid
|
|
26
|
+
var(--und-code-block-border, var(--und-border-subtle, #d6d8dd));
|
|
27
|
+
border-radius: var(--und-code-block-radius, var(--und-radius-md, 0.5rem));
|
|
28
|
+
background-color: var(--und-code-block-bg, var(--und-bg-subtle, #f9f9fb));
|
|
29
|
+
color: var(--und-code-block-fg, var(--und-fg-default, #23252c));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.toolbar {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: var(--und-space-2, 0.5rem);
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
padding-block: var(--und-space-1, 0.25rem);
|
|
39
|
+
padding-inline: var(--und-space-3, 0.75rem);
|
|
40
|
+
border-block-end: var(--und-border-width-thin, 1px) solid
|
|
41
|
+
var(--und-code-block-border, var(--und-border-subtle, #d6d8dd));
|
|
42
|
+
font-size: var(--und-text-body-sm-size, 0.875rem);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.toolbar[hidden] {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.language {
|
|
50
|
+
color: var(--und-fg-muted, #62646e);
|
|
51
|
+
font-family: var(--und-typeface-code, ui-monospace, monospace);
|
|
52
|
+
font-size: 0.8125em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.actions {
|
|
56
|
+
display: flex;
|
|
57
|
+
gap: var(--und-space-1, 0.25rem);
|
|
58
|
+
margin-inline-start: auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.action {
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
gap: 0.375em;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
min-inline-size: var(--und-target-min, 24px);
|
|
68
|
+
min-block-size: var(--und-target-min, 24px);
|
|
69
|
+
margin: 0;
|
|
70
|
+
padding-block: 0;
|
|
71
|
+
padding-inline: var(--und-space-2, 0.5rem);
|
|
72
|
+
border: var(--und-border-width-thin, 1px) solid transparent;
|
|
73
|
+
border-radius: var(--und-radius-sm, 0.25rem);
|
|
74
|
+
background: transparent;
|
|
75
|
+
color: var(--und-fg-default, #23252c);
|
|
76
|
+
font: inherit;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.action:hover {
|
|
81
|
+
background-color: var(--und-bg-muted-hover, #e9eaef);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.action[aria-pressed='true'] {
|
|
85
|
+
border-color: var(--und-border-control, #8e909b);
|
|
86
|
+
background-color: var(--und-bg-muted, #f1f2f6);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.action:focus-visible {
|
|
90
|
+
outline: var(--und-focus-ring-width, 2px) solid var(--und-focus-ring-color, #1f4fd1);
|
|
91
|
+
outline-offset: var(--und-focus-ring-offset, 2px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.action svg {
|
|
95
|
+
inline-size: 1em;
|
|
96
|
+
block-size: 1em;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pre {
|
|
100
|
+
--_lh: var(--und-code-block-line-height, 1.6);
|
|
101
|
+
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding-block: var(--und-space-3, 0.75rem);
|
|
104
|
+
padding-inline: var(--und-space-4, 1rem);
|
|
105
|
+
overflow: auto;
|
|
106
|
+
font-family: var(--und-typeface-code, ui-monospace, monospace);
|
|
107
|
+
font-size: var(--und-code-block-font-size, 0.875rem);
|
|
108
|
+
line-height: var(--_lh);
|
|
109
|
+
tab-size: 2;
|
|
110
|
+
white-space: pre;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.pre:focus-visible {
|
|
114
|
+
outline: var(--und-focus-ring-width, 2px) solid var(--und-focus-ring-color, #1f4fd1);
|
|
115
|
+
outline-offset: calc(var(--und-focus-ring-width, 2px) * -1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([wrap]) .pre {
|
|
119
|
+
overflow-wrap: anywhere;
|
|
120
|
+
white-space: pre-wrap;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.code {
|
|
124
|
+
display: block;
|
|
125
|
+
min-inline-size: max-content;
|
|
126
|
+
font: inherit;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([wrap]) .code {
|
|
130
|
+
min-inline-size: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.line {
|
|
134
|
+
display: grid;
|
|
135
|
+
grid-template-columns: var(--_gutter, 3ch) minmax(0, 1fr);
|
|
136
|
+
gap: var(--und-space-4, 1rem);
|
|
137
|
+
min-block-size: 1lh;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ln {
|
|
141
|
+
color: var(--und-fg-muted, #62646e);
|
|
142
|
+
text-align: end;
|
|
143
|
+
user-select: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.tok-keyword {
|
|
147
|
+
color: var(--und-code-token-keyword, #4b4dd5);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.tok-string {
|
|
151
|
+
color: var(--und-code-token-string, #03793c);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.tok-number {
|
|
155
|
+
color: var(--und-code-token-number, #835d02);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.tok-comment {
|
|
159
|
+
color: var(--und-code-token-comment, #62646e);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.tok-function {
|
|
163
|
+
color: var(--und-code-token-function, #0065b7);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@media (pointer: coarse) {
|
|
167
|
+
.action {
|
|
168
|
+
min-inline-size: var(--und-target-min-coarse, 44px);
|
|
169
|
+
min-block-size: var(--und-target-min-coarse, 44px);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@media (forced-colors: active) {
|
|
174
|
+
.block {
|
|
175
|
+
border-color: CanvasText;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.action {
|
|
179
|
+
border-color: ButtonText;
|
|
180
|
+
color: ButtonText;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.action[aria-pressed='true'] {
|
|
184
|
+
background-color: Highlight;
|
|
185
|
+
color: HighlightText;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.action:focus-visible,
|
|
189
|
+
.pre:focus-visible {
|
|
190
|
+
outline-color: Highlight;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`;
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { html, nothing, svg, type TemplateResult } from 'lit';
|
|
2
|
+
import { UndElement } from '../../base/UndElement.js';
|
|
3
|
+
import { announce } from '../../controllers/live-announcer.js';
|
|
4
|
+
import { isServer } from '../../utils/ssr-safe.js';
|
|
5
|
+
import { codeBlockStyles } from './code-block.styles.js';
|
|
6
|
+
|
|
7
|
+
/** Detail of the `und-copy` event. */
|
|
8
|
+
export interface CodeBlockCopyDetail {
|
|
9
|
+
success: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Detail of the `und-wrap-change` event. */
|
|
13
|
+
export interface CodeBlockWrapDetail {
|
|
14
|
+
wrap: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Removes blank lines at both ends and the indentation every line shares. */
|
|
18
|
+
export function dedent(raw: string): string {
|
|
19
|
+
const lines = raw.replace(/\r\n?/g, '\n').split('\n');
|
|
20
|
+
while ((lines[0] ?? 'x').trim() === '') lines.shift();
|
|
21
|
+
while ((lines[lines.length - 1] ?? 'x').trim() === '') lines.pop();
|
|
22
|
+
const indents = lines
|
|
23
|
+
.filter((line) => line.trim() !== '')
|
|
24
|
+
.map((line) => line.length - line.trimStart().length);
|
|
25
|
+
const shared = indents.length > 0 ? Math.min(...indents) : 0;
|
|
26
|
+
return lines.map((line) => line.slice(shared)).join('\n');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Letters, digits and `+#-` only, so a language name is safe in a class name. */
|
|
30
|
+
const toLanguageClass = (language: string | undefined): string | undefined => {
|
|
31
|
+
const clean = (language ?? '').toLowerCase().replace(/[^a-z0-9+#-]/g, '');
|
|
32
|
+
return clean ? clean : undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const COPY_ICON = svg`<rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V6a2 2 0 0 1 2-2h9"/>`;
|
|
36
|
+
const CHECK_ICON = svg`<path d="m5 12.5 4.5 4.5L19 7.5"/>`;
|
|
37
|
+
const WRAP_ICON = svg`<path d="M4 6h16M4 12h13a3 3 0 0 1 0 6h-4m0 0 2-2m-2 2 2 2M4 18h5"/>`;
|
|
38
|
+
|
|
39
|
+
const icon = (content: ReturnType<typeof svg>): TemplateResult =>
|
|
40
|
+
html`<svg
|
|
41
|
+
viewBox="0 0 24 24"
|
|
42
|
+
fill="none"
|
|
43
|
+
stroke="currentColor"
|
|
44
|
+
stroke-width="2"
|
|
45
|
+
stroke-linecap="round"
|
|
46
|
+
stroke-linejoin="round"
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
focusable="false"
|
|
49
|
+
>
|
|
50
|
+
${content}
|
|
51
|
+
</svg>`;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* A block of code in `pre` and `code`, with optional line numbers, a wrap
|
|
55
|
+
* toggle and a copy button. The text is rendered as text, never as HTML, so
|
|
56
|
+
* markup in the code is shown, not run. Give the code as the element's text
|
|
57
|
+
* (a common indent and surrounding blank lines are removed) or in `code`.
|
|
58
|
+
*
|
|
59
|
+
* There is no syntax highlighting engine in v1. `language` is reflected, put
|
|
60
|
+
* on the `code` element (`class="language-xx"`, `data-language`) and shown in
|
|
61
|
+
* the toolbar, and the `--und-code-token-*` properties with the `.tok-*`
|
|
62
|
+
* classes are the hook a later highlighter plugs into.
|
|
63
|
+
*
|
|
64
|
+
* The scrolling code area is keyboard focusable (arrow keys scroll it). The
|
|
65
|
+
* copy button uses the Clipboard API and announces "Copied" (or the failure)
|
|
66
|
+
* in a polite live region.
|
|
67
|
+
*
|
|
68
|
+
* @summary A block of code with line numbers, wrapping and a copy button.
|
|
69
|
+
* @tag und-code-block
|
|
70
|
+
*
|
|
71
|
+
* @slot - The code, as plain text.
|
|
72
|
+
*
|
|
73
|
+
* @csspart base - The outer box.
|
|
74
|
+
* @csspart toolbar - The bar with the language and the buttons.
|
|
75
|
+
* @csspart language - The language label.
|
|
76
|
+
* @csspart wrap-button - The wrap toggle.
|
|
77
|
+
* @csspart copy-button - The copy button.
|
|
78
|
+
* @csspart pre - The scrolling `pre` element.
|
|
79
|
+
* @csspart code - The `code` element.
|
|
80
|
+
* @csspart line - One line (only with `line-numbers`).
|
|
81
|
+
* @csspart line-number - The line number (only with `line-numbers`).
|
|
82
|
+
*
|
|
83
|
+
* @cssprop [--und-code-block-bg] - Background color.
|
|
84
|
+
* @cssprop [--und-code-block-fg] - Text color.
|
|
85
|
+
* @cssprop [--und-code-block-border] - Border color.
|
|
86
|
+
* @cssprop [--und-code-block-radius] - Corner radius.
|
|
87
|
+
* @cssprop [--und-code-block-font-size] - Font size.
|
|
88
|
+
* @cssprop [--und-code-block-line-height] - Line height.
|
|
89
|
+
* @cssprop [--und-code-token-keyword] - Highlight hook: keyword color.
|
|
90
|
+
* @cssprop [--und-code-token-string] - Highlight hook: string color.
|
|
91
|
+
* @cssprop [--und-code-token-number] - Highlight hook: number color.
|
|
92
|
+
* @cssprop [--und-code-token-comment] - Highlight hook: comment color.
|
|
93
|
+
* @cssprop [--und-code-token-function] - Highlight hook: function color.
|
|
94
|
+
*
|
|
95
|
+
* @fires {CustomEvent<CodeBlockCopyDetail>} und-copy - The copy button was used; `success` tells whether the clipboard accepted the text.
|
|
96
|
+
* @fires {CustomEvent<CodeBlockWrapDetail>} und-wrap-change - The wrap toggle changed `wrap`.
|
|
97
|
+
*/
|
|
98
|
+
export class UndCodeBlock extends UndElement {
|
|
99
|
+
static override tagName = 'und-code-block';
|
|
100
|
+
static override styles = codeBlockStyles;
|
|
101
|
+
|
|
102
|
+
static override properties = {
|
|
103
|
+
code: {},
|
|
104
|
+
language: { reflect: true },
|
|
105
|
+
lineNumbers: { type: Boolean, reflect: true, attribute: 'line-numbers' },
|
|
106
|
+
startLine: { type: Number, attribute: 'start-line' },
|
|
107
|
+
wrap: { type: Boolean, reflect: true },
|
|
108
|
+
wrapToggle: { type: Boolean, reflect: true, attribute: 'wrap-toggle' },
|
|
109
|
+
copyable: { type: Boolean, reflect: true },
|
|
110
|
+
label: {},
|
|
111
|
+
copyLabel: { attribute: 'copy-label' },
|
|
112
|
+
copiedLabel: { attribute: 'copied-label' },
|
|
113
|
+
copyFailedLabel: { attribute: 'copy-failed-label' },
|
|
114
|
+
wrapLabel: { attribute: 'wrap-label' },
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The code as a string. Wins over the element's text.
|
|
119
|
+
* @attr code
|
|
120
|
+
*/
|
|
121
|
+
declare code: string | undefined;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Language name (`js`, `html`, `hi`...). Reflected, shown in the toolbar,
|
|
125
|
+
* and exposed to styles and a future highlighter; it does not change how the
|
|
126
|
+
* code is rendered in v1.
|
|
127
|
+
* @attr language
|
|
128
|
+
*/
|
|
129
|
+
declare language: string | undefined;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Shows line numbers (not part of the copied text).
|
|
133
|
+
* @attr line-numbers
|
|
134
|
+
*/
|
|
135
|
+
declare lineNumbers: boolean;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Number of the first line with `line-numbers`.
|
|
139
|
+
* @attr start-line
|
|
140
|
+
*/
|
|
141
|
+
declare startLine: number;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Wraps long lines instead of scrolling sideways.
|
|
145
|
+
* @attr wrap
|
|
146
|
+
*/
|
|
147
|
+
declare wrap: boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Shows a button that toggles `wrap`.
|
|
151
|
+
* @attr wrap-toggle
|
|
152
|
+
*/
|
|
153
|
+
declare wrapToggle: boolean;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Shows a copy button.
|
|
157
|
+
* @attr copyable
|
|
158
|
+
*/
|
|
159
|
+
declare copyable: boolean;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Accessible name of the scrolling code area (localise it).
|
|
163
|
+
* @attr label
|
|
164
|
+
*/
|
|
165
|
+
declare label: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Text of the copy button (localise it).
|
|
169
|
+
* @attr copy-label
|
|
170
|
+
*/
|
|
171
|
+
declare copyLabel: string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Text shown and announced after a successful copy (localise it).
|
|
175
|
+
* @attr copied-label
|
|
176
|
+
*/
|
|
177
|
+
declare copiedLabel: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Message announced when the clipboard refuses the text (localise it).
|
|
181
|
+
* @attr copy-failed-label
|
|
182
|
+
*/
|
|
183
|
+
declare copyFailedLabel: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Text of the wrap toggle (localise it).
|
|
187
|
+
* @attr wrap-label
|
|
188
|
+
*/
|
|
189
|
+
declare wrapLabel: string;
|
|
190
|
+
|
|
191
|
+
#observer: MutationObserver | undefined;
|
|
192
|
+
#resetTimer: ReturnType<typeof setTimeout> | undefined;
|
|
193
|
+
|
|
194
|
+
#slotText = '';
|
|
195
|
+
#copyState = 'idle' as 'idle' | 'copied';
|
|
196
|
+
|
|
197
|
+
constructor() {
|
|
198
|
+
super();
|
|
199
|
+
this.lineNumbers = false;
|
|
200
|
+
this.startLine = 1;
|
|
201
|
+
this.wrap = false;
|
|
202
|
+
this.wrapToggle = false;
|
|
203
|
+
this.copyable = false;
|
|
204
|
+
this.label = 'Code';
|
|
205
|
+
this.copyLabel = 'Copy';
|
|
206
|
+
this.copiedLabel = 'Copied';
|
|
207
|
+
this.copyFailedLabel = 'Copy failed';
|
|
208
|
+
this.wrapLabel = 'Wrap lines';
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** The code that is shown and copied. */
|
|
212
|
+
get text(): string {
|
|
213
|
+
return this.code !== undefined ? this.code.replace(/\n$/, '') : dedent(this.#slotText);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
override connectedCallback(): void {
|
|
217
|
+
super.connectedCallback();
|
|
218
|
+
if (isServer) return;
|
|
219
|
+
this.#readSlot();
|
|
220
|
+
this.#observer = new MutationObserver(() => this.#readSlot());
|
|
221
|
+
this.#observer.observe(this, { childList: true, characterData: true, subtree: true });
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
override disconnectedCallback(): void {
|
|
225
|
+
super.disconnectedCallback();
|
|
226
|
+
this.#observer?.disconnect();
|
|
227
|
+
this.#observer = undefined;
|
|
228
|
+
clearTimeout(this.#resetTimer);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
#readSlot(): void {
|
|
232
|
+
this.#slotText = this.textContent ?? '';
|
|
233
|
+
this.requestUpdate();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Copies the code with the Clipboard API and announces the result.
|
|
238
|
+
* Resolves to whether the clipboard accepted the text.
|
|
239
|
+
*/
|
|
240
|
+
async copy(): Promise<boolean> {
|
|
241
|
+
let success = false;
|
|
242
|
+
try {
|
|
243
|
+
await navigator.clipboard.writeText(this.text);
|
|
244
|
+
success = true;
|
|
245
|
+
} catch {
|
|
246
|
+
// No Clipboard API, no permission or no focus: report it, do not throw.
|
|
247
|
+
}
|
|
248
|
+
clearTimeout(this.#resetTimer);
|
|
249
|
+
this.#copyState = success ? 'copied' : 'idle';
|
|
250
|
+
this.requestUpdate();
|
|
251
|
+
if (success) {
|
|
252
|
+
this.#resetTimer = setTimeout(() => {
|
|
253
|
+
this.#copyState = 'idle';
|
|
254
|
+
this.requestUpdate();
|
|
255
|
+
}, 2000);
|
|
256
|
+
}
|
|
257
|
+
void announce(success ? this.copiedLabel : this.copyFailedLabel);
|
|
258
|
+
this.emit<CodeBlockCopyDetail>('und-copy', { success });
|
|
259
|
+
return success;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
#toggleWrap = (): void => {
|
|
263
|
+
this.wrap = !this.wrap;
|
|
264
|
+
this.emit<CodeBlockWrapDetail>('und-wrap-change', { wrap: this.wrap });
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
protected override updated(): void {
|
|
268
|
+
const code = this.renderRoot.querySelector<HTMLElement>('.code');
|
|
269
|
+
if (!code) return;
|
|
270
|
+
// CSSOM write (a style attribute binding would fail under a strict CSP):
|
|
271
|
+
// the gutter is as wide as the largest line number.
|
|
272
|
+
if (this.lineNumbers) {
|
|
273
|
+
const last = (Math.trunc(Number(this.startLine)) || 1) + this.text.split('\n').length - 1;
|
|
274
|
+
code.style.setProperty('--_gutter', `${String(last).length}ch`);
|
|
275
|
+
} else {
|
|
276
|
+
code.style.removeProperty('--_gutter');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
#renderCode(): TemplateResult {
|
|
281
|
+
const language = toLanguageClass(this.language);
|
|
282
|
+
const cls = language ? `code language-${language}` : 'code';
|
|
283
|
+
if (!this.lineNumbers) {
|
|
284
|
+
return html`<code part="code" class=${cls} data-language=${language ?? nothing}
|
|
285
|
+
>${this.text}</code
|
|
286
|
+
>`;
|
|
287
|
+
}
|
|
288
|
+
const first = Math.trunc(Number(this.startLine)) || 1;
|
|
289
|
+
return html`<code part="code" class=${cls} data-language=${language ?? nothing}
|
|
290
|
+
>${this.text
|
|
291
|
+
.split('\n')
|
|
292
|
+
.map(
|
|
293
|
+
(line, index) =>
|
|
294
|
+
html`<span part="line" class="line"
|
|
295
|
+
><span part="line-number" class="ln" aria-hidden="true">${first + index}</span
|
|
296
|
+
><span class="lc">${line}</span></span
|
|
297
|
+
>`,
|
|
298
|
+
)}</code
|
|
299
|
+
>`;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
protected override render(): TemplateResult {
|
|
303
|
+
const language = toLanguageClass(this.language);
|
|
304
|
+
const hasToolbar = Boolean(language) || this.copyable || this.wrapToggle;
|
|
305
|
+
return html`<div part="base" class="block">
|
|
306
|
+
<div part="toolbar" class="toolbar" ?hidden=${!hasToolbar}>
|
|
307
|
+
<span part="language" class="language">${language ?? nothing}</span>
|
|
308
|
+
<div class="actions">
|
|
309
|
+
${
|
|
310
|
+
this.wrapToggle
|
|
311
|
+
? html`<button
|
|
312
|
+
part="wrap-button"
|
|
313
|
+
class="action"
|
|
314
|
+
type="button"
|
|
315
|
+
aria-pressed=${this.wrap ? 'true' : 'false'}
|
|
316
|
+
@click=${this.#toggleWrap}
|
|
317
|
+
>
|
|
318
|
+
${icon(WRAP_ICON)}${this.wrapLabel}
|
|
319
|
+
</button>`
|
|
320
|
+
: nothing
|
|
321
|
+
}
|
|
322
|
+
${
|
|
323
|
+
this.copyable
|
|
324
|
+
? html`<button
|
|
325
|
+
part="copy-button"
|
|
326
|
+
class="action"
|
|
327
|
+
type="button"
|
|
328
|
+
@click=${() => void this.copy()}
|
|
329
|
+
>
|
|
330
|
+
${icon(this.#copyState === 'copied' ? CHECK_ICON : COPY_ICON)}${
|
|
331
|
+
this.#copyState === 'copied' ? this.copiedLabel : this.copyLabel
|
|
332
|
+
}
|
|
333
|
+
</button>`
|
|
334
|
+
: nothing
|
|
335
|
+
}
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
<pre part="pre" class="pre" tabindex="0" role="group" aria-label=${this.label}>
|
|
339
|
+
${this.#renderCode()}</pre>
|
|
340
|
+
</div>`;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
declare global {
|
|
345
|
+
interface HTMLElementTagNameMap {
|
|
346
|
+
'und-code-block': UndCodeBlock;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { css, unsafeCSS } from 'lit';
|
|
2
|
+
import { accordionLightStyles } from '../accordion/accordion.styles.js';
|
|
3
|
+
|
|
4
|
+
/** Shadow styles for `und-collapsible` (the host only; the `details` is light DOM). */
|
|
5
|
+
export const collapsibleStyles = css`
|
|
6
|
+
@layer und.components {
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([hidden]) {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Light-DOM styles for the `<details>` inside `und-collapsible`: the accordion's
|
|
19
|
+
* rules with the selector scope swapped, so both share one source (and the
|
|
20
|
+
* same `--und-accordion-*` custom properties). The text is built from our own
|
|
21
|
+
* stylesheet, never from author input.
|
|
22
|
+
*/
|
|
23
|
+
export const collapsibleLightStyles = unsafeCSS(
|
|
24
|
+
accordionLightStyles.cssText.replaceAll(':where(und-accordion)', ':where(und-collapsible)'),
|
|
25
|
+
);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { html, type TemplateResult } from 'lit';
|
|
2
|
+
import { UndElement } from '../../base/UndElement.js';
|
|
3
|
+
import { isServer } from '../../utils/ssr-safe.js';
|
|
4
|
+
import { adoptLightStyles } from '../shared/light-styles.js';
|
|
5
|
+
import { collapsibleLightStyles, collapsibleStyles } from './collapsible.styles.js';
|
|
6
|
+
|
|
7
|
+
export interface CollapsibleToggleDetail {
|
|
8
|
+
open: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A single disclosure on a native `<details>` and `<summary>`, so it works
|
|
13
|
+
* before JavaScript loads and is found by find-in-page. It is the one-item
|
|
14
|
+
* sibling of `und-accordion` and shares its styles and custom properties.
|
|
15
|
+
* `open` stays in sync with the `details` in both directions.
|
|
16
|
+
*
|
|
17
|
+
* @summary One show/hide section built on details and summary.
|
|
18
|
+
* @tag und-collapsible
|
|
19
|
+
*
|
|
20
|
+
* @slot - One `<details>` element that starts with a `<summary>`.
|
|
21
|
+
*
|
|
22
|
+
* @fires {CustomEvent<{ open: boolean }>} und-toggle - The section opened or closed.
|
|
23
|
+
*
|
|
24
|
+
* @cssprop [--und-accordion-trigger-height] - Minimum block size of the header.
|
|
25
|
+
* @cssprop [--und-accordion-font-weight] - Font weight of the header.
|
|
26
|
+
* @cssprop [--und-accordion-panel-padding] - Space below open content.
|
|
27
|
+
*/
|
|
28
|
+
export class UndCollapsible extends UndElement {
|
|
29
|
+
static override tagName = 'und-collapsible';
|
|
30
|
+
static override styles = collapsibleStyles;
|
|
31
|
+
|
|
32
|
+
static override properties = {
|
|
33
|
+
open: { type: Boolean, reflect: true },
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether the content is shown.
|
|
38
|
+
* @attr open
|
|
39
|
+
*/
|
|
40
|
+
declare open: boolean;
|
|
41
|
+
|
|
42
|
+
constructor() {
|
|
43
|
+
super();
|
|
44
|
+
this.open = false;
|
|
45
|
+
// `toggle` does not bubble: capture it from the light DOM child.
|
|
46
|
+
this.addEventListener('toggle', this.#onToggle, true);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override connectedCallback(): void {
|
|
50
|
+
super.connectedCallback();
|
|
51
|
+
adoptLightStyles(this, collapsibleLightStyles);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The `<details>` child. */
|
|
55
|
+
get details(): HTMLDetailsElement | null {
|
|
56
|
+
if (isServer) return null;
|
|
57
|
+
return this.querySelector<HTMLDetailsElement>(':scope > details');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Opens the section. */
|
|
61
|
+
show(): void {
|
|
62
|
+
this.open = true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Closes the section. */
|
|
66
|
+
hide(): void {
|
|
67
|
+
this.open = false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Toggles the section. */
|
|
71
|
+
toggle(): void {
|
|
72
|
+
this.open = !this.open;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#synced = false;
|
|
76
|
+
#announced = false;
|
|
77
|
+
|
|
78
|
+
#onToggle = (event: Event): void => {
|
|
79
|
+
const details = this.details;
|
|
80
|
+
if (event.target !== details || !details) return;
|
|
81
|
+
this.open = details.open;
|
|
82
|
+
if (details.open === this.#announced) return;
|
|
83
|
+
this.#announced = details.open;
|
|
84
|
+
this.emit<CollapsibleToggleDetail>('und-toggle', { open: details.open });
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** The first details found: an initial `open` on it wins when the host has none. */
|
|
88
|
+
#adopt = (): void => {
|
|
89
|
+
const details = this.details;
|
|
90
|
+
if (!details || this.#synced) return;
|
|
91
|
+
this.#synced = true;
|
|
92
|
+
if (details.open && !this.open) this.open = true;
|
|
93
|
+
this.#announced = this.open;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
#sync = (): void => {
|
|
97
|
+
this.#adopt();
|
|
98
|
+
const details = this.details;
|
|
99
|
+
if (details && details.open !== this.open) details.open = this.open;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
protected override willUpdate(): void {
|
|
103
|
+
this.#adopt();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
protected override updated(): void {
|
|
107
|
+
this.#sync();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
protected override render(): TemplateResult {
|
|
111
|
+
return html`<slot @slotchange=${this.#sync}></slot>`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
declare global {
|
|
116
|
+
interface HTMLElementTagNameMap {
|
|
117
|
+
'und-collapsible': UndCollapsible;
|
|
118
|
+
}
|
|
119
|
+
}
|