tempest-react-sdk 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppBar/use-sticky-body-warning.cjs +1 -1
- package/dist/components/AppBar/use-sticky-body-warning.cjs.map +1 -1
- package/dist/components/AppBar/use-sticky-body-warning.js +5 -8
- package/dist/components/AppBar/use-sticky-body-warning.js.map +1 -1
- package/dist/components/DataTable/use-dev-warnings.cjs +1 -1
- package/dist/components/DataTable/use-dev-warnings.cjs.map +1 -1
- package/dist/components/DataTable/use-dev-warnings.js +8 -7
- package/dist/components/DataTable/use-dev-warnings.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.js +91 -38
- package/dist/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.js +12 -8
- package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
- package/dist/http/api-client.cjs +1 -1
- package/dist/http/api-client.cjs.map +1 -1
- package/dist/http/api-client.js +45 -31
- package/dist/http/api-client.js.map +1 -1
- package/dist/http/describe-api-error.cjs +1 -1
- package/dist/http/describe-api-error.cjs.map +1 -1
- package/dist/http/describe-api-error.js +11 -7
- package/dist/http/describe-api-error.js.map +1 -1
- package/dist/http/errors.cjs +1 -1
- package/dist/http/errors.cjs.map +1 -1
- package/dist/http/errors.js +38 -21
- package/dist/http/errors.js.map +1 -1
- package/dist/http/use-describe-api-error.cjs +1 -1
- package/dist/http/use-describe-api-error.cjs.map +1 -1
- package/dist/http/use-describe-api-error.js +14 -10
- package/dist/http/use-describe-api-error.js.map +1 -1
- package/dist/icons/Icon.cjs +1 -1
- package/dist/icons/Icon.cjs.map +1 -1
- package/dist/icons/Icon.js +17 -18
- package/dist/icons/Icon.js.map +1 -1
- package/dist/icons/IconPicker.cjs +2 -0
- package/dist/icons/IconPicker.cjs.map +1 -0
- package/dist/icons/IconPicker.js +49 -0
- package/dist/icons/IconPicker.js.map +1 -0
- package/dist/icons/IconPicker.module.cjs +2 -0
- package/dist/icons/IconPicker.module.cjs.map +1 -0
- package/dist/icons/IconPicker.module.js +10 -0
- package/dist/icons/IconPicker.module.js.map +1 -0
- package/dist/icons/alias.cjs +2 -0
- package/dist/icons/alias.cjs.map +1 -0
- package/dist/icons/alias.js +9 -0
- package/dist/icons/alias.js.map +1 -0
- package/dist/icons/generated/loaders.cjs +1 -1
- package/dist/icons/generated/loaders.cjs.map +1 -1
- package/dist/icons/generated/loaders.js +273 -28
- package/dist/icons/generated/loaders.js.map +1 -1
- package/dist/icons/generated/shard-00.cjs +2 -0
- package/dist/icons/generated/shard-00.cjs.map +1 -0
- package/dist/icons/generated/shard-00.js +48 -0
- package/dist/icons/generated/shard-00.js.map +1 -0
- package/dist/icons/generated/shard-01.cjs +2 -0
- package/dist/icons/generated/shard-01.cjs.map +1 -0
- package/dist/icons/generated/shard-01.js +48 -0
- package/dist/icons/generated/shard-01.js.map +1 -0
- package/dist/icons/generated/shard-02.cjs +2 -0
- package/dist/icons/generated/shard-02.cjs.map +1 -0
- package/dist/icons/generated/shard-02.js +48 -0
- package/dist/icons/generated/shard-02.js.map +1 -0
- package/dist/icons/generated/shard-03.cjs +2 -0
- package/dist/icons/generated/shard-03.cjs.map +1 -0
- package/dist/icons/generated/shard-03.js +48 -0
- package/dist/icons/generated/shard-03.js.map +1 -0
- package/dist/icons/generated/shard-04.cjs +2 -0
- package/dist/icons/generated/shard-04.cjs.map +1 -0
- package/dist/icons/generated/shard-04.js +48 -0
- package/dist/icons/generated/shard-04.js.map +1 -0
- package/dist/icons/generated/shard-05.cjs +2 -0
- package/dist/icons/generated/shard-05.cjs.map +1 -0
- package/dist/icons/generated/shard-05.js +48 -0
- package/dist/icons/generated/shard-05.js.map +1 -0
- package/dist/icons/generated/shard-06.cjs +2 -0
- package/dist/icons/generated/shard-06.cjs.map +1 -0
- package/dist/icons/generated/shard-06.js +48 -0
- package/dist/icons/generated/shard-06.js.map +1 -0
- package/dist/icons/generated/shard-07.cjs +2 -0
- package/dist/icons/generated/shard-07.cjs.map +1 -0
- package/dist/icons/generated/shard-07.js +48 -0
- package/dist/icons/generated/shard-07.js.map +1 -0
- package/dist/icons/generated/shard-08.cjs +2 -0
- package/dist/icons/generated/shard-08.cjs.map +1 -0
- package/dist/icons/generated/shard-08.js +48 -0
- package/dist/icons/generated/shard-08.js.map +1 -0
- package/dist/icons/generated/shard-09.cjs +2 -0
- package/dist/icons/generated/shard-09.cjs.map +1 -0
- package/dist/icons/generated/shard-09.js +48 -0
- package/dist/icons/generated/shard-09.js.map +1 -0
- package/dist/icons/generated/shard-10.cjs +2 -0
- package/dist/icons/generated/shard-10.cjs.map +1 -0
- package/dist/icons/generated/shard-10.js +48 -0
- package/dist/icons/generated/shard-10.js.map +1 -0
- package/dist/icons/generated/shard-11.cjs +2 -0
- package/dist/icons/generated/shard-11.cjs.map +1 -0
- package/dist/icons/generated/shard-11.js +48 -0
- package/dist/icons/generated/shard-11.js.map +1 -0
- package/dist/icons/generated/shard-12.cjs +2 -0
- package/dist/icons/generated/shard-12.cjs.map +1 -0
- package/dist/icons/generated/shard-12.js +48 -0
- package/dist/icons/generated/shard-12.js.map +1 -0
- package/dist/icons/generated/shard-13.cjs +2 -0
- package/dist/icons/generated/shard-13.cjs.map +1 -0
- package/dist/icons/generated/shard-13.js +48 -0
- package/dist/icons/generated/shard-13.js.map +1 -0
- package/dist/icons/generated/shard-14.cjs +2 -0
- package/dist/icons/generated/shard-14.cjs.map +1 -0
- package/dist/icons/generated/shard-14.js +48 -0
- package/dist/icons/generated/shard-14.js.map +1 -0
- package/dist/icons/generated/shard-15.cjs +2 -0
- package/dist/icons/generated/shard-15.cjs.map +1 -0
- package/dist/icons/generated/shard-15.js +48 -0
- package/dist/icons/generated/shard-15.js.map +1 -0
- package/dist/icons/generated/shard-16.cjs +2 -0
- package/dist/icons/generated/shard-16.cjs.map +1 -0
- package/dist/icons/generated/shard-16.js +48 -0
- package/dist/icons/generated/shard-16.js.map +1 -0
- package/dist/icons/generated/shard-17.cjs +2 -0
- package/dist/icons/generated/shard-17.cjs.map +1 -0
- package/dist/icons/generated/shard-17.js +48 -0
- package/dist/icons/generated/shard-17.js.map +1 -0
- package/dist/icons/generated/shard-18.cjs +2 -0
- package/dist/icons/generated/shard-18.cjs.map +1 -0
- package/dist/icons/generated/shard-18.js +48 -0
- package/dist/icons/generated/shard-18.js.map +1 -0
- package/dist/icons/generated/shard-19.cjs +2 -0
- package/dist/icons/generated/shard-19.cjs.map +1 -0
- package/dist/icons/generated/shard-19.js +48 -0
- package/dist/icons/generated/shard-19.js.map +1 -0
- package/dist/icons/generated/shard-20.cjs +2 -0
- package/dist/icons/generated/shard-20.cjs.map +1 -0
- package/dist/icons/generated/shard-20.js +48 -0
- package/dist/icons/generated/shard-20.js.map +1 -0
- package/dist/icons/generated/shard-21.cjs +2 -0
- package/dist/icons/generated/shard-21.cjs.map +1 -0
- package/dist/icons/generated/shard-21.js +48 -0
- package/dist/icons/generated/shard-21.js.map +1 -0
- package/dist/icons/generated/shard-22.cjs +2 -0
- package/dist/icons/generated/shard-22.cjs.map +1 -0
- package/dist/icons/generated/shard-22.js +48 -0
- package/dist/icons/generated/shard-22.js.map +1 -0
- package/dist/icons/generated/shard-23.cjs +2 -0
- package/dist/icons/generated/shard-23.cjs.map +1 -0
- package/dist/icons/generated/shard-23.js +48 -0
- package/dist/icons/generated/shard-23.js.map +1 -0
- package/dist/icons/generated/shard-24.cjs +2 -0
- package/dist/icons/generated/shard-24.cjs.map +1 -0
- package/dist/icons/generated/shard-24.js +48 -0
- package/dist/icons/generated/shard-24.js.map +1 -0
- package/dist/icons/generated/shard-25.cjs +2 -0
- package/dist/icons/generated/shard-25.cjs.map +1 -0
- package/dist/icons/generated/shard-25.js +48 -0
- package/dist/icons/generated/shard-25.js.map +1 -0
- package/dist/icons/generated/shard-26.cjs +2 -0
- package/dist/icons/generated/shard-26.cjs.map +1 -0
- package/dist/icons/generated/shard-26.js +48 -0
- package/dist/icons/generated/shard-26.js.map +1 -0
- package/dist/icons/generated/shard-27.cjs +2 -0
- package/dist/icons/generated/shard-27.cjs.map +1 -0
- package/dist/icons/generated/shard-27.js +48 -0
- package/dist/icons/generated/shard-27.js.map +1 -0
- package/dist/icons/generated/shard-28.cjs +2 -0
- package/dist/icons/generated/shard-28.cjs.map +1 -0
- package/dist/icons/generated/shard-28.js +48 -0
- package/dist/icons/generated/shard-28.js.map +1 -0
- package/dist/icons/generated/shard-29.cjs +2 -0
- package/dist/icons/generated/shard-29.cjs.map +1 -0
- package/dist/icons/generated/shard-29.js +48 -0
- package/dist/icons/generated/shard-29.js.map +1 -0
- package/dist/icons/generated/shard-30.cjs +2 -0
- package/dist/icons/generated/shard-30.cjs.map +1 -0
- package/dist/icons/generated/shard-30.js +48 -0
- package/dist/icons/generated/shard-30.js.map +1 -0
- package/dist/icons/generated/shard-31.cjs +2 -0
- package/dist/icons/generated/shard-31.cjs.map +1 -0
- package/dist/icons/generated/shard-31.js +48 -0
- package/dist/icons/generated/shard-31.js.map +1 -0
- package/dist/icons/generated/shard-32.cjs +2 -0
- package/dist/icons/generated/shard-32.cjs.map +1 -0
- package/dist/icons/generated/shard-32.js +48 -0
- package/dist/icons/generated/shard-32.js.map +1 -0
- package/dist/icons/generated/shard-33.cjs +2 -0
- package/dist/icons/generated/shard-33.cjs.map +1 -0
- package/dist/icons/generated/shard-33.js +48 -0
- package/dist/icons/generated/shard-33.js.map +1 -0
- package/dist/icons/generated/shard-34.cjs +2 -0
- package/dist/icons/generated/shard-34.cjs.map +1 -0
- package/dist/icons/generated/shard-34.js +48 -0
- package/dist/icons/generated/shard-34.js.map +1 -0
- package/dist/icons/generated/shard-35.cjs +2 -0
- package/dist/icons/generated/shard-35.cjs.map +1 -0
- package/dist/icons/generated/shard-35.js +48 -0
- package/dist/icons/generated/shard-35.js.map +1 -0
- package/dist/icons/generated/shard-36.cjs +2 -0
- package/dist/icons/generated/shard-36.cjs.map +1 -0
- package/dist/icons/generated/shard-36.js +48 -0
- package/dist/icons/generated/shard-36.js.map +1 -0
- package/dist/icons/generated/shard-37.cjs +2 -0
- package/dist/icons/generated/shard-37.cjs.map +1 -0
- package/dist/icons/generated/shard-37.js +48 -0
- package/dist/icons/generated/shard-37.js.map +1 -0
- package/dist/icons/generated/shard-38.cjs +2 -0
- package/dist/icons/generated/shard-38.cjs.map +1 -0
- package/dist/icons/generated/shard-38.js +48 -0
- package/dist/icons/generated/shard-38.js.map +1 -0
- package/dist/icons/generated/shard-39.cjs +2 -0
- package/dist/icons/generated/shard-39.cjs.map +1 -0
- package/dist/icons/generated/shard-39.js +48 -0
- package/dist/icons/generated/shard-39.js.map +1 -0
- package/dist/icons/generated/shard-40.cjs +2 -0
- package/dist/icons/generated/shard-40.cjs.map +1 -0
- package/dist/icons/generated/shard-40.js +48 -0
- package/dist/icons/generated/shard-40.js.map +1 -0
- package/dist/icons/generated/shard-41.cjs +2 -0
- package/dist/icons/generated/shard-41.cjs.map +1 -0
- package/dist/icons/generated/shard-41.js +48 -0
- package/dist/icons/generated/shard-41.js.map +1 -0
- package/dist/icons/generated/shard-42.cjs +2 -0
- package/dist/icons/generated/shard-42.cjs.map +1 -0
- package/dist/icons/generated/shard-42.js +48 -0
- package/dist/icons/generated/shard-42.js.map +1 -0
- package/dist/icons/generated/shard-43.cjs +2 -0
- package/dist/icons/generated/shard-43.cjs.map +1 -0
- package/dist/icons/generated/shard-43.js +48 -0
- package/dist/icons/generated/shard-43.js.map +1 -0
- package/dist/icons/generated/shard-44.cjs +2 -0
- package/dist/icons/generated/shard-44.cjs.map +1 -0
- package/dist/icons/generated/shard-44.js +15 -0
- package/dist/icons/generated/shard-44.js.map +1 -0
- package/dist/icons/material-symbols.cjs +1 -1
- package/dist/icons/material-symbols.cjs.map +1 -1
- package/dist/icons/material-symbols.js +109 -1
- package/dist/icons/material-symbols.js.map +1 -1
- package/dist/icons/normalize-icon-name.cjs +2 -0
- package/dist/icons/normalize-icon-name.cjs.map +1 -0
- package/dist/icons/normalize-icon-name.js +9 -0
- package/dist/icons/normalize-icon-name.js.map +1 -0
- package/dist/icons/shard-cache.cjs +1 -1
- package/dist/icons/shard-cache.cjs.map +1 -1
- package/dist/icons/shard-cache.js +85 -32
- package/dist/icons/shard-cache.js.map +1 -1
- package/dist/icons/validate-icon-name.cjs +2 -0
- package/dist/icons/validate-icon-name.cjs.map +1 -0
- package/dist/icons/validate-icon-name.js +11 -0
- package/dist/icons/validate-icon-name.js.map +1 -0
- package/dist/icons-virtual-id.d.ts +24 -0
- package/dist/icons-virtual.cjs +2 -0
- package/dist/icons-virtual.cjs.map +1 -0
- package/dist/icons-virtual.d.ts +30 -22
- package/dist/icons-virtual.js +6 -0
- package/dist/icons-virtual.js.map +1 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.d.ts +269 -32
- package/dist/icons.js +11 -7
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +95 -28
- package/dist/tempest-react-sdk.js +106 -106
- package/dist/utils/dev-mode.cjs +2 -0
- package/dist/utils/dev-mode.cjs.map +1 -0
- package/dist/utils/dev-mode.js +12 -0
- package/dist/utils/dev-mode.js.map +1 -0
- package/dist/vite/tempest-icons.cjs +4 -4
- package/dist/vite/tempest-icons.cjs.map +1 -1
- package/dist/vite/tempest-icons.js +26 -26
- package/dist/vite/tempest-icons.js.map +1 -1
- package/dist/vite.d.ts +1 -1
- package/package.json +5 -2
- package/dist/icons/generated/shard-a.cjs +0 -2
- package/dist/icons/generated/shard-a.cjs.map +0 -1
- package/dist/icons/generated/shard-a.js +0 -114
- package/dist/icons/generated/shard-a.js.map +0 -1
- package/dist/icons/generated/shard-b.cjs +0 -2
- package/dist/icons/generated/shard-b.cjs.map +0 -1
- package/dist/icons/generated/shard-b.js +0 -158
- package/dist/icons/generated/shard-b.js.map +0 -1
- package/dist/icons/generated/shard-c.cjs +0 -2
- package/dist/icons/generated/shard-c.cjs.map +0 -1
- package/dist/icons/generated/shard-c.js +0 -269
- package/dist/icons/generated/shard-c.js.map +0 -1
- package/dist/icons/generated/shard-d.cjs +0 -2
- package/dist/icons/generated/shard-d.cjs.map +0 -1
- package/dist/icons/generated/shard-d.js +0 -62
- package/dist/icons/generated/shard-d.js.map +0 -1
- package/dist/icons/generated/shard-e.cjs +0 -2
- package/dist/icons/generated/shard-e.cjs.map +0 -1
- package/dist/icons/generated/shard-e.js +0 -33
- package/dist/icons/generated/shard-e.js.map +0 -1
- package/dist/icons/generated/shard-f.cjs +0 -2
- package/dist/icons/generated/shard-f.cjs.map +0 -1
- package/dist/icons/generated/shard-f.js +0 -145
- package/dist/icons/generated/shard-f.js.map +0 -1
- package/dist/icons/generated/shard-g.cjs +0 -2
- package/dist/icons/generated/shard-g.cjs.map +0 -1
- package/dist/icons/generated/shard-g.js +0 -61
- package/dist/icons/generated/shard-g.js.map +0 -1
- package/dist/icons/generated/shard-h.cjs +0 -2
- package/dist/icons/generated/shard-h.cjs.map +0 -1
- package/dist/icons/generated/shard-h.js +0 -62
- package/dist/icons/generated/shard-h.js.map +0 -1
- package/dist/icons/generated/shard-i.cjs +0 -2
- package/dist/icons/generated/shard-i.cjs.map +0 -1
- package/dist/icons/generated/shard-i.js +0 -30
- package/dist/icons/generated/shard-i.js.map +0 -1
- package/dist/icons/generated/shard-j.cjs +0 -2
- package/dist/icons/generated/shard-j.cjs.map +0 -1
- package/dist/icons/generated/shard-j.js +0 -10
- package/dist/icons/generated/shard-j.js.map +0 -1
- package/dist/icons/generated/shard-k.cjs +0 -2
- package/dist/icons/generated/shard-k.cjs.map +0 -1
- package/dist/icons/generated/shard-k.js +0 -16
- package/dist/icons/generated/shard-k.js.map +0 -1
- package/dist/icons/generated/shard-l.cjs +0 -2
- package/dist/icons/generated/shard-l.cjs.map +0 -1
- package/dist/icons/generated/shard-l.js +0 -92
- package/dist/icons/generated/shard-l.js.map +0 -1
- package/dist/icons/generated/shard-m.cjs +0 -2
- package/dist/icons/generated/shard-m.cjs.map +0 -1
- package/dist/icons/generated/shard-m.js +0 -143
- package/dist/icons/generated/shard-m.js.map +0 -1
- package/dist/icons/generated/shard-n.cjs +0 -2
- package/dist/icons/generated/shard-n.cjs.map +0 -1
- package/dist/icons/generated/shard-n.js +0 -24
- package/dist/icons/generated/shard-n.js.map +0 -1
- package/dist/icons/generated/shard-o.cjs +0 -2
- package/dist/icons/generated/shard-o.cjs.map +0 -1
- package/dist/icons/generated/shard-o.js +0 -17
- package/dist/icons/generated/shard-o.js.map +0 -1
- package/dist/icons/generated/shard-p.cjs +0 -2
- package/dist/icons/generated/shard-p.cjs.map +0 -1
- package/dist/icons/generated/shard-p.js +0 -114
- package/dist/icons/generated/shard-p.js.map +0 -1
- package/dist/icons/generated/shard-q.cjs +0 -2
- package/dist/icons/generated/shard-q.cjs.map +0 -1
- package/dist/icons/generated/shard-q.js +0 -10
- package/dist/icons/generated/shard-q.js.map +0 -1
- package/dist/icons/generated/shard-r.cjs +0 -2
- package/dist/icons/generated/shard-r.cjs.map +0 -1
- package/dist/icons/generated/shard-r.js +0 -79
- package/dist/icons/generated/shard-r.js.map +0 -1
- package/dist/icons/generated/shard-s.cjs +0 -2
- package/dist/icons/generated/shard-s.cjs.map +0 -1
- package/dist/icons/generated/shard-s.js +0 -256
- package/dist/icons/generated/shard-s.js.map +0 -1
- package/dist/icons/generated/shard-t.cjs +0 -2
- package/dist/icons/generated/shard-t.cjs.map +0 -1
- package/dist/icons/generated/shard-t.js +0 -109
- package/dist/icons/generated/shard-t.js.map +0 -1
- package/dist/icons/generated/shard-u.cjs +0 -2
- package/dist/icons/generated/shard-u.cjs.map +0 -1
- package/dist/icons/generated/shard-u.js +0 -50
- package/dist/icons/generated/shard-u.js.map +0 -1
- package/dist/icons/generated/shard-v.cjs +0 -2
- package/dist/icons/generated/shard-v.cjs.map +0 -1
- package/dist/icons/generated/shard-v.js +0 -30
- package/dist/icons/generated/shard-v.js.map +0 -1
- package/dist/icons/generated/shard-w.cjs +0 -2
- package/dist/icons/generated/shard-w.cjs.map +0 -1
- package/dist/icons/generated/shard-w.js +0 -48
- package/dist/icons/generated/shard-w.js.map +0 -1
- package/dist/icons/generated/shard-x.cjs +0 -2
- package/dist/icons/generated/shard-x.cjs.map +0 -1
- package/dist/icons/generated/shard-x.js +0 -10
- package/dist/icons/generated/shard-x.js.map +0 -1
- package/dist/icons/generated/shard-z.cjs +0 -2
- package/dist/icons/generated/shard-z.cjs.map +0 -1
- package/dist/icons/generated/shard-z.js +0 -25
- package/dist/icons/generated/shard-z.js.map +0 -1
package/dist/icons-virtual.d.ts
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
1
|
+
/// <reference path="./icons-virtual-id.d.ts" />
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
/** A slug → icon-component table, as produced by `createIconRegistry`. */
|
|
5
|
+
declare type IconRegistry = Readonly<Record<string, LucideIcon>>;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The static icon registry, empty until a build plugin fills it in.
|
|
9
|
+
*
|
|
10
|
+
* `tempestIcons()` resolves this module id to the table it generated from the
|
|
11
|
+
* slugs your source mentions. Every other runner — vitest without the plugin,
|
|
12
|
+
* `tsx`, a Storybook builder, a Node script that imports a component — gets this
|
|
13
|
+
* stub, so the import always resolves and `<Icon>` falls back to fetching shards.
|
|
14
|
+
*
|
|
15
|
+
* That fallback is why the stub exists: before it, an app that imported the
|
|
16
|
+
* registry could not be loaded outside a Vite build with the plugin installed,
|
|
17
|
+
* and the failure was the whole module graph refusing to resolve rather than one
|
|
18
|
+
* icon going missing.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* import { IconProvider } from "tempest-react-sdk/icons";
|
|
22
|
+
* import { staticIcons } from "tempest-react-sdk/icons/virtual";
|
|
23
|
+
*
|
|
24
|
+
* <IconProvider registry={staticIcons}>
|
|
25
|
+
* <App />
|
|
26
|
+
* </IconProvider>
|
|
27
|
+
*/
|
|
28
|
+
export declare const staticIcons: IconRegistry;
|
|
29
|
+
|
|
30
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons-virtual.js","names":[],"sources":["../src/icons/virtual.ts"],"sourcesContent":["import type { IconRegistry } from \"./icon-context\";\n\n/**\n * The static icon registry, empty until a build plugin fills it in.\n *\n * `tempestIcons()` resolves this module id to the table it generated from the\n * slugs your source mentions. Every other runner — vitest without the plugin,\n * `tsx`, a Storybook builder, a Node script that imports a component — gets this\n * stub, so the import always resolves and `<Icon>` falls back to fetching shards.\n *\n * That fallback is why the stub exists: before it, an app that imported the\n * registry could not be loaded outside a Vite build with the plugin installed,\n * and the failure was the whole module graph refusing to resolve rather than one\n * icon going missing.\n *\n * @example\n * import { IconProvider } from \"tempest-react-sdk/icons\";\n * import { staticIcons } from \"tempest-react-sdk/icons/virtual\";\n *\n * <IconProvider registry={staticIcons}>\n * <App />\n * </IconProvider>\n */\nexport const staticIcons: IconRegistry = {};\n"],"mappings":";AAuBA,IAAa,IAA4B,CAAC"}
|
package/dist/icons.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./icons/generated/aliases.cjs"),t=require("./icons/generated/icon-names.cjs"),n=require("./icons/icon-context.cjs"),r=require("./icons/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./icons/generated/aliases.cjs"),t=require("./icons/generated/icon-names.cjs"),n=require("./icons/icon-context.cjs"),r=require("./icons/alias.cjs"),i=require("./icons/normalize-icon-name.cjs"),a=require("./icons/shard-cache.cjs"),o=require("./icons/use-icon.cjs"),s=require("./icons/Icon.cjs"),c=require("./icons/is-icon-name.cjs"),l=require("./icons/validate-icon-name.cjs"),u=require("./icons/IconPicker.cjs"),d=require("./icons/IconProvider.cjs"),f=require("./icons/material-symbols.cjs");exports.DEFAULT_ICON_PICKER_MESSAGE=l.DEFAULT_ICON_PICKER_MESSAGE,exports.Icon=s.Icon,exports.IconPicker=u.IconPicker,exports.IconProvider=d.IconProvider,exports.MATERIAL_SYMBOL_FALLBACK=f.MATERIAL_SYMBOL_FALLBACK,exports.createIconRegistry=n.createIconRegistry,exports.fromMaterialSymbol=f.fromMaterialSymbol,exports.iconAliases=e.iconAliases,exports.iconNames=t.iconNames,exports.iconStatus=a.iconStatus,exports.isIconName=c.isIconName,exports.loadIcon=a.loadIcon,exports.materialToLucide=f.materialToLucide,exports.normalizeIconName=i.normalizeIconName,exports.peekIcon=a.peekIcon,exports.preloadIcons=a.preloadIcons,exports.registerIcons=a.registerIcons,exports.resolveIconAlias=r.resolveIconAlias,exports.subscribeToIconErrors=a.subscribeToIconErrors,exports.useIcon=o.useIcon,exports.validateIconName=l.validateIconName;
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference path="./icons-virtual-id.d.ts" />
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
1
3
|
import { LucideIcon } from 'lucide-react';
|
|
2
4
|
import { ReactNode } from 'react';
|
|
3
5
|
import { SVGProps } from 'react';
|
|
@@ -20,6 +22,9 @@ import { SVGProps } from 'react';
|
|
|
20
22
|
*/
|
|
21
23
|
export declare function createIconRegistry(icons: Record<string, LucideIcon>): IconRegistry;
|
|
22
24
|
|
|
25
|
+
/** The default message for a slug lucide does not ship. */
|
|
26
|
+
export declare const DEFAULT_ICON_PICKER_MESSAGE = "\u00CDcone inexistente. Use um slug do lucide, em kebab-case.";
|
|
27
|
+
|
|
23
28
|
/**
|
|
24
29
|
* Translate a Material Symbols code into a lucide slug, always returning one.
|
|
25
30
|
*
|
|
@@ -56,11 +61,16 @@ export declare function fromMaterialSymbol(code: string | null | undefined, fall
|
|
|
56
61
|
* An unknown slug renders `fallback` (nothing, by default) and warns in dev only
|
|
57
62
|
* — it never throws, because a bad name from an API must not take down the tree.
|
|
58
63
|
*
|
|
64
|
+
* `name` is normalized before the lookup, so a stored `icon_code` renders whether
|
|
65
|
+
* it was written `shopping_cart`, `" Save"` or under a slug lucide has since
|
|
66
|
+
* deprecated. Pass `normalize={false}` for a strict lookup.
|
|
67
|
+
*
|
|
59
68
|
* @example
|
|
60
69
|
* <Icon name="save" size={18} />
|
|
61
70
|
* <Icon name={row.iconSlug} fallback={<span className="skeleton" />} />
|
|
71
|
+
* <Icon icon={Wrench} size={18} />
|
|
62
72
|
*/
|
|
63
|
-
export declare function Icon({ name, size, strokeWidth, fallback, ...rest }: IconProps): ReactNode;
|
|
73
|
+
export declare function Icon({ name, icon, size, strokeWidth, fallback, normalize, ...rest }: IconProps): ReactNode;
|
|
64
74
|
|
|
65
75
|
/**
|
|
66
76
|
* Lucide's 257 deprecated slugs, mapped to the canonical slug that
|
|
@@ -72,6 +82,72 @@ export declare function Icon({ name, size, strokeWidth, fallback, ...rest }: Ico
|
|
|
72
82
|
*/
|
|
73
83
|
export declare const iconAliases: Record<string, string>;
|
|
74
84
|
|
|
85
|
+
declare interface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, "ref" | "name"> {
|
|
86
|
+
/** Width and height in px. Defaults to the provider's value, then lucide's `24`. */
|
|
87
|
+
size?: number | string;
|
|
88
|
+
/** Stroke width. Defaults to the provider's value, then lucide's `2`. */
|
|
89
|
+
strokeWidth?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Rendered while the icon's shard is in flight, and for a slug that does not
|
|
92
|
+
* exist at all. Defaults to nothing.
|
|
93
|
+
*
|
|
94
|
+
* Pass a same-sized placeholder when the surrounding layout would otherwise
|
|
95
|
+
* shift. Note that a slug already in the registry or the cache never renders
|
|
96
|
+
* this — it resolves during render.
|
|
97
|
+
*/
|
|
98
|
+
fallback?: ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Clean up `name` before looking it up. Default `true`.
|
|
101
|
+
*
|
|
102
|
+
* A stored `icon_code` arrives dirty — `shopping_cart`, `" Save"`, a slug
|
|
103
|
+
* lucide deprecated two releases ago — and normalizing is what makes those
|
|
104
|
+
* render instead of falling back. `false` asks for a strict lookup, for the
|
|
105
|
+
* case where you want an unexpected spelling to be visible rather than
|
|
106
|
+
* quietly repaired.
|
|
107
|
+
*
|
|
108
|
+
* Ignored when the icon is passed as a component.
|
|
109
|
+
*/
|
|
110
|
+
normalize?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Address the icon by component, for a call site that already imported it.
|
|
115
|
+
*
|
|
116
|
+
* No lookup, no registry, no shard: the component is rendered as passed. It is
|
|
117
|
+
* there so a screen mixing literal icons with data-driven ones can keep using one
|
|
118
|
+
* component instead of alternating between `<Icon name>` and `<Wrench />`, which
|
|
119
|
+
* is what makes the shared `size`/`strokeWidth` defaults apply to both.
|
|
120
|
+
*/
|
|
121
|
+
declare interface IconByComponentProps extends IconBaseProps {
|
|
122
|
+
icon: LucideIcon;
|
|
123
|
+
name?: never;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Address the icon by slug — the reason this component exists.
|
|
128
|
+
*
|
|
129
|
+
* The slug is typed as the union of every name lucide ships, so a typo is a
|
|
130
|
+
* compile error, while still accepting a plain `string` for the case that
|
|
131
|
+
* motivates the whole module: a name arriving from an API, a CMS or a config
|
|
132
|
+
* table.
|
|
133
|
+
*/
|
|
134
|
+
declare interface IconByNameProps extends IconBaseProps {
|
|
135
|
+
name: IconName | (string & {});
|
|
136
|
+
icon?: never;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** What a shard failure reports to whoever subscribed. */
|
|
140
|
+
export declare interface IconLoadError {
|
|
141
|
+
/** The shard key whose chunk could not be fetched. */
|
|
142
|
+
shard: string;
|
|
143
|
+
/** The slug whose render asked for it. */
|
|
144
|
+
slug: string;
|
|
145
|
+
/** Attempts made before giving up, retries included. */
|
|
146
|
+
attempts: number;
|
|
147
|
+
/** The last rejection from the dynamic import. */
|
|
148
|
+
error: unknown;
|
|
149
|
+
}
|
|
150
|
+
|
|
75
151
|
/**
|
|
76
152
|
* Every icon slug lucide ships, as a union of string literals.
|
|
77
153
|
*
|
|
@@ -89,30 +165,68 @@ export declare type IconName = "a-arrow-down" | "a-arrow-up" | "a-large-small" |
|
|
|
89
165
|
*/
|
|
90
166
|
export declare const iconNames: readonly IconName[];
|
|
91
167
|
|
|
92
|
-
|
|
168
|
+
/**
|
|
169
|
+
* An icon field: native autocomplete over every lucide slug, plus a preview.
|
|
170
|
+
*
|
|
171
|
+
* Every panel that lets someone choose an icon was rewriting this — filter the
|
|
172
|
+
* list, cap the suggestions, build the `<datalist>`, and block submit when the
|
|
173
|
+
* typed name does not exist. That last step is the one that matters: without it
|
|
174
|
+
* an invalid value reaches the database and only shows up later as a missing icon
|
|
175
|
+
* on every screen that renders the record.
|
|
176
|
+
*
|
|
177
|
+
* Validation is wired to the **native** form: the input carries a custom validity
|
|
178
|
+
* message, so a plain `<form>` refuses to submit and the browser points at the
|
|
179
|
+
* field. `validateIconName` is exported for react-hook-form and zod.
|
|
180
|
+
*
|
|
181
|
+
* Built on `<datalist>` rather than a custom listbox on purpose: keyboard,
|
|
182
|
+
* screen-reader and mobile behaviour come from the platform, and the component
|
|
183
|
+
* stays small enough that its cost is the slug list it has to import — ~7 KB
|
|
184
|
+
* brotli, which only a picker pays.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* const [icon, setIcon] = useState("");
|
|
188
|
+
*
|
|
189
|
+
* <form onSubmit={save}>
|
|
190
|
+
* <IconPicker value={icon} onChange={setIcon} required />
|
|
191
|
+
* <button type="submit">Salvar</button>
|
|
192
|
+
* </form>
|
|
193
|
+
*/
|
|
194
|
+
export declare function IconPicker({ value, onChange, limit, previewSize, invalidMessage, emptyPreview, className, ...rest }: IconPickerProps): ReactNode;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @tempest-limits props-count — value/onChange are the field, limit/placeholder
|
|
198
|
+
* the suggestion list, and previewSize/invalidMessage the two things a form
|
|
199
|
+
* around it needs to restyle or translate.
|
|
200
|
+
*/
|
|
201
|
+
export declare interface IconPickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "list" | "type"> {
|
|
202
|
+
/** The chosen slug. Always canonical — see `onChange`. */
|
|
203
|
+
value: string;
|
|
93
204
|
/**
|
|
94
|
-
*
|
|
205
|
+
* Fires with the **canonical** slug on every keystroke.
|
|
95
206
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
207
|
+
* Legacy spellings are normalized on the way out (`Shopping_Cart` →
|
|
208
|
+
* `shopping-cart`, `alert-circle` → `circle-alert`), so what a form stores is
|
|
209
|
+
* what `<Icon>` resolves without further cleanup.
|
|
99
210
|
*/
|
|
100
|
-
|
|
101
|
-
/** Width and height in px. Defaults to the provider's value, then lucide's `24`. */
|
|
102
|
-
size?: number | string;
|
|
103
|
-
/** Stroke width. Defaults to the provider's value, then lucide's `2`. */
|
|
104
|
-
strokeWidth?: number;
|
|
211
|
+
onChange: (slug: string) => void;
|
|
105
212
|
/**
|
|
106
|
-
*
|
|
107
|
-
* exist at all. Defaults to nothing.
|
|
213
|
+
* How many suggestions to render. Default `40`.
|
|
108
214
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
215
|
+
* There are 2024 slugs, and building every one as an `<option>` on each
|
|
216
|
+
* keystroke freezes the datalist — which is the reason this prop exists rather
|
|
217
|
+
* than a "show everything" default.
|
|
112
218
|
*/
|
|
113
|
-
|
|
219
|
+
limit?: number;
|
|
220
|
+
/** Size of the preview glyph, in px. Default `20`. */
|
|
221
|
+
previewSize?: number;
|
|
222
|
+
/** Overrides the message shown for a slug that does not exist. */
|
|
223
|
+
invalidMessage?: string;
|
|
224
|
+
/** Rendered in the preview box while nothing valid is chosen. */
|
|
225
|
+
emptyPreview?: ReactNode;
|
|
114
226
|
}
|
|
115
227
|
|
|
228
|
+
export declare type IconProps = IconByNameProps | IconByComponentProps;
|
|
229
|
+
|
|
116
230
|
/**
|
|
117
231
|
* Provide a static icon registry and shared `<Icon>` defaults to a subtree.
|
|
118
232
|
*
|
|
@@ -151,16 +265,18 @@ export declare interface IconProviderProps {
|
|
|
151
265
|
export declare type IconRegistry = Readonly<Record<string, LucideIcon>>;
|
|
152
266
|
|
|
153
267
|
/**
|
|
154
|
-
* Whether a slug is ready,
|
|
268
|
+
* Whether a slug is ready, loading, unknown, or unreachable.
|
|
155
269
|
*
|
|
156
270
|
* `"missing"` is only reported once that is actually knowable: either lucide has
|
|
157
|
-
* no icons under that initial letter, or the letter's shard
|
|
158
|
-
*
|
|
271
|
+
* no icons under that initial letter, or the letter's shard **arrived** without
|
|
272
|
+
* the slug in it. A shard that failed to load reports `"error"` instead — the two
|
|
273
|
+
* used to collapse into `"missing"`, which turned a stale deploy into what looked
|
|
274
|
+
* like a typo and made `Icon` warn about a name that is perfectly valid.
|
|
159
275
|
*
|
|
160
276
|
* @param slug - Any icon slug, canonical or deprecated.
|
|
161
277
|
* @returns The slug's resolution state.
|
|
162
278
|
*/
|
|
163
|
-
export declare function iconStatus(slug: string): "ready" | "loading" | "missing";
|
|
279
|
+
export declare function iconStatus(slug: string): "ready" | "loading" | "missing" | "error";
|
|
164
280
|
|
|
165
281
|
/**
|
|
166
282
|
* Narrow an arbitrary string to a known icon slug.
|
|
@@ -216,28 +332,65 @@ export declare const MATERIAL_SYMBOL_FALLBACK: IconName;
|
|
|
216
332
|
* empty screen: a handful of codes collide by accident, so roughly one row in
|
|
217
333
|
* ten draws the right icon and the bug reads as "some icons went missing".
|
|
218
334
|
*
|
|
219
|
-
* **
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
335
|
+
* **Still not the full vocabulary.** Material Symbols ships ~3600 names and
|
|
336
|
+
* almost none of them will ever appear in an `icon_code` of ours, so this grows
|
|
337
|
+
* on demand, one hand-written pair at a time — a map generated by name
|
|
338
|
+
* heuristics gets it badly wrong, starting with `build`, which is a wrench in
|
|
339
|
+
* Material Symbols and nothing to do with construction. What is here covers the
|
|
340
|
+
* trades lot it started as plus the vocabulary an administrative panel actually
|
|
341
|
+
* uses: navigation, money, dates, media, and the service categories a seed
|
|
342
|
+
* tends to carry.
|
|
343
|
+
*
|
|
344
|
+
* Every target is checked mechanically against the slug list by
|
|
345
|
+
* `material-symbols.test.ts`, so a pair pointing at a name lucide does not ship
|
|
346
|
+
* — or at one it has since deprecated — fails the suite instead of reaching a
|
|
347
|
+
* grid. What no test can check is whether the *chosen* icon is the right
|
|
348
|
+
* metaphor, which is why pairs go in by hand.
|
|
224
349
|
*
|
|
225
|
-
* **Approximations, deliberate and not one-to-one
|
|
350
|
+
* **Approximations, deliberate and not one-to-one** (the full list lives in
|
|
351
|
+
* `docs/icons.md`):
|
|
226
352
|
*
|
|
227
353
|
* - `plumbing` → `shower-head`, because lucide has no pipe.
|
|
228
354
|
* - `build`, `handyman` and `hardware` all land on `wrench` — Material Symbols
|
|
229
355
|
* distinguishes the tools, lucide does not.
|
|
230
356
|
* - `pedal_bike`, `two_wheeler` and `delivery_dining` all land on `bike`.
|
|
357
|
+
* - `dentistry` → `face-slightly-smiling`, since lucide ships no tooth.
|
|
358
|
+
* - `iron` → `shirt` and `cleaning_services` → `spray-can`: the activity, not
|
|
359
|
+
* the implement.
|
|
360
|
+
* - `roofing` → `house`, the same glyph as `home`, because lucide has no roof.
|
|
231
361
|
*
|
|
232
|
-
* The
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
362
|
+
* The identity pairs are here on purpose. Their names happen to match in both
|
|
363
|
+
* vocabularies, so they already render today — leaving them out would send them
|
|
364
|
+
* to {@link MATERIAL_SYMBOL_FALLBACK} and make this bridge a regression for
|
|
365
|
+
* exactly the codes that used to work.
|
|
236
366
|
*
|
|
237
367
|
* @see fromMaterialSymbol — the lookup you normally call.
|
|
238
368
|
*/
|
|
239
369
|
export declare const materialToLucide: Readonly<Record<string, IconName>>;
|
|
240
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Clean up an icon code and resolve it to the slug lucide actually ships.
|
|
373
|
+
*
|
|
374
|
+
* Every backend that stores an `icon_code` stores it dirty: `snake_case` left over
|
|
375
|
+
* from an old form, a capital or a stray space from a hand-typed value, and slugs
|
|
376
|
+
* lucide has since deprecated. Each app was writing the same three-step cleanup
|
|
377
|
+
* before rendering — trim, lower-case, `_` → `-`, then `resolveIconAlias` — which
|
|
378
|
+
* is code that should not exist outside the SDK.
|
|
379
|
+
*
|
|
380
|
+
* Note that this does **not** check whether the result is a real icon: the point is
|
|
381
|
+
* to produce the canonical spelling, and deciding what to do with an unknown name
|
|
382
|
+
* belongs to the caller. Pair it with `isIconName` when you need that answer, or
|
|
383
|
+
* let `<Icon>` render its `fallback`.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* normalizeIconName(" Alert_Circle "); // "circle-alert"
|
|
387
|
+
* normalizeIconName("shopping_cart"); // "shopping-cart"
|
|
388
|
+
*
|
|
389
|
+
* @param code - Any stored icon code.
|
|
390
|
+
* @returns The canonical, lucide-spelled slug.
|
|
391
|
+
*/
|
|
392
|
+
export declare function normalizeIconName(code: string): string;
|
|
393
|
+
|
|
241
394
|
/**
|
|
242
395
|
* Read an icon out of the cache without triggering a fetch.
|
|
243
396
|
*
|
|
@@ -257,18 +410,73 @@ export declare function peekIcon(slug: string): LucideIcon | undefined;
|
|
|
257
410
|
*/
|
|
258
411
|
export declare function preloadIcons(slugs: readonly string[]): Promise<void>;
|
|
259
412
|
|
|
413
|
+
/**
|
|
414
|
+
* Make icon components resolvable by slug, with no provider and no plugin.
|
|
415
|
+
*
|
|
416
|
+
* Call it once from an entrypoint. The icons land in the same table a fetched
|
|
417
|
+
* shard fills, so every `<Icon>` below — including one that renders before the
|
|
418
|
+
* call, since registering notifies subscribers — resolves them synchronously and
|
|
419
|
+
* never issues a request.
|
|
420
|
+
*
|
|
421
|
+
* This is the whole setup for a closed catalog: an admin panel with twenty known
|
|
422
|
+
* icons pays two lines instead of a build plugin plus a provider. `IconProvider`
|
|
423
|
+
* stays for what is genuinely tree-scoped — the `size`/`strokeWidth` defaults and
|
|
424
|
+
* a registry that must override the global one for one subtree.
|
|
425
|
+
*
|
|
426
|
+
* A slug lucide does not ship is registered as-is, which is how an app adds its
|
|
427
|
+
* own artwork to the same `<Icon name>` call site.
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* import { registerIcons } from "tempest-react-sdk/icons";
|
|
431
|
+
* import { Save, Trash2 } from "lucide-react";
|
|
432
|
+
*
|
|
433
|
+
* registerIcons({ save: Save, "trash-2": Trash2 });
|
|
434
|
+
*
|
|
435
|
+
* @param icons - Slug → icon component. Deprecated slugs are stored under the
|
|
436
|
+
* canonical name, so both spellings resolve.
|
|
437
|
+
*/
|
|
438
|
+
export declare function registerIcons(icons: Readonly<Record<string, LucideIcon>>): void;
|
|
439
|
+
|
|
260
440
|
/**
|
|
261
441
|
* Map a slug to the canonical slug that owns the icon.
|
|
262
442
|
*
|
|
263
443
|
* Lucide keeps 257 deprecated aliases (`alert-circle` → `circle-alert`), and a
|
|
264
444
|
* slug persisted in a database years ago is exactly the case this feature exists
|
|
265
|
-
* for, so an alias must keep resolving after a lucide bump renames it.
|
|
445
|
+
* for, so an alias must keep resolving after a lucide bump renames it. Resolution
|
|
446
|
+
* happens before the shard lookup, since only canonical slugs are sharded.
|
|
447
|
+
*
|
|
448
|
+
* Its own module, not part of `shard-cache`: everything that merely *names* an
|
|
449
|
+
* icon needs this — `normalizeIconName`, `validateIconName`, a form checking a
|
|
450
|
+
* value before submit — and none of that needs the shard loader index. Sharing a
|
|
451
|
+
* module made a validator that never renders anything drag in all 45 shard
|
|
452
|
+
* modules.
|
|
266
453
|
*
|
|
267
454
|
* @param slug - Any icon slug, canonical or deprecated.
|
|
268
455
|
* @returns The canonical slug.
|
|
269
456
|
*/
|
|
270
457
|
export declare function resolveIconAlias(slug: string): string;
|
|
271
458
|
|
|
459
|
+
/**
|
|
460
|
+
* Subscribe to shard fetches that gave up.
|
|
461
|
+
*
|
|
462
|
+
* The failure is routine in a long-lived tab: a deploy rotates hashed chunk
|
|
463
|
+
* names, the old asset leaves the CDN, and the next icon that needs it 404s. That
|
|
464
|
+
* used to end in a permanent fallback with no signal — nothing for the user,
|
|
465
|
+
* nothing for observability. Subscribing is what turns it into both.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* import { subscribeToIconErrors } from "tempest-react-sdk/icons";
|
|
469
|
+
*
|
|
470
|
+
* subscribeToIconErrors(({ shard, error }) => {
|
|
471
|
+
* Sentry.captureException(error, { tags: { iconShard: shard } });
|
|
472
|
+
* promptReloadForStaleChunks();
|
|
473
|
+
* });
|
|
474
|
+
*
|
|
475
|
+
* @param listener - Called once per shard that gave up.
|
|
476
|
+
* @returns An unsubscribe function.
|
|
477
|
+
*/
|
|
478
|
+
export declare function subscribeToIconErrors(listener: (detail: IconLoadError) => void): () => void;
|
|
479
|
+
|
|
272
480
|
/**
|
|
273
481
|
* Resolve an icon slug to its component.
|
|
274
482
|
*
|
|
@@ -286,4 +494,33 @@ export declare function resolveIconAlias(slug: string): string;
|
|
|
286
494
|
*/
|
|
287
495
|
export declare function useIcon(slug: string | undefined): LucideIcon | undefined;
|
|
288
496
|
|
|
497
|
+
/**
|
|
498
|
+
* Validate an icon slug the way `IconPicker` does.
|
|
499
|
+
*
|
|
500
|
+
* Its own module rather than living next to the component: a file that exports
|
|
501
|
+
* both a component and other values breaks Fast Refresh in a consuming dev
|
|
502
|
+
* server, which is what `react-refresh/only-export-components` guards and why
|
|
503
|
+
* `icon-context.ts` is split off from `IconProvider` too.
|
|
504
|
+
*
|
|
505
|
+
* Exported because the picker is not the only place a slug is checked: a form
|
|
506
|
+
* built on react-hook-form or zod validates before submitting, and duplicating
|
|
507
|
+
* the rule there is how the two drift apart.
|
|
508
|
+
*
|
|
509
|
+
* Empty passes — "no icon chosen" is a `required` question, not a spelling one,
|
|
510
|
+
* and conflating them would make the field impossible to clear.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* // react-hook-form
|
|
514
|
+
* register("icon", { validate: (value) => validateIconName(value) ?? true });
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* // zod
|
|
518
|
+
* z.string().refine((value) => !validateIconName(value), { message: "Ícone inexistente" });
|
|
519
|
+
*
|
|
520
|
+
* @param value - The slug to check, in any spelling the picker accepts.
|
|
521
|
+
* @param message - Overrides the default message.
|
|
522
|
+
* @returns The message when the slug does not exist, `undefined` when it is fine.
|
|
523
|
+
*/
|
|
524
|
+
export declare function validateIconName(value: string, message?: string): string | undefined;
|
|
525
|
+
|
|
289
526
|
export { }
|
package/dist/icons.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { iconAliases as e } from "./icons/generated/aliases.js";
|
|
2
2
|
import { iconNames as t } from "./icons/generated/icon-names.js";
|
|
3
3
|
import { createIconRegistry as n } from "./icons/icon-context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
4
|
+
import { resolveIconAlias as r } from "./icons/alias.js";
|
|
5
|
+
import { normalizeIconName as i } from "./icons/normalize-icon-name.js";
|
|
6
|
+
import { iconStatus as a, loadIcon as o, peekIcon as s, preloadIcons as c, registerIcons as l, subscribeToIconErrors as u } from "./icons/shard-cache.js";
|
|
7
|
+
import { useIcon as d } from "./icons/use-icon.js";
|
|
8
|
+
import { Icon as f } from "./icons/Icon.js";
|
|
9
|
+
import { isIconName as p } from "./icons/is-icon-name.js";
|
|
10
|
+
import { DEFAULT_ICON_PICKER_MESSAGE as m, validateIconName as h } from "./icons/validate-icon-name.js";
|
|
11
|
+
import { IconPicker as g } from "./icons/IconPicker.js";
|
|
12
|
+
import { IconProvider as _ } from "./icons/IconProvider.js";
|
|
13
|
+
import { MATERIAL_SYMBOL_FALLBACK as v, fromMaterialSymbol as y, materialToLucide as b } from "./icons/material-symbols.js";
|
|
14
|
+
export { m as DEFAULT_ICON_PICKER_MESSAGE, f as Icon, g as IconPicker, _ as IconProvider, v as MATERIAL_SYMBOL_FALLBACK, n as createIconRegistry, y as fromMaterialSymbol, e as iconAliases, t as iconNames, a as iconStatus, p as isIconName, o as loadIcon, b as materialToLucide, i as normalizeIconName, s as peekIcon, c as preloadIcons, l as registerIcons, r as resolveIconAlias, u as subscribeToIconErrors, d as useIcon, h as validateIconName };
|