@0001-labs/design-system-1 0.3.0-alpha.28 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DS1/0-face/button-label.ts +28 -0
- package/DS1/0-face/calendar.ts +6 -4
- package/DS1/0-face/carousel.ts +70 -0
- package/DS1/0-face/constraint-panel.ts +443 -0
- package/DS1/0-face/constraint-site.ts +201 -0
- package/DS1/0-face/constraints.ts +308 -0
- package/DS1/0-face/copy-text.ts +1 -1
- package/DS1/0-face/cut-fade.ts +312 -0
- package/DS1/0-face/define.ts +30 -2
- package/DS1/0-face/face-correction.ts +96 -0
- package/DS1/0-face/failures.ts +32 -0
- package/DS1/0-face/fault-lines.ts +159 -0
- package/DS1/0-face/feedback-overlays.ts +5 -3
- package/DS1/0-face/feedback.ts +3 -0
- package/DS1/0-face/focus-vision.swift +31 -0
- package/DS1/0-face/focus.ts +181 -0
- package/DS1/0-face/google-face-metrics.json +102 -0
- package/DS1/0-face/grid.ts +61 -4
- package/DS1/0-face/i18n.ts +36 -18
- package/DS1/0-face/layout-inspector.ts +124 -98
- package/DS1/0-face/preference-options.ts +4 -0
- package/DS1/0-face/scaling.ts +21 -3
- package/DS1/0-face/shape.ts +43 -0
- package/DS1/0-face/text-contrast.ts +164 -0
- package/DS1/0-face/theme-bootstrap.js +43 -0
- package/DS1/0-face/toast-queue.ts +7 -1
- package/DS1/0-face/translations/da.json +10 -1
- package/DS1/0-face/translations/de.json +10 -1
- package/DS1/0-face/translations/en.json +10 -1
- package/DS1/0-face/translations/es.json +10 -1
- package/DS1/0-face/translations/fi.json +10 -1
- package/DS1/0-face/translations/fr.json +10 -1
- package/DS1/0-face/translations/is.json +10 -1
- package/DS1/0-face/translations/it.json +10 -1
- package/DS1/0-face/translations/ja.json +10 -1
- package/DS1/0-face/translations/ko.json +10 -1
- package/DS1/0-face/translations/nb.json +10 -1
- package/DS1/0-face/translations/pt-BR.json +10 -1
- package/DS1/0-face/translations/pt.json +10 -1
- package/DS1/0-face/translations/sv.json +10 -1
- package/DS1/0-face/translations/zh.json +10 -1
- package/DS1/0-face/word-wrap.ts +113 -0
- package/DS1/1-root/card.css +47 -20
- package/DS1/1-root/carousel.css +7 -0
- package/DS1/1-root/cjk.css +1 -1
- package/DS1/1-root/component-tokens.css +3 -2
- package/DS1/1-root/context.css +44 -6
- package/DS1/1-root/controls.css +99 -8
- package/DS1/1-root/document.css +9 -1
- package/DS1/1-root/empty.css +46 -5
- package/DS1/1-root/figures.css +50 -3
- package/DS1/1-root/fonts.css +1 -1
- package/DS1/1-root/footer.css +147 -16
- package/DS1/1-root/foundation.ts +60 -0
- package/DS1/1-root/guide.css +35 -0
- package/DS1/1-root/header.css +30 -9
- package/DS1/1-root/material.css +67 -0
- package/DS1/1-root/notice.css +10 -2
- package/DS1/1-root/one.css +15 -7
- package/DS1/1-root/progress.css +9 -1
- package/DS1/1-root/row.css +68 -2
- package/DS1/1-root/table.css +47 -4
- package/DS1/1-root/text.css +26 -0
- package/DS1/2-core/button-split.ts +10 -5
- package/DS1/2-core/chart/chart.css +71 -2
- package/DS1/2-core/chart/grid-chart.ts +2 -1
- package/DS1/2-core/ds-activity.ts +32 -0
- package/DS1/2-core/ds-app-chrome.ts +1 -0
- package/DS1/2-core/ds-avatar.ts +75 -7
- package/DS1/2-core/ds-badge.ts +8 -1
- package/DS1/2-core/ds-button.ts +7 -1
- package/DS1/2-core/ds-chart.ts +184 -49
- package/DS1/2-core/ds-cycle.ts +27 -186
- package/DS1/2-core/ds-device-bezel.ts +1 -0
- package/DS1/2-core/ds-empty.ts +6 -4
- package/DS1/2-core/ds-input.ts +23 -3
- package/DS1/2-core/ds-message.ts +22 -0
- package/DS1/2-core/ds-number.ts +349 -0
- package/DS1/2-core/ds-progress.ts +3 -0
- package/DS1/2-core/ds-radio.ts +3 -0
- package/DS1/2-core/ds-stat.ts +3 -0
- package/DS1/2-core/ds-switch.ts +5 -1
- package/DS1/2-core/ds-tag.ts +9 -2
- package/DS1/2-core/ds-text.ts +7 -0
- package/DS1/2-core/ds-token.ts +3 -0
- package/DS1/2-core/ds-tooltip.ts +17 -2
- package/DS1/2-core/ds-window.ts +1 -0
- package/DS1/2-core/generated/ds-icon-map.ts +47 -5
- package/DS1/2-core/generated/icons-extra.ts +24 -3
- package/DS1/2-core/generated/icons-immediate.ts +3 -3
- package/DS1/2-core/number-expression.ts +64 -0
- package/DS1/2-core/styles/ds-activity.css +16 -0
- package/DS1/2-core/styles/ds-badge.css +4 -1
- package/DS1/2-core/styles/ds-button-host.css +47 -13
- package/DS1/2-core/styles/ds-button-split.css +8 -0
- package/DS1/2-core/styles/ds-button.css +94 -20
- package/DS1/2-core/styles/ds-card.css +6 -0
- package/DS1/2-core/styles/ds-checkbox.css +20 -8
- package/DS1/2-core/styles/ds-image.css +2 -1
- package/DS1/2-core/styles/ds-input.css +37 -4
- package/DS1/2-core/styles/ds-number.css +127 -0
- package/DS1/2-core/styles/ds-radio.css +4 -1
- package/DS1/2-core/styles/ds-switch.css +34 -4
- package/DS1/2-core/styles/ds-tag.css +34 -6
- package/DS1/2-core/styles/ds-text.css +13 -4
- package/DS1/2-core/styles/ds-token.css +4 -1
- package/DS1/2-core/styles/ds-tooltip.css +13 -7
- package/DS1/3-unit/calendar-base.ts +5 -2
- package/DS1/3-unit/context-trigger.ts +29 -2
- package/DS1/3-unit/ds-calendar.ts +711 -37
- package/DS1/3-unit/ds-carousel.ts +13 -1
- package/DS1/3-unit/ds-context.ts +40 -2
- package/DS1/3-unit/ds-form.ts +47 -11
- package/DS1/3-unit/ds-list.ts +31 -3
- package/DS1/3-unit/ds-matrix.ts +3 -0
- package/DS1/3-unit/ds-menu.ts +9 -5
- package/DS1/3-unit/ds-row.ts +17 -2
- package/DS1/3-unit/ds-select.ts +1 -1
- package/DS1/3-unit/ds-sidebar.ts +18 -3
- package/DS1/3-unit/ds-table-of-contents.ts +166 -0
- package/DS1/3-unit/ds-table.ts +2 -1
- package/DS1/3-unit/ds-tabs.ts +40 -2
- package/DS1/3-unit/styles/ds-calendar.css +356 -42
- package/DS1/3-unit/styles/ds-context.css +38 -0
- package/DS1/3-unit/styles/ds-list.css +26 -1
- package/DS1/3-unit/styles/ds-matrix.css +4 -1
- package/DS1/3-unit/styles/ds-row.css +39 -0
- package/DS1/3-unit/styles/ds-select.css +22 -12
- package/DS1/3-unit/styles/ds-sidebar.css +16 -2
- package/DS1/3-unit/styles/ds-table-of-contents.css +40 -0
- package/DS1/3-unit/styles/ds-tabs.css +95 -0
- package/DS1/4-page/ds-container.ts +2 -1
- package/DS1/4-page/ds-document.ts +3 -0
- package/DS1/4-page/ds-footer.ts +93 -18
- package/DS1/4-page/ds-header.ts +5 -1
- package/DS1/4-page/ds-overlay.ts +8 -3
- package/DS1/4-page/ds-page.ts +22 -1
- package/DS1/4-page/email.ts +7 -4
- package/DS1/4-page/styles/ds-container.css +0 -1
- package/DS1/4-page/styles/ds-overlay.css +7 -0
- package/DS1/4-page/styles/ds-page.css +10 -0
- package/DS1/5-visual-kit/app-chrome.ts +129 -0
- package/DS1/5-visual-kit/bezels.ts +394 -0
- package/DS1/5-visual-kit/browser-icons.LICENSE +53 -0
- package/DS1/5-visual-kit/browser-icons.ts +47 -0
- package/DS1/5-visual-kit/browser-styles.ts +53 -0
- package/DS1/5-visual-kit/device-bezel.ts +55 -0
- package/DS1/5-visual-kit/instagram-frame.ts +15 -0
- package/DS1/5-visual-kit/instagram.ts +41 -0
- package/DS1/5-visual-kit/mobile-chrome.ts +25 -0
- package/DS1/5-visual-kit/native-icon-paths.ts +145 -0
- package/DS1/5-visual-kit/window.ts +22 -0
- package/DS1/components.ts +1 -0
- package/DS1/index.ts +14 -1
- package/DS1/react/choice.ts +4 -2
- package/DS1/react/context.ts +11 -6
- package/DS1/react/empty.ts +2 -2
- package/DS1/react/footer.ts +5 -5
- package/DS1/react/header.ts +1 -1
- package/DS1/react/message.ts +4 -2
- package/DS1/react/number.ts +53 -0
- package/DS1/react/sidebar.ts +4 -2
- package/DS1/react/table-of-contents.ts +28 -0
- package/DS1/x-flag/LICENSE.md +26 -0
- package/DS1/x-flag/ac.svg +1 -0
- package/DS1/x-flag/ad.svg +1 -0
- package/DS1/x-flag/ae.svg +1 -0
- package/DS1/x-flag/af.svg +1 -0
- package/DS1/x-flag/ag.svg +1 -0
- package/DS1/x-flag/ai.svg +1 -0
- package/DS1/x-flag/al.svg +1 -0
- package/DS1/x-flag/am.svg +1 -0
- package/DS1/x-flag/ao.svg +1 -0
- package/DS1/x-flag/aq.svg +1 -0
- package/DS1/x-flag/ar.svg +1 -0
- package/DS1/x-flag/as.svg +1 -0
- package/DS1/x-flag/at.svg +1 -0
- package/DS1/x-flag/au.svg +1 -0
- package/DS1/x-flag/aw.svg +1 -0
- package/DS1/x-flag/ax.svg +1 -0
- package/DS1/x-flag/az.svg +1 -0
- package/DS1/x-flag/ba.svg +1 -0
- package/DS1/x-flag/bb.svg +1 -0
- package/DS1/x-flag/bd.svg +1 -0
- package/DS1/x-flag/be.svg +1 -0
- package/DS1/x-flag/bf.svg +1 -0
- package/DS1/x-flag/bg.svg +1 -0
- package/DS1/x-flag/bh.svg +1 -0
- package/DS1/x-flag/bi.svg +1 -0
- package/DS1/x-flag/bj.svg +1 -0
- package/DS1/x-flag/bl.svg +1 -0
- package/DS1/x-flag/bm.svg +1 -0
- package/DS1/x-flag/bn.svg +1 -0
- package/DS1/x-flag/bo.svg +1 -0
- package/DS1/x-flag/bq-bo.svg +1 -0
- package/DS1/x-flag/bq-sa.svg +1 -0
- package/DS1/x-flag/bq-se.svg +1 -0
- package/DS1/x-flag/bq.svg +1 -0
- package/DS1/x-flag/br.svg +1 -0
- package/DS1/x-flag/bs.svg +1 -0
- package/DS1/x-flag/bt.svg +1 -0
- package/DS1/x-flag/bv.svg +1 -0
- package/DS1/x-flag/bw.svg +1 -0
- package/DS1/x-flag/by.svg +1 -0
- package/DS1/x-flag/bz.svg +1 -0
- package/DS1/x-flag/ca.svg +1 -0
- package/DS1/x-flag/cc.svg +1 -0
- package/DS1/x-flag/cd.svg +1 -0
- package/DS1/x-flag/cf.svg +1 -0
- package/DS1/x-flag/cg.svg +1 -0
- package/DS1/x-flag/ch.svg +1 -0
- package/DS1/x-flag/ci.svg +1 -0
- package/DS1/x-flag/ck.svg +1 -0
- package/DS1/x-flag/cl.svg +1 -0
- package/DS1/x-flag/cm.svg +1 -0
- package/DS1/x-flag/cn.svg +1 -0
- package/DS1/x-flag/co.svg +1 -0
- package/DS1/x-flag/cr.svg +1 -0
- package/DS1/x-flag/cu.svg +1 -0
- package/DS1/x-flag/cv.svg +1 -0
- package/DS1/x-flag/cw.svg +1 -0
- package/DS1/x-flag/cx.svg +1 -0
- package/DS1/x-flag/cy.svg +1 -0
- package/DS1/x-flag/cz.svg +1 -0
- package/DS1/x-flag/de.svg +1 -0
- package/DS1/x-flag/dj.svg +1 -0
- package/DS1/x-flag/dk.svg +1 -0
- package/DS1/x-flag/dm.svg +1 -0
- package/DS1/x-flag/do.svg +1 -0
- package/DS1/x-flag/dz.svg +1 -0
- package/DS1/x-flag/ec.svg +1 -0
- package/DS1/x-flag/ee.svg +1 -0
- package/DS1/x-flag/eg.svg +1 -0
- package/DS1/x-flag/eh.svg +1 -0
- package/DS1/x-flag/er.svg +1 -0
- package/DS1/x-flag/es-ct.svg +1 -0
- package/DS1/x-flag/es.svg +1 -0
- package/DS1/x-flag/et.svg +1 -0
- package/DS1/x-flag/eu.svg +1 -0
- package/DS1/x-flag/fi.svg +1 -0
- package/DS1/x-flag/fj.svg +1 -0
- package/DS1/x-flag/fk.svg +1 -0
- package/DS1/x-flag/fm.svg +1 -0
- package/DS1/x-flag/fo.svg +1 -0
- package/DS1/x-flag/fr.svg +1 -0
- package/DS1/x-flag/ga.svg +1 -0
- package/DS1/x-flag/gb-eng.svg +1 -0
- package/DS1/x-flag/gb-nir.svg +1 -0
- package/DS1/x-flag/gb-sct.svg +1 -0
- package/DS1/x-flag/gb-wls.svg +1 -0
- package/DS1/x-flag/gb.svg +1 -0
- package/DS1/x-flag/gd.svg +1 -0
- package/DS1/x-flag/ge.svg +1 -0
- package/DS1/x-flag/gf.svg +1 -0
- package/DS1/x-flag/gg.svg +1 -0
- package/DS1/x-flag/gh.svg +1 -0
- package/DS1/x-flag/gi.svg +1 -0
- package/DS1/x-flag/gl.svg +1 -0
- package/DS1/x-flag/gm.svg +1 -0
- package/DS1/x-flag/gn.svg +1 -0
- package/DS1/x-flag/gp.svg +1 -0
- package/DS1/x-flag/gq.svg +1 -0
- package/DS1/x-flag/gr.svg +1 -0
- package/DS1/x-flag/gs.svg +1 -0
- package/DS1/x-flag/gt.svg +1 -0
- package/DS1/x-flag/gu.svg +1 -0
- package/DS1/x-flag/gw.svg +1 -0
- package/DS1/x-flag/gy.svg +1 -0
- package/DS1/x-flag/hk.svg +1 -0
- package/DS1/x-flag/hm.svg +1 -0
- package/DS1/x-flag/hn.svg +1 -0
- package/DS1/x-flag/hr.svg +1 -0
- package/DS1/x-flag/ht.svg +1 -0
- package/DS1/x-flag/hu.svg +1 -0
- package/DS1/x-flag/ic.svg +1 -0
- package/DS1/x-flag/id.svg +1 -0
- package/DS1/x-flag/ie.svg +1 -0
- package/DS1/x-flag/il.svg +1 -0
- package/DS1/x-flag/im.svg +1 -0
- package/DS1/x-flag/in.svg +1 -0
- package/DS1/x-flag/io.svg +1 -0
- package/DS1/x-flag/iq.svg +1 -0
- package/DS1/x-flag/ir.svg +1 -0
- package/DS1/x-flag/is.svg +1 -0
- package/DS1/x-flag/it.svg +1 -0
- package/DS1/x-flag/je.svg +1 -0
- package/DS1/x-flag/jm.svg +1 -0
- package/DS1/x-flag/jo.svg +1 -0
- package/DS1/x-flag/jp.svg +1 -0
- package/DS1/x-flag/ke.svg +1 -0
- package/DS1/x-flag/kg.svg +1 -0
- package/DS1/x-flag/kh.svg +1 -0
- package/DS1/x-flag/ki.svg +1 -0
- package/DS1/x-flag/km.svg +1 -0
- package/DS1/x-flag/kn.svg +1 -0
- package/DS1/x-flag/kp.svg +1 -0
- package/DS1/x-flag/kr.svg +1 -0
- package/DS1/x-flag/kw.svg +1 -0
- package/DS1/x-flag/ky.svg +1 -0
- package/DS1/x-flag/kz.svg +1 -0
- package/DS1/x-flag/la.svg +1 -0
- package/DS1/x-flag/lb.svg +1 -0
- package/DS1/x-flag/lc.svg +1 -0
- package/DS1/x-flag/li.svg +1 -0
- package/DS1/x-flag/lk.svg +1 -0
- package/DS1/x-flag/lr.svg +1 -0
- package/DS1/x-flag/ls.svg +1 -0
- package/DS1/x-flag/lt.svg +1 -0
- package/DS1/x-flag/lu.svg +1 -0
- package/DS1/x-flag/lv.svg +1 -0
- package/DS1/x-flag/ly.svg +1 -0
- package/DS1/x-flag/ma.svg +1 -0
- package/DS1/x-flag/mc.svg +1 -0
- package/DS1/x-flag/md.svg +1 -0
- package/DS1/x-flag/me.svg +1 -0
- package/DS1/x-flag/mf.svg +1 -0
- package/DS1/x-flag/mg.svg +1 -0
- package/DS1/x-flag/mh.svg +1 -0
- package/DS1/x-flag/mk.svg +1 -0
- package/DS1/x-flag/ml.svg +1 -0
- package/DS1/x-flag/mm.svg +1 -0
- package/DS1/x-flag/mn.svg +1 -0
- package/DS1/x-flag/mo.svg +1 -0
- package/DS1/x-flag/mp.svg +1 -0
- package/DS1/x-flag/mq.svg +1 -0
- package/DS1/x-flag/mr.svg +1 -0
- package/DS1/x-flag/ms.svg +1 -0
- package/DS1/x-flag/mt.svg +1 -0
- package/DS1/x-flag/mu.svg +1 -0
- package/DS1/x-flag/mv.svg +1 -0
- package/DS1/x-flag/mw.svg +1 -0
- package/DS1/x-flag/mx.svg +1 -0
- package/DS1/x-flag/my.svg +1 -0
- package/DS1/x-flag/mz.svg +1 -0
- package/DS1/x-flag/na.svg +1 -0
- package/DS1/x-flag/nc.svg +1 -0
- package/DS1/x-flag/ne.svg +1 -0
- package/DS1/x-flag/nf.svg +1 -0
- package/DS1/x-flag/ng.svg +1 -0
- package/DS1/x-flag/ni.svg +1 -0
- package/DS1/x-flag/nl.svg +1 -0
- package/DS1/x-flag/no.svg +1 -0
- package/DS1/x-flag/np.svg +1 -0
- package/DS1/x-flag/nr.svg +1 -0
- package/DS1/x-flag/nu.svg +1 -0
- package/DS1/x-flag/nz.svg +1 -0
- package/DS1/x-flag/om.svg +1 -0
- package/DS1/x-flag/pa.svg +1 -0
- package/DS1/x-flag/pe.svg +1 -0
- package/DS1/x-flag/pf.svg +1 -0
- package/DS1/x-flag/pg.svg +1 -0
- package/DS1/x-flag/ph.svg +1 -0
- package/DS1/x-flag/pk.svg +1 -0
- package/DS1/x-flag/pl.svg +1 -0
- package/DS1/x-flag/pm.svg +1 -0
- package/DS1/x-flag/pn.svg +1 -0
- package/DS1/x-flag/pr.svg +1 -0
- package/DS1/x-flag/ps.svg +1 -0
- package/DS1/x-flag/pt.svg +1 -0
- package/DS1/x-flag/pw.svg +1 -0
- package/DS1/x-flag/py.svg +1 -0
- package/DS1/x-flag/qa.svg +1 -0
- package/DS1/x-flag/re.svg +1 -0
- package/DS1/x-flag/ro.svg +1 -0
- package/DS1/x-flag/rs.svg +1 -0
- package/DS1/x-flag/ru.svg +1 -0
- package/DS1/x-flag/rw.svg +1 -0
- package/DS1/x-flag/sa.svg +1 -0
- package/DS1/x-flag/sb.svg +1 -0
- package/DS1/x-flag/sc.svg +1 -0
- package/DS1/x-flag/sd.svg +1 -0
- package/DS1/x-flag/se.svg +1 -0
- package/DS1/x-flag/sg.svg +1 -0
- package/DS1/x-flag/sh.svg +1 -0
- package/DS1/x-flag/si.svg +1 -0
- package/DS1/x-flag/sj.svg +1 -0
- package/DS1/x-flag/sk.svg +1 -0
- package/DS1/x-flag/sl.svg +1 -0
- package/DS1/x-flag/sm.svg +1 -0
- package/DS1/x-flag/sn.svg +1 -0
- package/DS1/x-flag/so.svg +1 -0
- package/DS1/x-flag/sr.svg +1 -0
- package/DS1/x-flag/ss.svg +1 -0
- package/DS1/x-flag/st.svg +1 -0
- package/DS1/x-flag/sv.svg +1 -0
- package/DS1/x-flag/sx.svg +1 -0
- package/DS1/x-flag/sy.svg +1 -0
- package/DS1/x-flag/sz.svg +1 -0
- package/DS1/x-flag/ta.svg +1 -0
- package/DS1/x-flag/tc.svg +1 -0
- package/DS1/x-flag/td.svg +1 -0
- package/DS1/x-flag/tf.svg +1 -0
- package/DS1/x-flag/tg.svg +1 -0
- package/DS1/x-flag/th.svg +1 -0
- package/DS1/x-flag/tj.svg +1 -0
- package/DS1/x-flag/tk.svg +1 -0
- package/DS1/x-flag/tl.svg +1 -0
- package/DS1/x-flag/tm.svg +1 -0
- package/DS1/x-flag/tn.svg +1 -0
- package/DS1/x-flag/to.svg +1 -0
- package/DS1/x-flag/tr.svg +1 -0
- package/DS1/x-flag/tt.svg +1 -0
- package/DS1/x-flag/tv.svg +1 -0
- package/DS1/x-flag/tw.svg +1 -0
- package/DS1/x-flag/tz.svg +1 -0
- package/DS1/x-flag/ua.svg +1 -0
- package/DS1/x-flag/ug.svg +1 -0
- package/DS1/x-flag/um.svg +1 -0
- package/DS1/x-flag/us.svg +1 -0
- package/DS1/x-flag/uy.svg +1 -0
- package/DS1/x-flag/uz.svg +1 -0
- package/DS1/x-flag/va.svg +1 -0
- package/DS1/x-flag/vc.svg +1 -0
- package/DS1/x-flag/ve.svg +1 -0
- package/DS1/x-flag/vg.svg +1 -0
- package/DS1/x-flag/vi.svg +1 -0
- package/DS1/x-flag/vn.svg +1 -0
- package/DS1/x-flag/vu.svg +1 -0
- package/DS1/x-flag/wf.svg +1 -0
- package/DS1/x-flag/ws.svg +1 -0
- package/DS1/x-flag/xk.svg +1 -0
- package/DS1/x-flag/ye.svg +1 -0
- package/DS1/x-flag/yt.svg +1 -0
- package/DS1/x-flag/za.svg +1 -0
- package/DS1/x-flag/zm.svg +1 -0
- package/DS1/x-flag/zw.svg +1 -0
- package/DS1/x-icon/android.svg +9 -0
- package/DS1/x-icon/arrange-check.svg +1 -1
- package/DS1/x-icon/arrange-page.svg +1 -1
- package/DS1/x-icon/chrome.svg +7 -0
- package/DS1/x-icon/edge-brand.svg +6 -0
- package/DS1/x-icon/firefox.svg +4 -0
- package/DS1/x-icon/health.svg +3 -0
- package/DS1/x-icon/left.svg +2 -3
- package/DS1/x-icon/linux.svg +1 -0
- package/DS1/x-icon/material.svg +1 -0
- package/DS1/x-icon/milestone-planned.svg +3 -0
- package/DS1/x-icon/milestone.svg +3 -0
- package/DS1/x-icon/more.svg +1 -5
- package/DS1/x-icon/network.svg +3 -0
- package/DS1/x-icon/opera.svg +4 -0
- package/DS1/x-icon/prediction.svg +3 -0
- package/DS1/x-icon/priority-high.svg +3 -0
- package/DS1/x-icon/priority-low.svg +3 -0
- package/DS1/x-icon/priority-medium.svg +3 -0
- package/DS1/x-icon/project.svg +3 -0
- package/DS1/x-icon/redo.svg +2 -2
- package/DS1/x-icon/repeat-small.svg +3 -0
- package/DS1/x-icon/safari.svg +4 -0
- package/DS1/x-icon/scaling.svg +3 -0
- package/DS1/x-icon/tabs.svg +4 -0
- package/DS1/x-icon/windows.svg +5 -0
- package/README.md +3 -3
- package/dist/0-face/button-label.d.ts +5 -0
- package/dist/0-face/button-label.d.ts.map +1 -0
- package/dist/0-face/button-label.js +31 -0
- package/dist/0-face/calendar.d.ts +1 -1
- package/dist/0-face/calendar.d.ts.map +1 -1
- package/dist/0-face/calendar.js +6 -3
- package/dist/0-face/carousel.d.ts +9 -0
- package/dist/0-face/carousel.d.ts.map +1 -1
- package/dist/0-face/carousel.js +80 -0
- package/dist/0-face/constraint-panel.d.ts +43 -0
- package/dist/0-face/constraint-panel.d.ts.map +1 -0
- package/dist/0-face/constraint-panel.js +451 -0
- package/dist/0-face/constraint-site.d.ts +73 -0
- package/dist/0-face/constraint-site.d.ts.map +1 -0
- package/dist/0-face/constraint-site.js +186 -0
- package/dist/0-face/constraints.d.ts +47 -0
- package/dist/0-face/constraints.d.ts.map +1 -0
- package/dist/0-face/constraints.js +274 -0
- package/dist/0-face/copy-text.js +1 -1
- package/dist/0-face/cut-fade.d.ts +112 -0
- package/dist/0-face/cut-fade.d.ts.map +1 -0
- package/dist/0-face/cut-fade.js +274 -0
- package/dist/0-face/define.d.ts.map +1 -1
- package/dist/0-face/define.js +24 -3
- package/dist/0-face/face-correction.d.ts +51 -0
- package/dist/0-face/face-correction.d.ts.map +1 -0
- package/dist/0-face/face-correction.js +80 -0
- package/dist/0-face/failures.d.ts +16 -0
- package/dist/0-face/failures.d.ts.map +1 -0
- package/dist/0-face/failures.js +21 -0
- package/dist/0-face/fault-lines.d.ts +20 -0
- package/dist/0-face/fault-lines.d.ts.map +1 -0
- package/dist/0-face/fault-lines.js +172 -0
- package/dist/0-face/feedback-overlays.d.ts.map +1 -1
- package/dist/0-face/feedback-overlays.js +5 -3
- package/dist/0-face/feedback.d.ts +2 -0
- package/dist/0-face/feedback.d.ts.map +1 -1
- package/dist/0-face/feedback.js +1 -0
- package/dist/0-face/focus.d.ts +71 -0
- package/dist/0-face/focus.d.ts.map +1 -0
- package/dist/0-face/focus.js +196 -0
- package/dist/0-face/grid.d.ts +11 -1
- package/dist/0-face/grid.d.ts.map +1 -1
- package/dist/0-face/grid.js +90 -4
- package/dist/0-face/i18n.d.ts.map +1 -1
- package/dist/0-face/i18n.js +38 -16
- package/dist/0-face/layout-inspector.d.ts +5 -1
- package/dist/0-face/layout-inspector.d.ts.map +1 -1
- package/dist/0-face/layout-inspector.js +130 -104
- package/dist/0-face/preference-options.d.ts +4 -0
- package/dist/0-face/preference-options.d.ts.map +1 -1
- package/dist/0-face/scaling.d.ts +8 -1
- package/dist/0-face/scaling.d.ts.map +1 -1
- package/dist/0-face/scaling.js +19 -2
- package/dist/0-face/shape.d.ts +35 -0
- package/dist/0-face/shape.d.ts.map +1 -0
- package/dist/0-face/shape.js +23 -0
- package/dist/0-face/text-contrast.d.ts +22 -0
- package/dist/0-face/text-contrast.d.ts.map +1 -0
- package/dist/0-face/text-contrast.js +178 -0
- package/dist/0-face/theme-bootstrap.js +56 -0
- package/dist/0-face/toast-queue.d.ts +4 -0
- package/dist/0-face/toast-queue.d.ts.map +1 -1
- package/dist/0-face/toast-queue.js +4 -1
- package/dist/0-face/translations/da.json +10 -1
- package/dist/0-face/translations/de.json +10 -1
- package/dist/0-face/translations/en.json +10 -1
- package/dist/0-face/translations/es.json +10 -1
- package/dist/0-face/translations/fi.json +10 -1
- package/dist/0-face/translations/fr.json +10 -1
- package/dist/0-face/translations/is.json +10 -1
- package/dist/0-face/translations/it.json +10 -1
- package/dist/0-face/translations/ja.json +10 -1
- package/dist/0-face/translations/ko.json +10 -1
- package/dist/0-face/translations/nb.json +10 -1
- package/dist/0-face/translations/pt-BR.json +10 -1
- package/dist/0-face/translations/pt.json +10 -1
- package/dist/0-face/translations/sv.json +10 -1
- package/dist/0-face/translations/zh.json +10 -1
- package/dist/0-face/word-wrap.d.ts +6 -0
- package/dist/0-face/word-wrap.d.ts.map +1 -0
- package/dist/0-face/word-wrap.js +119 -0
- package/dist/1-root/foundation.d.ts +12 -0
- package/dist/1-root/foundation.d.ts.map +1 -0
- package/dist/1-root/foundation.js +59 -0
- package/dist/2-core/button-split.d.ts +1 -0
- package/dist/2-core/button-split.d.ts.map +1 -1
- package/dist/2-core/button-split.js +9 -4
- package/dist/2-core/chart/grid-chart.d.ts +2 -0
- package/dist/2-core/chart/grid-chart.d.ts.map +1 -1
- package/dist/2-core/chart/grid-chart.js +2 -1
- package/dist/2-core/ds-activity.d.ts +25 -0
- package/dist/2-core/ds-activity.d.ts.map +1 -0
- package/dist/2-core/ds-activity.js +28 -0
- package/dist/2-core/ds-app-chrome.d.ts +2 -0
- package/dist/2-core/ds-app-chrome.d.ts.map +1 -0
- package/dist/2-core/ds-app-chrome.js +1 -0
- package/dist/2-core/ds-avatar.d.ts +12 -0
- package/dist/2-core/ds-avatar.d.ts.map +1 -1
- package/dist/2-core/ds-avatar.js +86 -7
- package/dist/2-core/ds-badge.d.ts +7 -1
- package/dist/2-core/ds-badge.d.ts.map +1 -1
- package/dist/2-core/ds-badge.js +8 -1
- package/dist/2-core/ds-button.d.ts +12 -0
- package/dist/2-core/ds-button.d.ts.map +1 -1
- package/dist/2-core/ds-button.js +4 -0
- package/dist/2-core/ds-chart.d.ts +28 -3
- package/dist/2-core/ds-chart.d.ts.map +1 -1
- package/dist/2-core/ds-chart.js +110 -130
- package/dist/2-core/ds-cycle.d.ts +2 -2
- package/dist/2-core/ds-cycle.d.ts.map +1 -1
- package/dist/2-core/ds-cycle.js +36 -171
- package/dist/2-core/ds-device-bezel.d.ts +2 -0
- package/dist/2-core/ds-device-bezel.d.ts.map +1 -0
- package/dist/2-core/ds-device-bezel.js +1 -0
- package/dist/2-core/ds-empty.d.ts +2 -2
- package/dist/2-core/ds-empty.d.ts.map +1 -1
- package/dist/2-core/ds-empty.js +6 -4
- package/dist/2-core/ds-input.d.ts +7 -0
- package/dist/2-core/ds-input.d.ts.map +1 -1
- package/dist/2-core/ds-input.js +23 -3
- package/dist/2-core/ds-message.d.ts +11 -0
- package/dist/2-core/ds-message.d.ts.map +1 -1
- package/dist/2-core/ds-message.js +18 -0
- package/dist/2-core/ds-number.d.ts +86 -0
- package/dist/2-core/ds-number.d.ts.map +1 -0
- package/dist/2-core/ds-number.js +326 -0
- package/dist/2-core/ds-progress.d.ts +3 -0
- package/dist/2-core/ds-progress.d.ts.map +1 -1
- package/dist/2-core/ds-progress.js +3 -0
- package/dist/2-core/ds-radio.d.ts +3 -0
- package/dist/2-core/ds-radio.d.ts.map +1 -1
- package/dist/2-core/ds-radio.js +10 -1
- package/dist/2-core/ds-stat.d.ts +3 -0
- package/dist/2-core/ds-stat.d.ts.map +1 -1
- package/dist/2-core/ds-stat.js +3 -0
- package/dist/2-core/ds-switch.d.ts +14 -1
- package/dist/2-core/ds-switch.d.ts.map +1 -1
- package/dist/2-core/ds-switch.js +3 -1
- package/dist/2-core/ds-tag.d.ts +8 -1
- package/dist/2-core/ds-tag.d.ts.map +1 -1
- package/dist/2-core/ds-tag.js +12 -2
- package/dist/2-core/ds-text.d.ts +7 -0
- package/dist/2-core/ds-text.d.ts.map +1 -1
- package/dist/2-core/ds-text.js +7 -0
- package/dist/2-core/ds-token.d.ts +3 -0
- package/dist/2-core/ds-token.d.ts.map +1 -1
- package/dist/2-core/ds-token.js +3 -0
- package/dist/2-core/ds-tooltip.d.ts.map +1 -1
- package/dist/2-core/ds-tooltip.js +23 -2
- package/dist/2-core/ds-window.d.ts +2 -0
- package/dist/2-core/ds-window.d.ts.map +1 -0
- package/dist/2-core/ds-window.js +1 -0
- package/dist/2-core/generated/ds-icon-map.d.ts +27 -6
- package/dist/2-core/generated/ds-icon-map.d.ts.map +1 -1
- package/dist/2-core/generated/ds-icon-map.js +47 -5
- package/dist/2-core/generated/icons-extra.d.ts.map +1 -1
- package/dist/2-core/generated/icons-extra.js +24 -3
- package/dist/2-core/generated/icons-immediate.d.ts +1 -1
- package/dist/2-core/generated/icons-immediate.d.ts.map +1 -1
- package/dist/2-core/generated/icons-immediate.js +3 -3
- package/dist/2-core/number-expression.d.ts +12 -0
- package/dist/2-core/number-expression.d.ts.map +1 -0
- package/dist/2-core/number-expression.js +82 -0
- package/dist/3-unit/calendar-base.d.ts +5 -0
- package/dist/3-unit/calendar-base.d.ts.map +1 -1
- package/dist/3-unit/calendar-base.js +3 -2
- package/dist/3-unit/context-trigger.d.ts.map +1 -1
- package/dist/3-unit/context-trigger.js +32 -2
- package/dist/3-unit/ds-calendar.d.ts +197 -4
- package/dist/3-unit/ds-calendar.d.ts.map +1 -1
- package/dist/3-unit/ds-calendar.js +687 -45
- package/dist/3-unit/ds-carousel.d.ts +3 -0
- package/dist/3-unit/ds-carousel.d.ts.map +1 -1
- package/dist/3-unit/ds-carousel.js +13 -1
- package/dist/3-unit/ds-context.d.ts +18 -1
- package/dist/3-unit/ds-context.d.ts.map +1 -1
- package/dist/3-unit/ds-context.js +37 -1
- package/dist/3-unit/ds-form.d.ts +9 -0
- package/dist/3-unit/ds-form.d.ts.map +1 -1
- package/dist/3-unit/ds-form.js +52 -11
- package/dist/3-unit/ds-list.d.ts +20 -1
- package/dist/3-unit/ds-list.d.ts.map +1 -1
- package/dist/3-unit/ds-list.js +31 -3
- package/dist/3-unit/ds-matrix.d.ts +3 -0
- package/dist/3-unit/ds-matrix.d.ts.map +1 -1
- package/dist/3-unit/ds-matrix.js +3 -0
- package/dist/3-unit/ds-menu.d.ts.map +1 -1
- package/dist/3-unit/ds-menu.js +17 -1
- package/dist/3-unit/ds-row.d.ts +13 -0
- package/dist/3-unit/ds-row.d.ts.map +1 -1
- package/dist/3-unit/ds-row.js +15 -2
- package/dist/3-unit/ds-select.js +1 -1
- package/dist/3-unit/ds-sidebar.d.ts +17 -0
- package/dist/3-unit/ds-sidebar.d.ts.map +1 -1
- package/dist/3-unit/ds-sidebar.js +14 -3
- package/dist/3-unit/ds-table-of-contents.d.ts +68 -0
- package/dist/3-unit/ds-table-of-contents.d.ts.map +1 -0
- package/dist/3-unit/ds-table-of-contents.js +190 -0
- package/dist/3-unit/ds-table.d.ts.map +1 -1
- package/dist/3-unit/ds-table.js +2 -1
- package/dist/3-unit/ds-tabs.d.ts +32 -1
- package/dist/3-unit/ds-tabs.d.ts.map +1 -1
- package/dist/3-unit/ds-tabs.js +39 -1
- package/dist/4-page/ds-container.d.ts.map +1 -1
- package/dist/4-page/ds-container.js +2 -1
- package/dist/4-page/ds-document.d.ts +3 -0
- package/dist/4-page/ds-document.d.ts.map +1 -1
- package/dist/4-page/ds-document.js +3 -0
- package/dist/4-page/ds-footer.d.ts +47 -7
- package/dist/4-page/ds-footer.d.ts.map +1 -1
- package/dist/4-page/ds-footer.js +58 -14
- package/dist/4-page/ds-header.d.ts +6 -0
- package/dist/4-page/ds-header.d.ts.map +1 -1
- package/dist/4-page/ds-header.js +4 -1
- package/dist/4-page/ds-overlay.d.ts +2 -2
- package/dist/4-page/ds-overlay.d.ts.map +1 -1
- package/dist/4-page/ds-overlay.js +8 -3
- package/dist/4-page/ds-page.d.ts +12 -0
- package/dist/4-page/ds-page.d.ts.map +1 -1
- package/dist/4-page/ds-page.js +19 -1
- package/dist/4-page/email.d.ts +2 -0
- package/dist/4-page/email.d.ts.map +1 -1
- package/dist/4-page/email.js +5 -4
- package/dist/5-visual-kit/app-chrome.d.ts +98 -0
- package/dist/5-visual-kit/app-chrome.d.ts.map +1 -0
- package/dist/5-visual-kit/app-chrome.js +119 -0
- package/dist/5-visual-kit/bezels.d.ts +30 -0
- package/dist/5-visual-kit/bezels.d.ts.map +1 -0
- package/dist/5-visual-kit/bezels.js +388 -0
- package/dist/5-visual-kit/browser-icons.d.ts +5 -0
- package/dist/5-visual-kit/browser-icons.d.ts.map +1 -0
- package/dist/5-visual-kit/browser-icons.js +51 -0
- package/dist/5-visual-kit/browser-styles.d.ts +3 -0
- package/dist/5-visual-kit/browser-styles.d.ts.map +1 -0
- package/dist/5-visual-kit/browser-styles.js +52 -0
- package/dist/5-visual-kit/device-bezel.d.ts +84 -0
- package/dist/5-visual-kit/device-bezel.d.ts.map +1 -0
- package/dist/5-visual-kit/device-bezel.js +56 -0
- package/dist/5-visual-kit/instagram-frame.d.ts +8 -0
- package/dist/5-visual-kit/instagram-frame.d.ts.map +1 -0
- package/dist/5-visual-kit/instagram-frame.js +13 -0
- package/dist/5-visual-kit/instagram.d.ts +18 -0
- package/dist/5-visual-kit/instagram.d.ts.map +1 -0
- package/dist/5-visual-kit/instagram.js +39 -0
- package/dist/5-visual-kit/mobile-chrome.d.ts +4 -0
- package/dist/5-visual-kit/mobile-chrome.d.ts.map +1 -0
- package/dist/5-visual-kit/mobile-chrome.js +24 -0
- package/dist/5-visual-kit/native-icon-paths.d.ts +146 -0
- package/dist/5-visual-kit/native-icon-paths.d.ts.map +1 -0
- package/dist/5-visual-kit/native-icon-paths.js +145 -0
- package/dist/5-visual-kit/window.d.ts +51 -0
- package/dist/5-visual-kit/window.d.ts.map +1 -0
- package/dist/5-visual-kit/window.js +20 -0
- package/dist/browser-icons-BFbS1tIx.js +56 -0
- package/dist/browser-icons-BFbS1tIx.js.map +1 -0
- package/dist/browser-icons-CT8qU77Z.js +48 -0
- package/dist/browser-icons-CT8qU77Z.js.map +1 -0
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +1 -0
- package/dist/design-system-1.bundle.js +5874 -2097
- package/dist/design-system-1.bundle.js.map +1 -1
- package/dist/design-system-1.bundle.min.js +7332 -4682
- package/dist/design-system-1.bundle.min.js.map +1 -1
- package/dist/design-system-1.css +1 -1
- package/dist/feedback.js +197 -167
- package/dist/feedback.js.map +1 -1
- package/dist/{icons-extra-CRxxWFjX.js → icons-extra-BMPvmQPI.js} +25 -4
- package/dist/icons-extra-BMPvmQPI.js.map +1 -0
- package/dist/{icons-extra-H5pqCM_R.js → icons-extra-BfYOw-cR.js} +83 -5
- package/dist/icons-extra-BfYOw-cR.js.map +1 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/instagram-CKofs55A.js +50 -0
- package/dist/instagram-CKofs55A.js.map +1 -0
- package/dist/instagram-CcYf5oiM.js +48 -0
- package/dist/instagram-CcYf5oiM.js.map +1 -0
- package/dist/lit-Ce_uWYM4.js +612 -0
- package/dist/lit-Ce_uWYM4.js.map +1 -0
- package/dist/lit-DGUVm1Ce.js +557 -0
- package/dist/lit-DGUVm1Ce.js.map +1 -0
- package/dist/native-icon-paths-CB9evXBM.js +93 -0
- package/dist/native-icon-paths-CB9evXBM.js.map +1 -0
- package/dist/native-icon-paths-zay-3g_n.js +150 -0
- package/dist/native-icon-paths-zay-3g_n.js.map +1 -0
- package/dist/react/avatar.d.ts +1 -1
- package/dist/react/choice.d.ts +4 -0
- package/dist/react/choice.d.ts.map +1 -1
- package/dist/react/choice.js +2 -2
- package/dist/react/context.d.ts +19 -4
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +4 -4
- package/dist/react/empty.d.ts +2 -2
- package/dist/react/empty.d.ts.map +1 -1
- package/dist/react/empty.js +1 -1
- package/dist/react/footer.d.ts +5 -5
- package/dist/react/footer.d.ts.map +1 -1
- package/dist/react/footer.js +2 -2
- package/dist/react/header.d.ts +2 -2
- package/dist/react/header.d.ts.map +1 -1
- package/dist/react/message.d.ts +4 -0
- package/dist/react/message.d.ts.map +1 -1
- package/dist/react/message.js +2 -2
- package/dist/react/number.d.ts +53 -0
- package/dist/react/number.d.ts.map +1 -0
- package/dist/react/number.js +25 -0
- package/dist/react/page.d.ts +1 -1
- package/dist/react/sidebar.d.ts +4 -0
- package/dist/react/sidebar.d.ts.map +1 -1
- package/dist/react/sidebar.js +2 -2
- package/dist/react/table-of-contents.d.ts +19 -0
- package/dist/react/table-of-contents.d.ts.map +1 -0
- package/dist/react/table-of-contents.js +28 -0
- package/dist/{shared-words-CdMDVtXx.js → shared-words-C5cjxMjZ.js} +151 -16
- package/dist/shared-words-C5cjxMjZ.js.map +1 -0
- package/dist/{shared-words-BtRee8xR.js → shared-words-Cdm7xd-_.js} +163 -28
- package/dist/shared-words-Cdm7xd-_.js.map +1 -0
- package/package.json +25 -12
- package/DS1/3-unit/ds-calendar-large.ts +0 -353
- package/DS1/3-unit/styles/ds-calendar-large.css +0 -178
- package/dist/3-unit/ds-calendar-large.d.ts +0 -142
- package/dist/3-unit/ds-calendar-large.d.ts.map +0 -1
- package/dist/3-unit/ds-calendar-large.js +0 -308
- package/dist/icons-extra-CRxxWFjX.js.map +0 -1
- package/dist/icons-extra-H5pqCM_R.js.map +0 -1
- package/dist/shared-words-BtRee8xR.js.map +0 -1
- package/dist/shared-words-CdMDVtXx.js.map +0 -1
package/dist/3-unit/ds-row.js
CHANGED
|
@@ -2,6 +2,7 @@ import { LitElement, html, unsafeCSS } from "lit";
|
|
|
2
2
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
3
|
import styles from "./styles/ds-row.css?inline";
|
|
4
4
|
import { define } from "../0-face/define";
|
|
5
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
5
6
|
/** The values `aria-current` takes besides `page`. */
|
|
6
7
|
const CURRENT = new Set(["page", "step", "location", "date", "time", "true"]);
|
|
7
8
|
/**
|
|
@@ -28,6 +29,14 @@ const CURRENT = new Set(["page", "step", "location", "date", "time", "true"]);
|
|
|
28
29
|
* @attr label - The accessible name, when the row's words do not say it.
|
|
29
30
|
* @attr target - Where a link opens (`_blank`, …).
|
|
30
31
|
* @attr rel - The link's relationship (`noopener`, …).
|
|
32
|
+
* A record's row puts its parts in classes: `ds-row__name` for the words,
|
|
33
|
+
* which hug and give way first, and `ds-row__value` for the figure or date at
|
|
34
|
+
* the row's end; a 16px picture (an avatar tile, a large icon) before the
|
|
35
|
+
* name stands on its square with the row's gap putting the words on the next.
|
|
36
|
+
* The element measures each name and marks it `data-cut="end"` while its
|
|
37
|
+
* words do not fit, so the stylesheet fades them over the last square, never
|
|
38
|
+
* an ellipsis; a `ds-text literal` name fades the same way.
|
|
39
|
+
*
|
|
31
40
|
* @slot - The row's content, inside its press target.
|
|
32
41
|
* @slot end - Controls of their own after the content, outside the press target.
|
|
33
42
|
* @fires ds-row-press - `{ href }`: the row was pressed. Cancel it to route a link yourself; a modified click on a link is left to the browser.
|
|
@@ -36,6 +45,10 @@ const CURRENT = new Set(["page", "step", "location", "date", "time", "true"]);
|
|
|
36
45
|
export class Row extends LitElement {
|
|
37
46
|
constructor() {
|
|
38
47
|
super();
|
|
48
|
+
/** Marks each `.ds-row__name` `data-cut="end"` while its words are wider than its box, measured again as they resize or change. */
|
|
49
|
+
this.cuts = new CutFades(this, { targets: () => this.querySelectorAll(":scope > .ds-row__name"), text: true });
|
|
50
|
+
/** Measures the names again, as when the slotted content changes. */
|
|
51
|
+
this.measureNames = () => this.cuts.measure();
|
|
39
52
|
this.fill = false;
|
|
40
53
|
this.centered = false;
|
|
41
54
|
this.end = false;
|
|
@@ -80,10 +93,10 @@ export class Row extends LitElement {
|
|
|
80
93
|
}
|
|
81
94
|
render() {
|
|
82
95
|
if (!this.href && !this.interactive)
|
|
83
|
-
return html `<slot></slot>`;
|
|
96
|
+
return html `<slot @slotchange=${this.measureNames}></slot>`;
|
|
84
97
|
const current = this.currentValue;
|
|
85
98
|
const label = this.label || undefined;
|
|
86
|
-
const content = html `<slot></slot>`;
|
|
99
|
+
const content = html `<slot @slotchange=${this.measureNames}></slot>`;
|
|
87
100
|
const target = this.href
|
|
88
101
|
? this.disabled
|
|
89
102
|
? html `<a class="target" part="target" role="link" aria-disabled="true" aria-label=${ifDefined(label)}>${content}</a>`
|
package/dist/3-unit/ds-select.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, nothing, unsafeCSS } from "lit";
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
3
|
import { shortcutLabel } from "../0-face/keys";
|
|
4
|
-
import down from "../x-icon/down.svg?raw";
|
|
4
|
+
import down from "../x-icon/chevron-down.svg?raw";
|
|
5
5
|
import check from "../x-icon/check.svg?raw";
|
|
6
6
|
import menuStyles from "./styles/ds-menu.css?inline";
|
|
7
7
|
import styles from "./styles/ds-select.css?inline";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
2
3
|
import "../0-face/tooltips";
|
|
3
4
|
import "../2-core/ds-button";
|
|
4
5
|
import "../2-core/ds-icon";
|
|
@@ -22,6 +23,8 @@ export interface SidebarItem {
|
|
|
22
23
|
disabled?: boolean;
|
|
23
24
|
/** Small muted words at the row's end: a count, a size. */
|
|
24
25
|
meta?: string;
|
|
26
|
+
/** Small muted words just after the label, read with it: a version. */
|
|
27
|
+
detail?: string;
|
|
25
28
|
/** Optional application content following this navigation row. */
|
|
26
29
|
afterSlot?: string;
|
|
27
30
|
action?: {
|
|
@@ -53,9 +56,15 @@ export interface SidebarMoveDetail {
|
|
|
53
56
|
* `0-face/sidebar.ts`). The application keeps the rows: it passes the
|
|
54
57
|
* visible ones in `items`, in order, and answers the events.
|
|
55
58
|
*
|
|
59
|
+
* With `narrow`, the navigation is eight squares wide and each row hugs its
|
|
60
|
+
* words: the pointer's and the current row's fill wraps the label, its meta
|
|
61
|
+
* and its disclosure, 4px either side, instead of running across the column.
|
|
62
|
+
* For an application's few places beside its work.
|
|
63
|
+
*
|
|
56
64
|
* @element ds-sidebar
|
|
57
65
|
* @attr label - The navigation's or the tree's accessible name.
|
|
58
66
|
* @attr tree - A tree of nested things instead of navigation.
|
|
67
|
+
* @attr narrow - Navigation eight squares wide, each row hugging its words.
|
|
59
68
|
* @fires sidebar-toggle - `{ id, expanded }`: a row asks to open or close.
|
|
60
69
|
* @fires sidebar-activate - `{ id }`: a row was pressed (navigation), or Enter or a double click opened one (a tree).
|
|
61
70
|
* @fires sidebar-select - `{ id }`: a click, Space or Enter chose a tree row.
|
|
@@ -89,6 +98,10 @@ export declare class Sidebar extends LitElement {
|
|
|
89
98
|
type: BooleanConstructor;
|
|
90
99
|
reflect: boolean;
|
|
91
100
|
};
|
|
101
|
+
narrow: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
reflect: boolean;
|
|
104
|
+
};
|
|
92
105
|
reorderable: {
|
|
93
106
|
type: BooleanConstructor;
|
|
94
107
|
reflect: boolean;
|
|
@@ -103,9 +116,13 @@ export declare class Sidebar extends LitElement {
|
|
|
103
116
|
/** Place navigation disclosures before the label; default preserves trailing disclosures. */
|
|
104
117
|
disclosurePosition?: "start" | "end";
|
|
105
118
|
tree: boolean;
|
|
119
|
+
/** Eight squares wide, each row hugging its words (navigation only). */
|
|
120
|
+
narrow: boolean;
|
|
106
121
|
reorderable: boolean;
|
|
107
122
|
private dragId?;
|
|
108
123
|
static styles: import("lit").CSSResult;
|
|
124
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
125
|
+
protected readonly cuts: CutFades;
|
|
109
126
|
/** In a tree, the row that holds the Tab stop. */
|
|
110
127
|
private focusId?;
|
|
111
128
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-sidebar.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-sidebar.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-sidebar.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,6 +2,7 @@ import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
|
2
2
|
import { repeat } from "lit/directives/repeat.js";
|
|
3
3
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
4
4
|
import { define } from "../0-face/define";
|
|
5
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
5
6
|
import { treeStep } from "../0-face/sidebar";
|
|
6
7
|
import "../0-face/tooltips";
|
|
7
8
|
import "../2-core/ds-button";
|
|
@@ -23,9 +24,15 @@ import styles from "./styles/ds-sidebar.css?inline";
|
|
|
23
24
|
* `0-face/sidebar.ts`). The application keeps the rows: it passes the
|
|
24
25
|
* visible ones in `items`, in order, and answers the events.
|
|
25
26
|
*
|
|
27
|
+
* With `narrow`, the navigation is eight squares wide and each row hugs its
|
|
28
|
+
* words: the pointer's and the current row's fill wraps the label, its meta
|
|
29
|
+
* and its disclosure, 4px either side, instead of running across the column.
|
|
30
|
+
* For an application's few places beside its work.
|
|
31
|
+
*
|
|
26
32
|
* @element ds-sidebar
|
|
27
33
|
* @attr label - The navigation's or the tree's accessible name.
|
|
28
34
|
* @attr tree - A tree of nested things instead of navigation.
|
|
35
|
+
* @attr narrow - Navigation eight squares wide, each row hugging its words.
|
|
29
36
|
* @fires sidebar-toggle - `{ id, expanded }`: a row asks to open or close.
|
|
30
37
|
* @fires sidebar-activate - `{ id }`: a row was pressed (navigation), or Enter or a double click opened one (a tree).
|
|
31
38
|
* @fires sidebar-select - `{ id }`: a click, Space or Enter chose a tree row.
|
|
@@ -34,11 +41,14 @@ import styles from "./styles/ds-sidebar.css?inline";
|
|
|
34
41
|
export class Sidebar extends LitElement {
|
|
35
42
|
constructor() {
|
|
36
43
|
super();
|
|
44
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
45
|
+
this.cuts = new CutFades(this, { selector: ".name, .tree .label" });
|
|
37
46
|
this.fontsReady = false;
|
|
38
47
|
this.items = [];
|
|
39
48
|
this.label = "Navigation";
|
|
40
49
|
this.empty = "No items";
|
|
41
50
|
this.tree = false;
|
|
51
|
+
this.narrow = false;
|
|
42
52
|
this.reorderable = false;
|
|
43
53
|
}
|
|
44
54
|
connectedCallback() {
|
|
@@ -189,7 +199,7 @@ export class Sidebar extends LitElement {
|
|
|
189
199
|
@focus=${() => { this.focusId = item.id; }}>
|
|
190
200
|
<span class="disclosure" aria-hidden="true">${item.expanded === undefined ? nothing : html `<ds-icon type="right" ?data-open=${item.expanded}></ds-icon>`}</span>
|
|
191
201
|
${item.icon ? html `<span class="icon" aria-hidden="true"><ds-icon type=${item.icon}></ds-icon></span>` : nothing}
|
|
192
|
-
<span class="label">${item.label}</span>
|
|
202
|
+
<span class="label">${item.label}${item.detail ? html `<span class="detail">${item.detail}</span>` : nothing}</span>
|
|
193
203
|
${item.meta ? html `<span class="meta">${item.meta}</span>` : nothing}
|
|
194
204
|
</div>`;
|
|
195
205
|
})}
|
|
@@ -309,12 +319,12 @@ export class Sidebar extends LitElement {
|
|
|
309
319
|
${item.href && !item.disabled ? html `
|
|
310
320
|
<a href=${item.href} draggable=${ifDefined(this.reorderable ? "false" : undefined)} data-item=${item.id} aria-current=${ifDefined(item.current ? "page" : undefined)}
|
|
311
321
|
@click=${(event) => this.activate(event, item)}
|
|
312
|
-
@keydown=${(event) => this.navigate(event, item)}><span class="name">${item.icon ? html `<ds-icon type=${item.icon} aria-hidden="true"></ds-icon>` : nothing}${item.label}</span></a>` : html `
|
|
322
|
+
@keydown=${(event) => this.navigate(event, item)}><span class="name">${item.icon ? html `<ds-icon type=${item.icon} aria-hidden="true"></ds-icon>` : nothing}${item.label}${item.detail ? html `<span class="detail">${item.detail}</span>` : nothing}</span></a>` : html `
|
|
313
323
|
<button type="button" data-item=${item.id} ?disabled=${item.disabled}
|
|
314
324
|
aria-expanded=${ifDefined(item.expanded === undefined ? undefined : String(item.expanded))}
|
|
315
325
|
aria-current=${ifDefined(item.current ? "page" : undefined)}
|
|
316
326
|
@click=${(event) => this.activate(event, item)}
|
|
317
|
-
@keydown=${(event) => this.navigate(event, item)}><span class="name">${item.icon ? html `<ds-icon type=${item.icon} aria-hidden="true"></ds-icon>` : nothing}${item.label}</span></button>`}
|
|
327
|
+
@keydown=${(event) => this.navigate(event, item)}><span class="name">${item.icon ? html `<ds-icon type=${item.icon} aria-hidden="true"></ds-icon>` : nothing}${item.label}${item.detail ? html `<span class="detail">${item.detail}</span>` : nothing}</span></button>`}
|
|
318
328
|
</ds-button>
|
|
319
329
|
${this.disclosurePosition !== "start" ? this.renderDisclosure(item) : nothing}
|
|
320
330
|
<span class="spacer" aria-hidden="true"></span>
|
|
@@ -336,6 +346,7 @@ Sidebar.properties = {
|
|
|
336
346
|
collapseIcon: { type: String, attribute: "collapse-icon" },
|
|
337
347
|
disclosurePosition: { type: String, attribute: "disclosure-position", reflect: true },
|
|
338
348
|
tree: { type: Boolean, reflect: true },
|
|
349
|
+
narrow: { type: Boolean, reflect: true },
|
|
339
350
|
reorderable: { type: Boolean, reflect: true },
|
|
340
351
|
};
|
|
341
352
|
Sidebar.styles = unsafeCSS(styles);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { CutFades } from '../0-face/cut-fade';
|
|
3
|
+
import '../0-face/tooltips';
|
|
4
|
+
import '../2-core/ds-text';
|
|
5
|
+
export interface TableOfContentsItem {
|
|
6
|
+
href: string;
|
|
7
|
+
label: string;
|
|
8
|
+
depth?: number;
|
|
9
|
+
}
|
|
10
|
+
/** A page's section links. Placement belongs to the page, not this Unit.
|
|
11
|
+
* Supply items or slot native anchors with data-depth. Same-page links track
|
|
12
|
+
* their headings inside the actual scrolling container, including a shadow root.
|
|
13
|
+
* @element ds-table-of-contents
|
|
14
|
+
* @fires toc-change - { href }: the section in view changed.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TableOfContents extends LitElement {
|
|
17
|
+
static properties: {
|
|
18
|
+
items: {
|
|
19
|
+
attribute: boolean;
|
|
20
|
+
};
|
|
21
|
+
label: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
};
|
|
24
|
+
literal: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
};
|
|
27
|
+
target: {
|
|
28
|
+
attribute: boolean;
|
|
29
|
+
};
|
|
30
|
+
current: {
|
|
31
|
+
state: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
static styles: import("lit").CSSResult;
|
|
35
|
+
/** A cut label fades over its last square, never an ellipsis: marks it `data-cut="end"` while it does not fit. */
|
|
36
|
+
protected readonly cuts: CutFades;
|
|
37
|
+
items: TableOfContentsItem[];
|
|
38
|
+
label: string;
|
|
39
|
+
literal: boolean;
|
|
40
|
+
/** Optional content scope, especially when the contents stand inside another component's shadow. */
|
|
41
|
+
target?: HTMLElement;
|
|
42
|
+
current: string;
|
|
43
|
+
private links;
|
|
44
|
+
private sections;
|
|
45
|
+
private scroller;
|
|
46
|
+
private frame;
|
|
47
|
+
private observer?;
|
|
48
|
+
private resize?;
|
|
49
|
+
private readonly relabel;
|
|
50
|
+
constructor();
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
protected updated(changed: Map<PropertyKey, unknown>): void;
|
|
54
|
+
private destination;
|
|
55
|
+
/** Read links and targets again after replacing content or moving the Unit. */
|
|
56
|
+
refresh(): void;
|
|
57
|
+
private schedule;
|
|
58
|
+
private track;
|
|
59
|
+
private mark;
|
|
60
|
+
private follow;
|
|
61
|
+
render(): import("lit").TemplateResult<1>;
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'ds-table-of-contents': TableOfContents;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=ds-table-of-contents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-table-of-contents.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-table-of-contents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,MAAM,KAAK,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAG3B,MAAM,WAAW,mBAAmB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CAAE;AAErF;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;MAGf;IACF,MAAM,CAAC,MAAM,0BAAqB;IAClC,kHAAkH;IAClH,SAAS,CAAC,QAAQ,CAAC,IAAI,WAAyG;IACxH,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACzB,oGAAoG;IAC5F,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,QAAQ,CAA2D;IAC3E,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,MAAM,CAAC,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;;IAItD,iBAAiB;IAcjB,oBAAoB;IAWpB,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAGpD,OAAO,CAAC,WAAW;IAWnB,+EAA+E;IAC/E,OAAO;IAyBP,OAAO,CAAC,QAAQ,CAId;IACF,OAAO,CAAC,KAAK;IAsBb,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,MAAM,CAWZ;IACF,MAAM;CAUP;AAED,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,sBAAsB,EAAE,eAAe,CAAC;KAAE;CAAE"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { LitElement, html, nothing, unsafeCSS } from 'lit';
|
|
2
|
+
import { define } from '../0-face/define';
|
|
3
|
+
import { CutFades } from '../0-face/cut-fade';
|
|
4
|
+
import { getText } from '../0-face/i18n';
|
|
5
|
+
import '../0-face/tooltips';
|
|
6
|
+
import '../2-core/ds-text';
|
|
7
|
+
import styles from './styles/ds-table-of-contents.css?inline';
|
|
8
|
+
/** A page's section links. Placement belongs to the page, not this Unit.
|
|
9
|
+
* Supply items or slot native anchors with data-depth. Same-page links track
|
|
10
|
+
* their headings inside the actual scrolling container, including a shadow root.
|
|
11
|
+
* @element ds-table-of-contents
|
|
12
|
+
* @fires toc-change - { href }: the section in view changed.
|
|
13
|
+
*/
|
|
14
|
+
export class TableOfContents extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
/** A cut label fades over its last square, never an ellipsis: marks it `data-cut="end"` while it does not fit. */
|
|
18
|
+
this.cuts = new CutFades(this, { selector: 'a', targets: () => this.querySelectorAll(':scope > a'), text: true });
|
|
19
|
+
this.links = [];
|
|
20
|
+
this.sections = [];
|
|
21
|
+
this.scroller = null;
|
|
22
|
+
this.frame = 0;
|
|
23
|
+
this.relabel = () => this.requestUpdate();
|
|
24
|
+
this.schedule = () => {
|
|
25
|
+
if (!this.isConnected)
|
|
26
|
+
return;
|
|
27
|
+
cancelAnimationFrame(this.frame);
|
|
28
|
+
this.frame = requestAnimationFrame(() => this.track());
|
|
29
|
+
};
|
|
30
|
+
this.follow = (event) => {
|
|
31
|
+
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey)
|
|
32
|
+
return;
|
|
33
|
+
const link = event.composedPath().find((node) => node instanceof HTMLAnchorElement);
|
|
34
|
+
if (!link || !this.links.includes(link) || link.target === '_blank' || link.hasAttribute('download'))
|
|
35
|
+
return;
|
|
36
|
+
const heading = this.destination(link);
|
|
37
|
+
if (!heading)
|
|
38
|
+
return;
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
heading.scrollIntoView({ block: 'start', behavior: 'auto' });
|
|
41
|
+
if (!heading.hasAttribute('tabindex'))
|
|
42
|
+
heading.setAttribute('tabindex', '-1');
|
|
43
|
+
heading.focus({ preventScroll: true });
|
|
44
|
+
history.pushState(history.state, '', link.href);
|
|
45
|
+
this.mark(link.getAttribute('href'));
|
|
46
|
+
};
|
|
47
|
+
this.items = [];
|
|
48
|
+
this.label = 'Contents';
|
|
49
|
+
this.literal = false;
|
|
50
|
+
this.current = '';
|
|
51
|
+
}
|
|
52
|
+
connectedCallback() {
|
|
53
|
+
super.connectedCallback();
|
|
54
|
+
this.addEventListener('click', this.follow);
|
|
55
|
+
window.addEventListener('scroll', this.schedule, { passive: true });
|
|
56
|
+
window.addEventListener('resize', this.schedule, { passive: true });
|
|
57
|
+
window.addEventListener('hashchange', this.schedule);
|
|
58
|
+
window.addEventListener('language-changed', this.relabel);
|
|
59
|
+
window.addEventListener('translations-loaded', this.relabel);
|
|
60
|
+
this.observer = new MutationObserver(() => this.refresh());
|
|
61
|
+
this.observer.observe(this, { subtree: true, childList: true, characterData: true, attributes: true, attributeFilter: ['href', 'data-depth'] });
|
|
62
|
+
if (typeof ResizeObserver !== 'undefined')
|
|
63
|
+
this.resize = new ResizeObserver(this.schedule);
|
|
64
|
+
void this.updateComplete.then(() => { if (this.isConnected)
|
|
65
|
+
this.refresh(); });
|
|
66
|
+
void this.ownerDocument.fonts?.ready.then(this.schedule);
|
|
67
|
+
}
|
|
68
|
+
disconnectedCallback() {
|
|
69
|
+
this.removeEventListener('click', this.follow);
|
|
70
|
+
window.removeEventListener('scroll', this.schedule);
|
|
71
|
+
this.scroller?.removeEventListener('scroll', this.schedule);
|
|
72
|
+
window.removeEventListener('resize', this.schedule);
|
|
73
|
+
window.removeEventListener('hashchange', this.schedule);
|
|
74
|
+
window.removeEventListener('language-changed', this.relabel);
|
|
75
|
+
window.removeEventListener('translations-loaded', this.relabel);
|
|
76
|
+
this.observer?.disconnect();
|
|
77
|
+
this.resize?.disconnect();
|
|
78
|
+
cancelAnimationFrame(this.frame);
|
|
79
|
+
super.disconnectedCallback();
|
|
80
|
+
}
|
|
81
|
+
updated(changed) {
|
|
82
|
+
if (changed.has('items') || changed.has('target'))
|
|
83
|
+
this.refresh();
|
|
84
|
+
}
|
|
85
|
+
destination(link) {
|
|
86
|
+
try {
|
|
87
|
+
const url = new URL(link.href, this.ownerDocument.baseURI);
|
|
88
|
+
const page = new URL(this.ownerDocument.URL);
|
|
89
|
+
if (!url.hash || url.origin !== page.origin || url.pathname !== page.pathname || url.search !== page.search)
|
|
90
|
+
return null;
|
|
91
|
+
const id = decodeURIComponent(url.hash.slice(1));
|
|
92
|
+
if (this.target)
|
|
93
|
+
return [...this.target.querySelectorAll('[id]')].find(node => node.id === id) ?? null;
|
|
94
|
+
const root = this.getRootNode();
|
|
95
|
+
return root.getElementById(id) ?? null;
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** Read links and targets again after replacing content or moving the Unit. */
|
|
102
|
+
refresh() {
|
|
103
|
+
if (!this.isConnected)
|
|
104
|
+
return;
|
|
105
|
+
this.links = this.items.length ? [...this.renderRoot.querySelectorAll('a')]
|
|
106
|
+
: [...this.querySelectorAll('a[href]')];
|
|
107
|
+
this.sections = this.links.flatMap(link => {
|
|
108
|
+
const heading = this.destination(link);
|
|
109
|
+
return heading ? [{ link, heading }] : [];
|
|
110
|
+
});
|
|
111
|
+
for (const link of this.links) {
|
|
112
|
+
const depth = Number(link.dataset.depth ?? 0);
|
|
113
|
+
link.style.setProperty('--toc-depth', String(Number.isFinite(depth) ? Math.max(0, depth) : 0));
|
|
114
|
+
}
|
|
115
|
+
this.scroller?.removeEventListener('scroll', this.schedule);
|
|
116
|
+
this.scroller = null;
|
|
117
|
+
const parentOf = (node) => node.parentElement ?? (node.getRootNode() instanceof ShadowRoot ? node.getRootNode().host : null);
|
|
118
|
+
for (let parent = this.sections[0] ? parentOf(this.sections[0].heading) : null; parent; parent = parentOf(parent)) {
|
|
119
|
+
if (/(auto|scroll)/.test(getComputedStyle(parent).overflowY)) {
|
|
120
|
+
this.scroller = parent;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
this.scroller?.addEventListener('scroll', this.schedule, { passive: true });
|
|
125
|
+
this.resize?.disconnect();
|
|
126
|
+
this.resize?.observe(this);
|
|
127
|
+
if (this.target)
|
|
128
|
+
this.resize?.observe(this.target);
|
|
129
|
+
if (this.scroller)
|
|
130
|
+
this.resize?.observe(this.scroller);
|
|
131
|
+
this.schedule();
|
|
132
|
+
}
|
|
133
|
+
track() {
|
|
134
|
+
for (const link of this.links) {
|
|
135
|
+
if (link.scrollWidth > link.clientWidth)
|
|
136
|
+
link.setAttribute('data-tooltip', link.textContent?.trim() ?? '');
|
|
137
|
+
else
|
|
138
|
+
link.removeAttribute('data-tooltip');
|
|
139
|
+
}
|
|
140
|
+
if (!this.sections.length) {
|
|
141
|
+
this.mark('');
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const box = this.scroller?.getBoundingClientRect();
|
|
145
|
+
const top = box?.top ?? 0;
|
|
146
|
+
const height = this.scroller?.clientHeight ?? window.innerHeight;
|
|
147
|
+
const scrollTop = this.scroller?.scrollTop ?? window.scrollY;
|
|
148
|
+
const scrollHeight = this.scroller?.scrollHeight ?? this.ownerDocument.documentElement.scrollHeight;
|
|
149
|
+
const end = scrollTop > 0 && scrollTop + height >= scrollHeight - 1;
|
|
150
|
+
// The rendered row resolves nested scale and calc() tokens to actual pixels.
|
|
151
|
+
const unit = this.renderRoot.querySelector('.title')?.getBoundingClientRect().height || 20;
|
|
152
|
+
const line = top + (end ? height : unit);
|
|
153
|
+
let current = this.sections[0].link.getAttribute('href');
|
|
154
|
+
for (const { link, heading } of this.sections) {
|
|
155
|
+
if (heading.getBoundingClientRect().top <= line)
|
|
156
|
+
current = link.getAttribute('href');
|
|
157
|
+
else
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
this.mark(current);
|
|
161
|
+
}
|
|
162
|
+
mark(href) {
|
|
163
|
+
for (const link of this.links) {
|
|
164
|
+
if (link.getAttribute('href') === href)
|
|
165
|
+
link.setAttribute('aria-current', 'location');
|
|
166
|
+
else
|
|
167
|
+
link.removeAttribute('aria-current');
|
|
168
|
+
}
|
|
169
|
+
if (this.current === href)
|
|
170
|
+
return;
|
|
171
|
+
this.current = href;
|
|
172
|
+
this.dispatchEvent(new CustomEvent('toc-change', { detail: { href }, bubbles: true, composed: true }));
|
|
173
|
+
}
|
|
174
|
+
render() {
|
|
175
|
+
const words = this.label || 'Contents';
|
|
176
|
+
const label = this.literal ? words : getText(words) || words;
|
|
177
|
+
return html `<nav aria-label=${label} part="navigation">
|
|
178
|
+
<div class="title"><ds-text literal strong role="heading" aria-level="2" part="title">${label}</ds-text></div>
|
|
179
|
+
<div class="links" part="links"><slot @slotchange=${() => this.refresh()}>
|
|
180
|
+
${this.items.map(item => html `<a href=${item.href} data-depth=${item.depth ?? 0} aria-current=${this.current === item.href ? 'location' : nothing} part="link">${item.label}</a>`)}
|
|
181
|
+
</slot></div>
|
|
182
|
+
</nav>`;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
TableOfContents.properties = {
|
|
186
|
+
items: { attribute: false }, label: { type: String }, literal: { type: Boolean },
|
|
187
|
+
target: { attribute: false }, current: { state: true },
|
|
188
|
+
};
|
|
189
|
+
TableOfContents.styles = unsafeCSS(styles);
|
|
190
|
+
define('ds-table-of-contents', TableOfContents);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-table.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-table.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ds-table.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-table.ts"],"names":[],"mappings":"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"}
|
package/dist/3-unit/ds-table.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { define } from "../0-face/define";
|
|
1
2
|
// ds-table.ts
|
|
2
3
|
// A data table: rows one square high on hairlines, drawn from data with the
|
|
3
4
|
// same rules as a native `<table class="ds-table">` (1-root/table.css). With
|
|
@@ -468,4 +469,4 @@ function text(value) {
|
|
|
468
469
|
return "";
|
|
469
470
|
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
470
471
|
}
|
|
471
|
-
|
|
472
|
+
define("ds-table", DsTable);
|
package/dist/3-unit/ds-tabs.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
2
|
/**
|
|
3
3
|
* A run of choices of which one is current: the panel's tabs, a subtab bar,
|
|
4
4
|
* a segmented option group. The choices are `ds-button`s; the current one is
|
|
5
5
|
* `active`.
|
|
6
6
|
*
|
|
7
|
+
* Four faces, always 4px apart where they stand apart: buttons (the
|
|
8
|
+
* default), each tab muted on no ground and the current one on the fill;
|
|
9
|
+
* `text`, the words alone; `split`, the tabs joined into one face as the
|
|
10
|
+
* split button draws it, the current one on the accent; and `paper`, a
|
|
11
|
+
* notebook's tabs hanging from a page's top edge, a row high, the current one
|
|
12
|
+
* on the paper's colour and joined to the page.
|
|
13
|
+
*
|
|
7
14
|
* The element is a `tablist` unless it says otherwise, and its buttons take the
|
|
8
15
|
* tab look. An option group that is not a set of tabs takes `role="group"`, its
|
|
9
16
|
* buttons `aria-pressed`, and they take DS one's button looks: grey, and the
|
|
@@ -11,6 +18,9 @@ import { LitElement } from "lit";
|
|
|
11
18
|
*
|
|
12
19
|
* @element ds-tabs
|
|
13
20
|
* @attr fill - Share the width equally between the choices.
|
|
21
|
+
* @attr text - Text tabs: the words alone, no fill, the current one in the ink.
|
|
22
|
+
* @attr split - Split tabs: joined into one face a control high, the current one on the accent.
|
|
23
|
+
* @attr paper - Paper tabs: a notebook's tabs a row high, rounded at the top, the current one on the paper and joined to the page.
|
|
14
24
|
*
|
|
15
25
|
* @example
|
|
16
26
|
* <ds-tabs role="group" fill>
|
|
@@ -33,13 +43,34 @@ export declare class Tabs extends LitElement {
|
|
|
33
43
|
type: BooleanConstructor;
|
|
34
44
|
reflect: boolean;
|
|
35
45
|
};
|
|
46
|
+
text: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
reflect: boolean;
|
|
49
|
+
};
|
|
50
|
+
split: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
reflect: boolean;
|
|
53
|
+
};
|
|
54
|
+
paper: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
reflect: boolean;
|
|
57
|
+
};
|
|
36
58
|
};
|
|
37
59
|
fill: boolean;
|
|
38
60
|
wrap: boolean;
|
|
61
|
+
text: boolean;
|
|
62
|
+
split: boolean;
|
|
63
|
+
paper: boolean;
|
|
39
64
|
constructor();
|
|
40
65
|
static styles: import("lit").CSSResult;
|
|
41
66
|
connectedCallback(): void;
|
|
42
67
|
private navigate;
|
|
68
|
+
/**
|
|
69
|
+
* Split, each tab knows its place in the run, so only the run's ends are
|
|
70
|
+
* rounded; paper, each tab wears the mark that gives it a notebook tab's face.
|
|
71
|
+
*/
|
|
72
|
+
private syncFaces;
|
|
73
|
+
protected updated(changed: PropertyValues): void;
|
|
43
74
|
render(): import("lit").TemplateResult<1>;
|
|
44
75
|
}
|
|
45
76
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-tabs.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ds-tabs.d.ts","sourceRoot":"","sources":["../../DS1/3-unit/ds-tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;MAMf;IAEM,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;;IAYvB,MAAM,CAAC,MAAM,0BAAqB;IAElC,iBAAiB,IAAI,IAAI;IAKzB,OAAO,CAAC,QAAQ,CAYd;IAEF;;;OAGG;IACH,OAAO,CAAC,SAAS,CASf;IAEF,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAIhD,MAAM;CAGP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
|
package/dist/3-unit/ds-tabs.js
CHANGED
|
@@ -6,6 +6,13 @@ import { define } from "../0-face/define";
|
|
|
6
6
|
* a segmented option group. The choices are `ds-button`s; the current one is
|
|
7
7
|
* `active`.
|
|
8
8
|
*
|
|
9
|
+
* Four faces, always 4px apart where they stand apart: buttons (the
|
|
10
|
+
* default), each tab muted on no ground and the current one on the fill;
|
|
11
|
+
* `text`, the words alone; `split`, the tabs joined into one face as the
|
|
12
|
+
* split button draws it, the current one on the accent; and `paper`, a
|
|
13
|
+
* notebook's tabs hanging from a page's top edge, a row high, the current one
|
|
14
|
+
* on the paper's colour and joined to the page.
|
|
15
|
+
*
|
|
9
16
|
* The element is a `tablist` unless it says otherwise, and its buttons take the
|
|
10
17
|
* tab look. An option group that is not a set of tabs takes `role="group"`, its
|
|
11
18
|
* buttons `aria-pressed`, and they take DS one's button looks: grey, and the
|
|
@@ -13,6 +20,9 @@ import { define } from "../0-face/define";
|
|
|
13
20
|
*
|
|
14
21
|
* @element ds-tabs
|
|
15
22
|
* @attr fill - Share the width equally between the choices.
|
|
23
|
+
* @attr text - Text tabs: the words alone, no fill, the current one in the ink.
|
|
24
|
+
* @attr split - Split tabs: joined into one face a control high, the current one on the accent.
|
|
25
|
+
* @attr paper - Paper tabs: a notebook's tabs a row high, rounded at the top, the current one on the paper and joined to the page.
|
|
16
26
|
*
|
|
17
27
|
* @example
|
|
18
28
|
* <ds-tabs role="group" fill>
|
|
@@ -43,8 +53,29 @@ export class Tabs extends LitElement {
|
|
|
43
53
|
tabs[next].focus();
|
|
44
54
|
tabs[next].click();
|
|
45
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Split, each tab knows its place in the run, so only the run's ends are
|
|
58
|
+
* rounded; paper, each tab wears the mark that gives it a notebook tab's face.
|
|
59
|
+
*/
|
|
60
|
+
this.syncFaces = () => {
|
|
61
|
+
const tabs = [...this.children].filter(child => child.localName === "ds-button");
|
|
62
|
+
tabs.forEach((tab, index) => {
|
|
63
|
+
const place = tabs.length === 1 ? "only" : index === 0 ? "first" : index === tabs.length - 1 ? "last" : "middle";
|
|
64
|
+
if (this.split)
|
|
65
|
+
tab.setAttribute("segment", place);
|
|
66
|
+
else if (/^(first|middle|last|only)$/.test(tab.getAttribute("segment") ?? ""))
|
|
67
|
+
tab.removeAttribute("segment");
|
|
68
|
+
if (this.paper)
|
|
69
|
+
tab.setAttribute("paper", "");
|
|
70
|
+
else
|
|
71
|
+
tab.removeAttribute("paper");
|
|
72
|
+
});
|
|
73
|
+
};
|
|
46
74
|
this.fill = false;
|
|
47
75
|
this.wrap = false;
|
|
76
|
+
this.text = false;
|
|
77
|
+
this.split = false;
|
|
78
|
+
this.paper = false;
|
|
48
79
|
this.addEventListener("keydown", this.navigate);
|
|
49
80
|
}
|
|
50
81
|
connectedCallback() {
|
|
@@ -52,13 +83,20 @@ export class Tabs extends LitElement {
|
|
|
52
83
|
if (!this.hasAttribute("role"))
|
|
53
84
|
this.setAttribute("role", "tablist");
|
|
54
85
|
}
|
|
86
|
+
updated(changed) {
|
|
87
|
+
if (changed.has("split") || changed.has("paper"))
|
|
88
|
+
this.syncFaces();
|
|
89
|
+
}
|
|
55
90
|
render() {
|
|
56
|
-
return html `<slot></slot>`;
|
|
91
|
+
return html `<slot @slotchange=${this.syncFaces}></slot>`;
|
|
57
92
|
}
|
|
58
93
|
}
|
|
59
94
|
Tabs.properties = {
|
|
60
95
|
fill: { type: Boolean, reflect: true },
|
|
61
96
|
wrap: { type: Boolean, reflect: true },
|
|
97
|
+
text: { type: Boolean, reflect: true },
|
|
98
|
+
split: { type: Boolean, reflect: true },
|
|
99
|
+
paper: { type: Boolean, reflect: true },
|
|
62
100
|
};
|
|
63
101
|
Tabs.styles = unsafeCSS(styles);
|
|
64
102
|
define("ds-tabs", Tabs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-container.d.ts","sourceRoot":"","sources":["../../DS1/4-page/ds-container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ds-container.d.ts","sourceRoot":"","sources":["../../DS1/4-page/ds-container.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAGlD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,UAAU,GAAG,IAAI,CAAC;KAC5D;IACD,IAAI,cAAc,EAAE,qBAAqB,CAAC;CAC3C;AAED,qBAAa,SAAU,SAAQ,UAAU;IACvC,MAAM,CAAC,MAAM,0BAAqB;IAElC,MAAM;CAGP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,SAAS,CAAC;KAC3B;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { define } from "../0-face/define";
|
|
1
2
|
// ds-container.ts
|
|
2
3
|
// Container component with responsive width constraints
|
|
3
4
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
@@ -8,4 +9,4 @@ export class Container extends LitElement {
|
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
Container.styles = unsafeCSS(styles);
|
|
11
|
-
|
|
12
|
+
define("ds-container", Container);
|