@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/DS1/2-core/ds-empty.ts
CHANGED
|
@@ -19,8 +19,8 @@ export const EMPTY_HEADING = "Nothing here yet";
|
|
|
19
19
|
* stand with `literal`. Unset, the shared words' "Nothing here yet".
|
|
20
20
|
* @prop {string} text - The line under it: a translation key, or literal words.
|
|
21
21
|
* @prop {boolean} literal - Show `heading` and `text` as written, never looked up.
|
|
22
|
-
* @prop {string} icon - An icon from the library
|
|
23
|
-
* @prop {boolean} centered - Centre the words in the space the element stands in.
|
|
22
|
+
* @prop {string} icon - An icon from the library inline before the title.
|
|
23
|
+
* @prop {boolean} centered - Centre the words in the space the element stands in (the default).
|
|
24
24
|
* @prop {number} level - Make the title a heading of this level (1–6).
|
|
25
25
|
* @prop {string} tone - `done`: empty because everything is finished; the
|
|
26
26
|
* check (or `icon`) on a mark in the success green, the title in that green.
|
|
@@ -61,7 +61,7 @@ export class Empty extends LitElement {
|
|
|
61
61
|
constructor() {
|
|
62
62
|
super();
|
|
63
63
|
this.literal = false;
|
|
64
|
-
this.centered =
|
|
64
|
+
this.centered = true;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
connectedCallback() {
|
|
@@ -104,13 +104,15 @@ export class Empty extends LitElement {
|
|
|
104
104
|
const hasActions = this.slotted("actions");
|
|
105
105
|
const level = this.level && this.level >= 1 && this.level <= 6 ? Math.round(this.level) : undefined;
|
|
106
106
|
const changed = () => this.requestUpdate();
|
|
107
|
-
return html`<div class="ds-empty${this.centered ? " ds-empty--centered" : ""}${done ? " ds-empty--done" : ""}" part="empty">
|
|
107
|
+
return html`<div class="ds-empty${this.centered ? " ds-empty--centered" : " ds-empty--start"}${done ? " ds-empty--done" : ""}" part="empty">
|
|
108
|
+
<div class="ds-empty__heading" part="heading">
|
|
108
109
|
<div class="ds-empty__icon" part="icon" aria-hidden="true" ?hidden=${!hasIcon}>
|
|
109
110
|
<slot name="icon" @slotchange=${changed}>${icon ? html`<ds-icon size=${done ? "small" : "large"} .type=${icon}></ds-icon>` : nothing}</slot>
|
|
110
111
|
</div>
|
|
111
112
|
<div class="ds-empty__title" part="title" role=${level ? "heading" : nothing} aria-level=${level ?? nothing}>
|
|
112
113
|
<slot name="heading" @slotchange=${changed}>${heading}</slot>
|
|
113
114
|
</div>
|
|
115
|
+
</div>
|
|
114
116
|
<div class="ds-empty__text" part="text" ?hidden=${!hasText}><slot @slotchange=${changed}></slot>${slottedText ? nothing : text}</div>
|
|
115
117
|
<div class="ds-empty__actions" part="actions" ?hidden=${!hasActions}><slot name="actions" @slotchange=${changed}></slot></div>
|
|
116
118
|
</div>`;
|
package/DS1/2-core/ds-input.ts
CHANGED
|
@@ -12,6 +12,14 @@ import { getText, currentLanguage } from "../0-face/i18n";
|
|
|
12
12
|
import "./ds-text";
|
|
13
13
|
import styles from "./styles/ds-input.css?inline";
|
|
14
14
|
|
|
15
|
+
/** The autofill a field's type implies when it names none of its own. */
|
|
16
|
+
const TYPE_AUTOCOMPLETE: Partial<Record<string, string>> = {
|
|
17
|
+
email: "email",
|
|
18
|
+
tel: "tel",
|
|
19
|
+
url: "url",
|
|
20
|
+
password: "current-password",
|
|
21
|
+
};
|
|
22
|
+
|
|
15
23
|
export class Input extends LitElement {
|
|
16
24
|
static formAssociated = true;
|
|
17
25
|
private readonly focusFromLabel = (event: MouseEvent) => {
|
|
@@ -163,7 +171,7 @@ export class Input extends LitElement {
|
|
|
163
171
|
this.readonly = false;
|
|
164
172
|
this.required = false;
|
|
165
173
|
this.autofocus = false;
|
|
166
|
-
this.autocomplete = "
|
|
174
|
+
this.autocomplete = "";
|
|
167
175
|
this.pattern = "";
|
|
168
176
|
this.minlength = 0;
|
|
169
177
|
this.maxlength = -1;
|
|
@@ -353,6 +361,18 @@ export class Input extends LitElement {
|
|
|
353
361
|
}
|
|
354
362
|
}
|
|
355
363
|
|
|
364
|
+
/**
|
|
365
|
+
* What the browser may fill in. Without `autocomplete` an email, phone,
|
|
366
|
+
* web address or password field says what it holds (a sign-up's password
|
|
367
|
+
* sets "new-password"), and any other field is left to the browser, as a
|
|
368
|
+
* native input is; "off" still turns it off.
|
|
369
|
+
*/
|
|
370
|
+
protected resolvedAutocomplete(): string | undefined {
|
|
371
|
+
if (this.autocomplete) return this.autocomplete;
|
|
372
|
+
if (this.multiline) return undefined;
|
|
373
|
+
return TYPE_AUTOCOMPLETE[this.type];
|
|
374
|
+
}
|
|
375
|
+
|
|
356
376
|
protected accessibleLabel(): string | undefined {
|
|
357
377
|
if (this.ariaLabel) return this.ariaLabel;
|
|
358
378
|
const root = this.getRootNode() as Document | ShadowRoot;
|
|
@@ -552,7 +572,7 @@ export class Input extends LitElement {
|
|
|
552
572
|
?readonly=${this.readonly}
|
|
553
573
|
?required=${this.required}
|
|
554
574
|
?autofocus=${this.autofocus}
|
|
555
|
-
autocomplete=${this.
|
|
575
|
+
autocomplete=${ifDefined(this.resolvedAutocomplete())}
|
|
556
576
|
minlength=${ifDefined(this.minlength || undefined)}
|
|
557
577
|
maxlength=${ifDefined(this.maxlength >= 0 ? this.maxlength : undefined)}
|
|
558
578
|
rows=${rows}
|
|
@@ -587,7 +607,7 @@ export class Input extends LitElement {
|
|
|
587
607
|
?readonly=${this.readonly}
|
|
588
608
|
?required=${this.required}
|
|
589
609
|
?autofocus=${this.autofocus}
|
|
590
|
-
autocomplete=${this.
|
|
610
|
+
autocomplete=${ifDefined(this.resolvedAutocomplete())}
|
|
591
611
|
pattern=${ifDefined(this.pattern || undefined)}
|
|
592
612
|
minlength=${ifDefined(this.minlength || undefined)}
|
|
593
613
|
maxlength=${ifDefined(this.maxlength >= 0 ? this.maxlength : undefined)}
|
package/DS1/2-core/ds-message.ts
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
// page leading to the site's iPhone app (0-face/app-banner.ts decides where).
|
|
6
6
|
// Drawn by 1-root/notice.css, the same classes a page without scripts writes.
|
|
7
7
|
|
|
8
|
+
import { reportFailure, type Failure } from "../0-face/failures";
|
|
8
9
|
import { LitElement, html, nothing, unsafeCSS, type PropertyValues } from "lit";
|
|
9
10
|
import { getText } from "../0-face/i18n";
|
|
10
11
|
import { define } from "../0-face/define";
|
|
12
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
11
13
|
import "./ds-icon";
|
|
12
14
|
import "./ds-toast";
|
|
13
15
|
import type { ToastPosition } from "../0-face/toast-queue";
|
|
@@ -77,6 +79,7 @@ export interface MessageDismissDetail { tone: MessageTone }
|
|
|
77
79
|
*/
|
|
78
80
|
export class Message extends LitElement {
|
|
79
81
|
static properties = {
|
|
82
|
+
failure: { attribute: false },
|
|
80
83
|
expand: { type: Boolean },
|
|
81
84
|
visibleToasts: { type: Number, attribute: "visible-toasts" },
|
|
82
85
|
richColors: { type: Boolean, attribute: "rich-colors" },
|
|
@@ -103,6 +106,12 @@ export class Message extends LitElement {
|
|
|
103
106
|
};
|
|
104
107
|
|
|
105
108
|
static styles = [unsafeCSS(metrics), unsafeCSS(controls), unsafeCSS(styles)];
|
|
109
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
110
|
+
protected readonly cuts = new CutFades(this, { selector: ".ds-notice__title, .ds-notice__text" });
|
|
111
|
+
|
|
112
|
+
/** Authored diagnostic for a real failure; never derived from slotted user content. */
|
|
113
|
+
declare failure: Failure | undefined;
|
|
114
|
+
private reportedFailure = "";
|
|
106
115
|
|
|
107
116
|
declare expand: boolean;
|
|
108
117
|
declare visibleToasts: number;
|
|
@@ -180,6 +189,19 @@ export class Message extends LitElement {
|
|
|
180
189
|
else if (changed.get("form") === "app") this.hidden = false;
|
|
181
190
|
}
|
|
182
191
|
|
|
192
|
+
protected updated(changed: PropertyValues<this>) {
|
|
193
|
+
super.updated(changed);
|
|
194
|
+
if (!this.failure || this.hidden || this.form === "toast" || this.form === "app") {
|
|
195
|
+
this.reportedFailure = "";
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const key = JSON.stringify(this.failure);
|
|
199
|
+
if (key !== this.reportedFailure) {
|
|
200
|
+
this.reportedFailure = key;
|
|
201
|
+
reportFailure(this.failure);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
183
205
|
private get app(): AppBannerOptions {
|
|
184
206
|
return { appId: this.appId, appUrl: this.appUrl, open: this.open, key: this.remember };
|
|
185
207
|
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
// ds-number.ts
|
|
2
|
+
// Number field: a value one control high, scrubbed by its lead, stepped by the arrows, typed as arithmetic.
|
|
3
|
+
|
|
4
|
+
import { LitElement, html, nothing, unsafeCSS, type PropertyDeclarations, type PropertyValues } from "lit";
|
|
5
|
+
import { live } from "lit/directives/live.js";
|
|
6
|
+
import { define } from "../0-face/define";
|
|
7
|
+
import { formatNumberValue, readNumberExpression, stepPlaces } from "./number-expression";
|
|
8
|
+
import "./ds-icon";
|
|
9
|
+
import styles from "./styles/ds-number.css?inline";
|
|
10
|
+
|
|
11
|
+
/** How far the pointer moves before a press becomes a drag. */
|
|
12
|
+
const DRAG_THRESHOLD = 3;
|
|
13
|
+
/** With `drag="value"`, the pixels of upward travel a step takes, as a music program's tempo drags. */
|
|
14
|
+
const VALUE_PIXELS = 3;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A number a person sets by hand, in the inspector's way: the value on the field's fill, one control
|
|
18
|
+
* high on the sixteen and a whole number of squares wide (`width`, four by default). Its lead, a short
|
|
19
|
+
* `label` or an `icon` in the title grey, is the handle: dragging it sideways scrubs the value a `step`
|
|
20
|
+
* a pixel (Shift: `big-step`), and a double-click puts back `default`. The arrows step it, Shift by the
|
|
21
|
+
* big step. What is typed is read as arithmetic (`10 + 5`, `(3 − 1) × 4`), and an operator first works
|
|
22
|
+
* on the value already there (`*2`, `/2`, `+10`); Enter takes it, Escape puts the value back.
|
|
23
|
+
*
|
|
24
|
+
* `input` fires as a drag moves the value and `change` when a value is taken (the drag's end, Enter,
|
|
25
|
+
* leaving the field, an arrow). `value` is a number; the field takes part in its form under `name`.
|
|
26
|
+
*
|
|
27
|
+
* `drag="value"` makes the whole field the handle, as a music program's tempo is: press the value and
|
|
28
|
+
* drag up to raise it, a step every three pixels (Shift: the big step); a press without a drag types.
|
|
29
|
+
*/
|
|
30
|
+
export class NumberField extends LitElement {
|
|
31
|
+
static formAssociated = true;
|
|
32
|
+
static styles = unsafeCSS(styles);
|
|
33
|
+
static properties: PropertyDeclarations = {
|
|
34
|
+
value: { type: Number },
|
|
35
|
+
min: { type: Number },
|
|
36
|
+
max: { type: Number },
|
|
37
|
+
step: { type: Number },
|
|
38
|
+
bigStep: { type: Number, attribute: "big-step" },
|
|
39
|
+
places: { type: Number },
|
|
40
|
+
defaultValue: { type: Number, attribute: "default" },
|
|
41
|
+
label: { type: String },
|
|
42
|
+
icon: { type: String },
|
|
43
|
+
unit: { type: String },
|
|
44
|
+
width: { type: Number, reflect: true },
|
|
45
|
+
dragMode: { type: String, attribute: "drag", reflect: true },
|
|
46
|
+
name: { type: String, reflect: true },
|
|
47
|
+
disabled: { type: Boolean, reflect: true },
|
|
48
|
+
readonly: { type: Boolean, reflect: true },
|
|
49
|
+
ariaLabel: { type: String, attribute: "aria-label" },
|
|
50
|
+
_text: { state: true },
|
|
51
|
+
_editing: { state: true },
|
|
52
|
+
_scrubbing: { state: true },
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare value: number;
|
|
56
|
+
declare min: number | undefined;
|
|
57
|
+
declare max: number | undefined;
|
|
58
|
+
declare step: number;
|
|
59
|
+
declare bigStep: number | undefined;
|
|
60
|
+
declare places: number | undefined;
|
|
61
|
+
declare defaultValue: number | undefined;
|
|
62
|
+
declare label: string;
|
|
63
|
+
declare icon: string;
|
|
64
|
+
declare unit: string;
|
|
65
|
+
declare width: number;
|
|
66
|
+
declare dragMode: "lead" | "value";
|
|
67
|
+
declare name: string;
|
|
68
|
+
declare disabled: boolean;
|
|
69
|
+
declare readonly: boolean;
|
|
70
|
+
declare ariaLabel: string | null;
|
|
71
|
+
declare _text: string;
|
|
72
|
+
declare _editing: boolean;
|
|
73
|
+
declare _scrubbing: boolean;
|
|
74
|
+
|
|
75
|
+
private internals = typeof this.attachInternals === "function" ? this.attachInternals() : null;
|
|
76
|
+
private drag: { id: number; at: number; from: number; moved: boolean; rest: number; vertical: boolean } | null = null;
|
|
77
|
+
|
|
78
|
+
constructor() {
|
|
79
|
+
super();
|
|
80
|
+
this.value = 0;
|
|
81
|
+
this.step = 1;
|
|
82
|
+
this.label = "";
|
|
83
|
+
this.icon = "";
|
|
84
|
+
this.unit = "";
|
|
85
|
+
this.width = 4;
|
|
86
|
+
this.dragMode = "lead";
|
|
87
|
+
this.name = "";
|
|
88
|
+
this.disabled = false;
|
|
89
|
+
this.readonly = false;
|
|
90
|
+
this._text = "";
|
|
91
|
+
this._editing = false;
|
|
92
|
+
this._scrubbing = false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The decimals the field keeps: `places`, or as many as `step` has. */
|
|
96
|
+
get decimals(): number {
|
|
97
|
+
return this.places ?? stepPlaces(this.step || 1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
focus(options?: FocusOptions) {
|
|
101
|
+
this.input?.focus(options);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
private get input(): HTMLInputElement | null {
|
|
105
|
+
return this.renderRoot.querySelector("input");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private get locked(): boolean {
|
|
109
|
+
return this.disabled || this.readonly;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Kept inside min and max, at the field's decimals. */
|
|
113
|
+
private clamp(value: number): number {
|
|
114
|
+
let next = value;
|
|
115
|
+
if (this.min !== undefined && next < this.min) next = this.min;
|
|
116
|
+
if (this.max !== undefined && next > this.max) next = this.max;
|
|
117
|
+
const factor = 10 ** this.decimals;
|
|
118
|
+
return Math.round(next * factor) / factor;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Steps from a value, exactly: 1.03 a step of 0.05 up is 1.08, as typed values keep their own figures. */
|
|
122
|
+
private stepped(from: number, steps: number, size: number): number {
|
|
123
|
+
return this.clamp(from + steps * (size || 1));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private emit(type: "input" | "change") {
|
|
127
|
+
this.dispatchEvent(new Event(type, { bubbles: true, composed: true }));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Sets the value as a person did: `input` while it is still moving, `change` once it is taken. */
|
|
131
|
+
private set(value: number, type: "input" | "change") {
|
|
132
|
+
const next = this.clamp(value);
|
|
133
|
+
if (next === this.value) return;
|
|
134
|
+
this.value = next;
|
|
135
|
+
this.emit(type);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private commitText() {
|
|
139
|
+
const read = readNumberExpression(this._text, this.value);
|
|
140
|
+
this._editing = false;
|
|
141
|
+
if (read === null) return this.requestUpdate();
|
|
142
|
+
const before = this.value;
|
|
143
|
+
this.value = this.clamp(read);
|
|
144
|
+
if (this.value !== before) this.emit("change");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
private onFocus = () => {
|
|
148
|
+
this._editing = true;
|
|
149
|
+
this._text = this.written;
|
|
150
|
+
void this.updateComplete.then(() => this.input?.select());
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
private onBlur = () => {
|
|
154
|
+
if (this._editing) this.commitText();
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
private onKeydown = (event: KeyboardEvent) => {
|
|
158
|
+
if (this.locked) return;
|
|
159
|
+
if (event.key === "Enter") {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
this.commitText();
|
|
162
|
+
this._editing = true;
|
|
163
|
+
this._text = this.written;
|
|
164
|
+
void this.updateComplete.then(() => this.input?.select());
|
|
165
|
+
} else if (event.key === "Escape") {
|
|
166
|
+
event.preventDefault();
|
|
167
|
+
this._editing = false;
|
|
168
|
+
this.input?.blur();
|
|
169
|
+
} else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
const from = readNumberExpression(this._text, this.value) ?? this.value;
|
|
172
|
+
const size = event.shiftKey ? (this.bigStep ?? this.step * 10) : this.step;
|
|
173
|
+
this.set(this.stepped(from, event.key === "ArrowUp" ? 1 : -1, size), "change");
|
|
174
|
+
this._text = this.written;
|
|
175
|
+
void this.updateComplete.then(() => this.input?.select());
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
private onText = (event: Event) => {
|
|
180
|
+
event.stopPropagation();
|
|
181
|
+
this._text = (event.target as HTMLInputElement).value;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/** Sideways from the lead, a step a pixel; up from the value (`drag="value"`), a step every three. */
|
|
185
|
+
private onLeadDown = (event: PointerEvent) => {
|
|
186
|
+
if (this.locked || event.button !== 0 || this.drag) return;
|
|
187
|
+
const vertical = this.dragMode === "value";
|
|
188
|
+
// With the value as the handle, a press on a field already being typed in places the caret.
|
|
189
|
+
if (vertical && this._editing) return;
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
event.stopPropagation();
|
|
192
|
+
(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
|
|
193
|
+
if (this._editing) this.commitText();
|
|
194
|
+
this.drag = { id: event.pointerId, at: vertical ? -event.clientY : event.clientX, from: this.value, moved: false, rest: 0, vertical };
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
private onLeadMove = (event: PointerEvent) => {
|
|
198
|
+
const drag = this.drag;
|
|
199
|
+
if (!drag || drag.id !== event.pointerId) return;
|
|
200
|
+
const at = drag.vertical ? -event.clientY : event.clientX;
|
|
201
|
+
if (!drag.moved && Math.abs(at - drag.at) < DRAG_THRESHOLD) return;
|
|
202
|
+
if (!drag.moved) {
|
|
203
|
+
drag.moved = true;
|
|
204
|
+
this._scrubbing = true;
|
|
205
|
+
}
|
|
206
|
+
const size = event.shiftKey ? (this.bigStep ?? this.step * 10) : this.step;
|
|
207
|
+
const travel = (at - drag.at) / (drag.vertical ? VALUE_PIXELS : 1) + drag.rest;
|
|
208
|
+
const steps = Math.trunc(travel);
|
|
209
|
+
drag.rest = travel - steps;
|
|
210
|
+
drag.at = at;
|
|
211
|
+
if (steps) this.set(this.stepped(this.value, steps, size), "input");
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
private onLeadUp = (event: PointerEvent) => {
|
|
215
|
+
const drag = this.drag;
|
|
216
|
+
if (!drag || drag.id !== event.pointerId) return;
|
|
217
|
+
this.drag = null;
|
|
218
|
+
this._scrubbing = false;
|
|
219
|
+
if (drag.moved && this.value !== drag.from) this.emit("change");
|
|
220
|
+
else if (!drag.moved) this.focus();
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
private onLeadCancel = (event: PointerEvent) => {
|
|
224
|
+
const drag = this.drag;
|
|
225
|
+
if (!drag || drag.id !== event.pointerId) return;
|
|
226
|
+
this.drag = null;
|
|
227
|
+
this._scrubbing = false;
|
|
228
|
+
if (this.value !== drag.from) this.set(drag.from, "input");
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
private onLeadDouble = () => {
|
|
232
|
+
if (this.locked || this.defaultValue === undefined) return;
|
|
233
|
+
// A double-click on the value began as a press that started typing: leave the typing first.
|
|
234
|
+
if (this._editing) { this._editing = false; this.input?.blur(); }
|
|
235
|
+
if (this.value !== this.clamp(this.defaultValue)) this.set(this.defaultValue, "change");
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/** Escape during a drag puts the value back where the drag began. */
|
|
239
|
+
private onWindowKey = (event: KeyboardEvent) => {
|
|
240
|
+
if (event.key !== "Escape" || !this.drag) return;
|
|
241
|
+
const from = this.drag.from;
|
|
242
|
+
this.drag = null;
|
|
243
|
+
this._scrubbing = false;
|
|
244
|
+
if (this.value !== from) this.set(from, "input");
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
connectedCallback() {
|
|
248
|
+
super.connectedCallback();
|
|
249
|
+
window.addEventListener("keydown", this.onWindowKey);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
disconnectedCallback() {
|
|
253
|
+
window.removeEventListener("keydown", this.onWindowKey);
|
|
254
|
+
super.disconnectedCallback();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** The value as the field writes it. */
|
|
258
|
+
get written(): string {
|
|
259
|
+
return formatNumberValue(Number.isFinite(this.value) ? this.value : 0, this.decimals);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
protected willUpdate(changed: PropertyValues<this>) {
|
|
263
|
+
if (changed.has("value") && typeof this.value === "string") this.value = Number(this.value);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
protected updated(changed: PropertyValues<this>) {
|
|
267
|
+
if (changed.has("width")) this.style.setProperty("--ds-number-squares", String(Math.max(1, Math.round(this.width || 4))));
|
|
268
|
+
if (changed.has("value") || changed.has("disabled")) this.internals?.setFormValue(this.disabled ? null : String(this.value));
|
|
269
|
+
this.validate();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** A value outside `min` or `max` (one never set by hand, such as a starting 0 above a min) keeps its form from being sent. */
|
|
273
|
+
private validate() {
|
|
274
|
+
if (!this.internals?.setValidity) return;
|
|
275
|
+
const low = this.min !== undefined && this.value < this.min;
|
|
276
|
+
const high = this.max !== undefined && this.value > this.max;
|
|
277
|
+
const message = low ? `At least ${formatNumberValue(this.min!, this.decimals)}` : high ? `At most ${formatNumberValue(this.max!, this.decimals)}` : "";
|
|
278
|
+
if (low || high) this.internals.setValidity({ rangeUnderflow: low, rangeOverflow: high }, message, this.input ?? undefined);
|
|
279
|
+
else this.internals.setValidity({});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
checkValidity() {
|
|
283
|
+
return this.internals?.checkValidity() ?? true;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
reportValidity() {
|
|
287
|
+
return this.internals?.reportValidity() ?? true;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
formResetCallback() {
|
|
291
|
+
const initial = Number(this.getAttribute("value") ?? 0);
|
|
292
|
+
this.value = Number.isFinite(initial) ? initial : 0;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
render() {
|
|
296
|
+
const lead = this.icon
|
|
297
|
+
? html`<ds-icon type=${this.icon} size="large"></ds-icon>`
|
|
298
|
+
: this.label ? html`<span class="lead__words">${this.label}</span>` : nothing;
|
|
299
|
+
const valueText = this.unit ? `${this.written} ${this.unit}` : this.written;
|
|
300
|
+
const handle = this.dragMode === "value";
|
|
301
|
+
return html`<span
|
|
302
|
+
class=${this._scrubbing ? "face scrubbing" : "face"}
|
|
303
|
+
part="face"
|
|
304
|
+
@pointerdown=${handle ? this.onLeadDown : nothing}
|
|
305
|
+
@pointermove=${handle ? this.onLeadMove : nothing}
|
|
306
|
+
@pointerup=${handle ? this.onLeadUp : nothing}
|
|
307
|
+
@pointercancel=${handle ? this.onLeadCancel : nothing}
|
|
308
|
+
@lostpointercapture=${handle ? this.onLeadCancel : nothing}
|
|
309
|
+
@dblclick=${handle ? this.onLeadDouble : nothing}
|
|
310
|
+
>
|
|
311
|
+
${lead === nothing ? nothing : html`<span
|
|
312
|
+
class="lead"
|
|
313
|
+
part="lead"
|
|
314
|
+
aria-hidden="true"
|
|
315
|
+
@pointerdown=${handle ? nothing : this.onLeadDown}
|
|
316
|
+
@pointermove=${handle ? nothing : this.onLeadMove}
|
|
317
|
+
@pointerup=${handle ? nothing : this.onLeadUp}
|
|
318
|
+
@pointercancel=${handle ? nothing : this.onLeadCancel}
|
|
319
|
+
@lostpointercapture=${handle ? nothing : this.onLeadCancel}
|
|
320
|
+
@dblclick=${handle ? nothing : this.onLeadDouble}
|
|
321
|
+
>${lead}</span>`}
|
|
322
|
+
<input
|
|
323
|
+
part="input"
|
|
324
|
+
type="text"
|
|
325
|
+
inputmode="decimal"
|
|
326
|
+
autocomplete="off"
|
|
327
|
+
spellcheck="false"
|
|
328
|
+
role="spinbutton"
|
|
329
|
+
aria-label=${this.ariaLabel || this.label || nothing}
|
|
330
|
+
aria-valuenow=${this.value}
|
|
331
|
+
aria-valuemin=${this.min ?? nothing}
|
|
332
|
+
aria-valuemax=${this.max ?? nothing}
|
|
333
|
+
aria-valuetext=${valueText}
|
|
334
|
+
.value=${live(this._editing ? this._text : this.written)}
|
|
335
|
+
?disabled=${this.disabled}
|
|
336
|
+
?readonly=${this.readonly}
|
|
337
|
+
@focus=${this.onFocus}
|
|
338
|
+
@blur=${this.onBlur}
|
|
339
|
+
@keydown=${this.onKeydown}
|
|
340
|
+
@input=${this.onText}
|
|
341
|
+
@change=${(event: Event) => event.stopPropagation()}
|
|
342
|
+
/>
|
|
343
|
+
${this.unit ? html`<span class="unit" part="unit" aria-hidden="true">${this.unit}</span>` : nothing}
|
|
344
|
+
</span>`;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
define("ds-number", NumberField);
|
|
349
|
+
declare global { interface HTMLElementTagNameMap { "ds-number": NumberField } }
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { LitElement, html, nothing, unsafeCSS, type PropertyValues } from "lit";
|
|
11
11
|
import { getText } from "../0-face/i18n";
|
|
12
12
|
import { define } from "../0-face/define";
|
|
13
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
13
14
|
import { formatNumber } from "../0-face/format";
|
|
14
15
|
import { dotForKey, dotState } from "../0-face/carousel";
|
|
15
16
|
import { figureFormat, meterAria, type FigureFormat, type MeterAria } from "./figures";
|
|
@@ -124,6 +125,8 @@ export class Progress extends LitElement {
|
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
static styles = [unsafeCSS(metrics), unsafeCSS(progress), unsafeCSS(styles)];
|
|
128
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
129
|
+
protected readonly cuts = new CutFades(this, { selector: ".ds-progress__label" });
|
|
127
130
|
|
|
128
131
|
declare value: number;
|
|
129
132
|
declare min: number;
|
package/DS1/2-core/ds-radio.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
3
4
|
import styles from "./styles/ds-radio.css?inline";
|
|
4
5
|
|
|
5
6
|
/** Native radios keep their group, keyboard, labels and form. DS1 owns the face. */
|
|
@@ -11,6 +12,8 @@ export class Radio extends LitElement {
|
|
|
11
12
|
label: { type: String },
|
|
12
13
|
};
|
|
13
14
|
static styles = unsafeCSS(styles);
|
|
15
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
16
|
+
protected readonly cuts = new CutFades(this, { selector: ".label" });
|
|
14
17
|
declare choice: boolean;
|
|
15
18
|
declare compact: boolean;
|
|
16
19
|
declare preview: boolean;
|
package/DS1/2-core/ds-stat.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
7
7
|
import { getText } from "../0-face/i18n";
|
|
8
8
|
import { define } from "../0-face/define";
|
|
9
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
9
10
|
import { figureCells, figureFormat, formatFigure, type FigureFormat, type FigureOptions } from "./figures";
|
|
10
11
|
import "./ds-icon";
|
|
11
12
|
import metrics from "../1-root/component-metrics.css?inline";
|
|
@@ -63,6 +64,8 @@ export class Stat extends LitElement {
|
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
static styles = [unsafeCSS(metrics), unsafeCSS(figures), unsafeCSS(styles)];
|
|
67
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
68
|
+
protected readonly cuts = new CutFades(this, { selector: ".ds-stat__figure" });
|
|
66
69
|
|
|
67
70
|
declare label: string | undefined;
|
|
68
71
|
declare value: number | undefined;
|
package/DS1/2-core/ds-switch.ts
CHANGED
|
@@ -3,8 +3,12 @@ import { define } from "../0-face/define";
|
|
|
3
3
|
import styles from "./styles/ds-switch.css?inline";
|
|
4
4
|
|
|
5
5
|
/** The switch: a pill with a white round thumb, grey when off and the darker green when on,
|
|
6
|
-
whatever the page's accent. The slotted button retains native activation and refs. */
|
|
6
|
+
whatever the page's accent. Compact and monochrome are opt-in control-panel variants. The slotted button retains native activation and refs. */
|
|
7
7
|
export class Switch extends LitElement {
|
|
8
|
+
static properties = { compact: { type: Boolean, reflect: true }, monochrome: { type: Boolean, reflect: true } };
|
|
9
|
+
declare compact: boolean;
|
|
10
|
+
declare monochrome: boolean;
|
|
11
|
+
constructor() { super(); this.compact = false; this.monochrome = false; }
|
|
8
12
|
static styles = unsafeCSS(styles);
|
|
9
13
|
focus(options?: FocusOptions) { this.querySelector<HTMLButtonElement>(":scope > button")?.focus(options); }
|
|
10
14
|
render() { return html`<slot></slot>`; }
|
package/DS1/2-core/ds-tag.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
3
4
|
import styles from "./styles/ds-tag.css?inline";
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* A noninteractive label whose width follows its words, without grid rounding.
|
|
8
|
+
* Words that do not fit fade out over their last square, never an ellipsis,
|
|
9
|
+
* while the fill stays whole.
|
|
10
|
+
*/
|
|
6
11
|
export class Tag extends LitElement {
|
|
7
12
|
static styles = unsafeCSS(styles);
|
|
8
|
-
|
|
13
|
+
/** Marks the words `data-cut="end"` while they are wider than the tag. */
|
|
14
|
+
protected readonly cuts = new CutFades(this, { selector: ".words", text: true });
|
|
15
|
+
render() { return html`<span class="frame" part="frame"><span class="words"><slot @slotchange=${() => this.cuts.measure()}></slot></span></span>`; }
|
|
9
16
|
}
|
|
10
17
|
define("ds-tag", Tag);
|
|
11
18
|
declare global { interface HTMLElementTagNameMap { "ds-tag": Tag } }
|
package/DS1/2-core/ds-text.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { getText, currentLanguage } from "../0-face/i18n";
|
|
3
3
|
import { define } from "../0-face/define";
|
|
4
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
4
5
|
import styles from "./styles/ds-text.css?inline";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -18,6 +19,10 @@ import styles from "./styles/ds-text.css?inline";
|
|
|
18
19
|
* @prop {boolean} strong - The medium weight
|
|
19
20
|
* @prop {boolean} wrap - Let the text run over several lines, each one square
|
|
20
21
|
*
|
|
22
|
+
* Literal text that does not fit its width is cut and fades out over its last
|
|
23
|
+
* square, never an ellipsis: the element marks itself `data-cut="end"` while
|
|
24
|
+
* its words are wider than its box, and takes the mark off when they fit.
|
|
25
|
+
*
|
|
21
26
|
* The four work alike for a translation key and for literal text. For a
|
|
22
27
|
* heading, give the element `role="heading"` and `aria-level`.
|
|
23
28
|
*
|
|
@@ -56,6 +61,8 @@ export class Text extends LitElement {
|
|
|
56
61
|
declare _text: string;
|
|
57
62
|
declare _currentLanguage: string;
|
|
58
63
|
private _slotKey: string = "";
|
|
64
|
+
/** Marks the element cut while its literal words are wider than its box. */
|
|
65
|
+
protected readonly cuts = new CutFades(this, { targets: () => (this.literal && !this.wrap ? [this] : []), text: true });
|
|
59
66
|
private boundHandlers: { languageChanged: EventListener };
|
|
60
67
|
|
|
61
68
|
constructor() {
|
package/DS1/2-core/ds-token.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { define } from "../0-face/define";
|
|
3
|
+
import { CutFades } from "../0-face/cut-fade";
|
|
3
4
|
import "./ds-button";
|
|
4
5
|
import "./ds-icon";
|
|
5
6
|
import styles from "./styles/ds-token.css?inline";
|
|
@@ -13,6 +14,8 @@ export class Token extends LitElement {
|
|
|
13
14
|
disabled: { type: Boolean, reflect: true }, fieldDisabled: { state: true },
|
|
14
15
|
};
|
|
15
16
|
static styles = unsafeCSS(styles);
|
|
17
|
+
/** Words cut short fade over their last square, never an ellipsis: marks them `data-cut="end"` while they do not fit. */
|
|
18
|
+
protected readonly cuts = new CutFades(this, { selector: ".copy > span, small" });
|
|
16
19
|
declare value: string; declare label: string; declare detail: string;
|
|
17
20
|
declare removeLabel: string; declare disabled: boolean; declare fieldDisabled: boolean;
|
|
18
21
|
private fieldsetDisabled = false;
|