@handijit/ui 1.0.0 → 2.0.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.
Files changed (174) hide show
  1. package/README.md +485 -571
  2. package/build/base.css +1 -1
  3. package/build/charts.cjs +1 -1
  4. package/build/charts.cjs.map +1 -1
  5. package/build/charts.css +1 -1
  6. package/build/charts.js +350 -349
  7. package/build/charts.js.map +1 -1
  8. package/build/chat.cjs +3 -3
  9. package/build/chat.cjs.map +1 -1
  10. package/build/chat.css +1 -1
  11. package/build/chat.js +344 -343
  12. package/build/chat.js.map +1 -1
  13. package/build/components/Accordion/style.css +1 -1
  14. package/build/components/Alert/style.css +1 -1
  15. package/build/components/Avatar/style.css +1 -1
  16. package/build/components/Badge/index.cjs +1 -1
  17. package/build/components/Badge/index.cjs.map +1 -1
  18. package/build/components/Badge/index.d.ts +8 -13
  19. package/build/components/Badge/index.js +1 -1
  20. package/build/components/Badge/index.js.map +1 -1
  21. package/build/components/Badge/style.css +1 -1
  22. package/build/components/BottomSheet/style.css +1 -1
  23. package/build/components/Breadcrumb/style.css +1 -1
  24. package/build/components/Button/index.cjs +1 -1
  25. package/build/components/Button/index.cjs.map +1 -1
  26. package/build/components/Button/index.js +2 -2
  27. package/build/components/Button/index.js.map +1 -1
  28. package/build/components/Button/style.css +1 -1
  29. package/build/components/Card/style.css +1 -1
  30. package/build/components/Carousel/style.css +1 -1
  31. package/build/components/Checkbox/style.css +1 -1
  32. package/build/components/Chip/style.css +1 -1
  33. package/build/components/ChipGroup/style.css +1 -1
  34. package/build/components/CodeBadge/style.css +1 -1
  35. package/build/components/Combobox/index.cjs +1 -1
  36. package/build/components/Combobox/index.cjs.map +1 -1
  37. package/build/components/Combobox/index.js +51 -51
  38. package/build/components/Combobox/index.js.map +1 -1
  39. package/build/components/Combobox/style.css +1 -1
  40. package/build/components/CommandPalette/style.css +1 -1
  41. package/build/components/CopyField/style.css +1 -1
  42. package/build/components/DataTable/style.css +1 -1
  43. package/build/components/DateField/index.d.ts +1 -1
  44. package/build/components/DateField/style.css +1 -1
  45. package/build/components/Directory/style.css +1 -1
  46. package/build/components/Disclosure/style.css +1 -1
  47. package/build/components/Divider/style.css +1 -1
  48. package/build/components/Drawer/style.css +1 -1
  49. package/build/components/EmptyState/style.css +1 -1
  50. package/build/components/Field/style.css +1 -1
  51. package/build/components/FileUpload/style.css +1 -1
  52. package/build/components/FilterBar/style.css +1 -1
  53. package/build/components/IconButton/index.cjs +1 -1
  54. package/build/components/IconButton/index.cjs.map +1 -1
  55. package/build/components/IconButton/index.d.ts +2 -2
  56. package/build/components/IconButton/index.js +1 -1
  57. package/build/components/IconButton/index.js.map +1 -1
  58. package/build/components/IconButton/style.css +1 -1
  59. package/build/components/Input/index.d.ts +1 -1
  60. package/build/components/Input/style.css +1 -1
  61. package/build/components/Kbd/style.css +1 -1
  62. package/build/components/Menu/style.css +1 -1
  63. package/build/components/Modal/style.css +1 -1
  64. package/build/components/PageHeader/style.css +1 -1
  65. package/build/components/Pagination/style.css +1 -1
  66. package/build/components/Panel/style.css +1 -1
  67. package/build/components/PasswordInput/style.css +1 -1
  68. package/build/components/Popover/style.css +1 -1
  69. package/build/components/Price/style.css +1 -1
  70. package/build/components/Progress/style.css +1 -1
  71. package/build/components/PromptDialog/style.css +1 -1
  72. package/build/components/QuantityStepper/style.css +1 -1
  73. package/build/components/Radio/style.css +1 -1
  74. package/build/components/RadioCard/style.css +1 -1
  75. package/build/components/RangeSlider/style.css +1 -1
  76. package/build/components/Rating/style.css +1 -1
  77. package/build/components/RatingInput/style.css +1 -1
  78. package/build/components/ScrollArea/style.css +1 -1
  79. package/build/components/SectionHeader/style.css +1 -1
  80. package/build/components/SegmentedControl/style.css +1 -1
  81. package/build/components/Select/index.cjs +1 -1
  82. package/build/components/Select/index.cjs.map +1 -1
  83. package/build/components/Select/index.js +28 -28
  84. package/build/components/Select/index.js.map +1 -1
  85. package/build/components/Select/style.css +1 -1
  86. package/build/components/Skeleton/style.css +1 -1
  87. package/build/components/Spinner/style.css +1 -1
  88. package/build/components/Stat/style.css +1 -1
  89. package/build/components/StatusDot/style.css +1 -1
  90. package/build/components/Steps/style.css +1 -1
  91. package/build/components/SummaryCard/style.css +1 -1
  92. package/build/components/Switch/index.d.ts +1 -1
  93. package/build/components/Switch/style.css +1 -1
  94. package/build/components/Table/style.css +1 -1
  95. package/build/components/TableCheckbox/style.css +1 -1
  96. package/build/components/Tabs/style.css +1 -1
  97. package/build/components/TagInput/style.css +1 -1
  98. package/build/components/TextLink/style.css +1 -1
  99. package/build/components/Textarea/style.css +1 -1
  100. package/build/components/Tile/style.css +1 -1
  101. package/build/components/Timeline/style.css +1 -1
  102. package/build/components/Toast/style.css +1 -1
  103. package/build/components/Tooltip/style.css +1 -1
  104. package/build/constants/breakpoint.constants.cjs +1 -1
  105. package/build/constants/breakpoint.constants.cjs.map +1 -1
  106. package/build/constants/breakpoint.constants.d.ts +13 -8
  107. package/build/constants/breakpoint.constants.js +7 -5
  108. package/build/constants/breakpoint.constants.js.map +1 -1
  109. package/build/enums/ui-size.enum.cjs.map +1 -1
  110. package/build/enums/ui-size.enum.d.ts +5 -2
  111. package/build/enums/ui-size.enum.js.map +1 -1
  112. package/build/enums/ui-variant.enum.cjs +1 -1
  113. package/build/enums/ui-variant.enum.cjs.map +1 -1
  114. package/build/enums/ui-variant.enum.d.ts +13 -13
  115. package/build/enums/ui-variant.enum.js +1 -1
  116. package/build/enums/ui-variant.enum.js.map +1 -1
  117. package/build/helpers/theme.helper.cjs +1 -23
  118. package/build/helpers/theme.helper.cjs.map +1 -1
  119. package/build/helpers/theme.helper.d.ts +13 -44
  120. package/build/helpers/theme.helper.js +31 -69
  121. package/build/helpers/theme.helper.js.map +1 -1
  122. package/build/hooks/useUiTheme.cjs +1 -1
  123. package/build/hooks/useUiTheme.cjs.map +1 -1
  124. package/build/hooks/useUiTheme.d.ts +4 -1
  125. package/build/hooks/useUiTheme.js +34 -28
  126. package/build/hooks/useUiTheme.js.map +1 -1
  127. package/build/hooks/useUiTokens.cjs +1 -1
  128. package/build/hooks/useUiTokens.cjs.map +1 -1
  129. package/build/hooks/useUiTokens.d.ts +8 -8
  130. package/build/hooks/useUiTokens.js +24 -27
  131. package/build/hooks/useUiTokens.js.map +1 -1
  132. package/build/index.cjs +1 -1
  133. package/build/index.d.ts +3 -5
  134. package/build/index.js +194 -202
  135. package/build/index.js.map +1 -1
  136. package/build/scss/_index.scss +4 -3
  137. package/build/scss/_mixins.scss +264 -146
  138. package/build/scss/_variables.scss +216 -24
  139. package/build/styles.css +67 -67
  140. package/build/theme/UiProvider.cjs +1 -1
  141. package/build/theme/UiProvider.cjs.map +1 -1
  142. package/build/theme/UiProvider.d.ts +10 -9
  143. package/build/theme/UiProvider.js +7 -25
  144. package/build/theme/UiProvider.js.map +1 -1
  145. package/build/theme/UiThemeScript.cjs +1 -1
  146. package/build/theme/UiThemeScript.cjs.map +1 -1
  147. package/build/theme/UiThemeScript.d.ts +13 -10
  148. package/build/theme/UiThemeScript.js +2 -2
  149. package/build/theme/UiThemeScript.js.map +1 -1
  150. package/build/theme/context.js +2 -2
  151. package/build/types/charts/core/palette.d.ts +6 -8
  152. package/build/types/chat/Legend/index.d.ts +3 -2
  153. package/build/types/theme.type.d.ts +6 -48
  154. package/build/types/types/theme.type.d.ts +6 -48
  155. package/package.json +10 -10
  156. package/build/scss/_colors.generated.scss +0 -119
  157. package/build/scss/_metrics.generated.scss +0 -49
  158. package/build/theme/initUi.cjs +0 -2
  159. package/build/theme/initUi.cjs.map +0 -1
  160. package/build/theme/initUi.d.ts +0 -7
  161. package/build/theme/initUi.js +0 -10
  162. package/build/theme/initUi.js.map +0 -1
  163. package/build/theme/palette.cjs +0 -2
  164. package/build/theme/palette.cjs.map +0 -1
  165. package/build/theme/palette.d.ts +0 -219
  166. package/build/theme/palette.js +0 -148
  167. package/build/theme/palette.js.map +0 -1
  168. package/build/theme/tokens.cjs +0 -2
  169. package/build/theme/tokens.cjs.map +0 -1
  170. package/build/theme/tokens.d.ts +0 -225
  171. package/build/theme/tokens.js +0 -384
  172. package/build/theme/tokens.js.map +0 -1
  173. package/build/types/theme/palette.d.ts +0 -219
  174. package/build/types/theme/tokens.d.ts +0 -225
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),t=require("react"),r=require("../helpers/theme.helper.cjs"),a=require("./context.cjs"),m=({children:l,theme:e,linkComponent:s,labels:u})=>{const o=t.useMemo(()=>e?JSON.stringify(e):"",[e]),n=t.useMemo(()=>e?r.toStyleHtml(r.buildThemeCss(e)):"",[o]),c=t.useRef(e);c.current=e;const d=t.useMemo(()=>({theme:c.current,linkComponent:s,labels:u}),[o,s,u]);return i.jsxs(a.default.Provider,{value:d,children:[n!==""&&i.jsx("style",{id:r.THEME_STYLE_ID,dangerouslySetInnerHTML:{__html:n}}),l]})};exports.default=m;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),s=require("react"),i=require("./context.cjs"),c=({children:r,linkComponent:e,labels:t})=>{const u=s.useMemo(()=>({linkComponent:e,labels:t}),[e,t]);return o.jsx(i.default.Provider,{value:u,children:r})};exports.default=c;
2
2
  //# sourceMappingURL=UiProvider.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiProvider.cjs","sources":["../../src/theme/UiProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type ReactNode, useMemo, useRef } from 'react';\n\nimport { buildThemeCss, THEME_STYLE_ID, toStyleHtml } from '../helpers/theme.helper';\nimport type { UiLinkComponent } from '../types/link.type';\nimport UiContext from './context';\nimport type { UiLabels, UiThemeConfig } from '@/types/theme.type';\n\ntype Props = {\n children: ReactNode;\n /** Tema ezmeleri. */\n theme?: UiThemeConfig;\n /**\n * Tüketicinin bağlantı bileşeni.\n * @example import NextLink from 'next/link'; <UiProvider linkComponent={NextLink}>…</Ha…\n */\n linkComponent?: UiLinkComponent;\n /** Arayüz metinleri — bir kez, burada. */\n labels?: UiLabels;\n};\n\n/**\n * Kütüphane sağlayıcısı. `<body>` içine konur: tema ezmesini çocuklarından önce bir `<style>`\n * olarak çizer.\n * @example <UiProvider linkComponent={NextLink} theme={{ light: { link: '#0a58ca' } }}> <App…\n */\nconst UiProvider: FC<Props> = ({ children, theme, linkComponent, labels }) => {\n /*\n * `JSON.stringify` bagimlilik anahtari olarak kullaniliyor: cagiran taraf neredeyse her zaman\n * satir ici bir nesne literali veriyor ve referans her…\n */\n const themeKey = useMemo(() => (theme ? JSON.stringify(theme) : ''), [theme]);\n\n /*\n * Ezme AGACTA cizilir, efektte belgeye yazilmaz: sunucu ciktisinda da var ve ilk boyamada\n * uygulanir. 5.6.2'ye kadar `useEffect` icindeki `applyThemeConfig` `<head>`e hidrasyondan SONRA\n * yaziyordu; ilk karede varsayilan palet, bir kare sonra tema gorunuyordu. `<body>` icinde\n * oldugu icin tuketicinin `<head>`deki stil sayfalarindan (katman sirasi bildirimi dahil) sonra\n * gelir.\n */\n const themeHtml = useMemo(\n () => (theme ? toStyleHtml(buildThemeCss(theme)) : ''),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [themeKey],\n );\n\n /* `theme` bir REFERANSTAN okunur, bagimliliktan degil. */\n const themeRef = useRef(theme);\n themeRef.current = theme;\n\n const value = useMemo(\n () => ({ theme: themeRef.current, linkComponent, labels }),\n /*\n * `themeKey` denetciye GEREKSIZ gorunuyor cunku memo'nun govdesinde gecmiyor — ama tam da isi\n * bu: temanin ICERIGI degistiginde yeni bir nesne…\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [themeKey, linkComponent, labels],\n );\n\n return (\n <UiContext.Provider value={value}>\n {themeHtml !== '' && (\n <style id={THEME_STYLE_ID} dangerouslySetInnerHTML={{ __html: themeHtml }} />\n )}\n {children}\n </UiContext.Provider>\n );\n};\n\nexport default UiProvider;\n"],"names":["UiProvider","children","theme","linkComponent","labels","themeKey","useMemo","themeHtml","toStyleHtml","buildThemeCss","themeRef","useRef","value","jsxs","UiContext","THEME_STYLE_ID"],"mappings":"qPA0BMA,EAAwB,CAAC,CAAE,SAAAC,EAAU,MAAAC,EAAO,cAAAC,EAAe,OAAAC,KAAa,CAK5E,MAAMC,EAAWC,EAAAA,QAAQ,IAAOJ,EAAQ,KAAK,UAAUA,CAAK,EAAI,GAAK,CAACA,CAAK,CAAC,EAStEK,EAAYD,EAAAA,QAChB,IAAOJ,EAAQM,EAAAA,YAAYC,EAAAA,cAAcP,CAAK,CAAC,EAAI,GAEnD,CAACG,CAAQ,CAAA,EAILK,EAAWC,EAAAA,OAAOT,CAAK,EAC7BQ,EAAS,QAAUR,EAEnB,MAAMU,EAAQN,EAAAA,QACZ,KAAO,CAAE,MAAOI,EAAS,QAAS,cAAAP,EAAe,OAAAC,CAAA,GAMjD,CAACC,EAAUF,EAAeC,CAAM,CAAA,EAGlC,OACES,EAAAA,KAACC,EAAAA,QAAU,SAAV,CAAmB,MAAAF,EACjB,SAAA,CAAAL,IAAc,UACZ,QAAA,CAAM,GAAIQ,EAAAA,eAAgB,wBAAyB,CAAE,OAAQR,CAAA,CAAU,CAAG,EAE5EN,CAAA,EACH,CAEJ"}
1
+ {"version":3,"file":"UiProvider.cjs","sources":["../../src/theme/UiProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type ReactNode, useMemo } from 'react';\n\nimport type { UiLinkComponent } from '../types/link.type';\nimport UiContext from './context';\nimport type { UiLabels } from '@/types/theme.type';\n\ntype Props = {\n children: ReactNode;\n /**\n * The application's link component.\n * @example import NextLink from 'next/link'; <UiProvider linkComponent={NextLink}>…</UiProvider>\n */\n linkComponent?: UiLinkComponent;\n /** Interface strings — once, here. */\n labels?: UiLabels;\n};\n\n/**\n * Library provider: the router's link component and the interface strings.\n *\n * It renders nothing of its own and injects no style. Colours, type, spacing and motion come from\n * `@handijit/design/tokens.css`, which the application loads once; a brand override is a plain\n * `--hd-*` declaration in the application's own stylesheet.\n * @example <UiProvider linkComponent={NextLink} labels={{ close: 'Kapat' }}><App /></UiProvider>\n */\nconst UiProvider: FC<Props> = ({ children, linkComponent, labels }) => {\n const value = useMemo(() => ({ linkComponent, labels }), [linkComponent, labels]);\n\n return <UiContext.Provider value={value}>{children}</UiContext.Provider>;\n};\n\nexport default UiProvider;\n"],"names":["UiProvider","children","linkComponent","labels","value","useMemo","jsx","UiContext"],"mappings":"4MA0BMA,EAAwB,CAAC,CAAE,SAAAC,EAAU,cAAAC,EAAe,OAAAC,KAAa,CACrE,MAAMC,EAAQC,UAAQ,KAAO,CAAE,cAAAH,EAAe,OAAAC,IAAW,CAACD,EAAeC,CAAM,CAAC,EAEhF,OAAOG,EAAAA,IAACC,EAAAA,QAAU,SAAV,CAAmB,MAAAH,EAAe,SAAAH,CAAA,CAAS,CACrD"}
@@ -1,22 +1,23 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { UiLinkComponent } from '../types/link.type';
3
- import { UiLabels, UiThemeConfig } from '../types/theme.type';
3
+ import { UiLabels } from '../types/theme.type';
4
4
  type Props = {
5
5
  children: ReactNode;
6
- /** Tema ezmeleri. */
7
- theme?: UiThemeConfig;
8
6
  /**
9
- * Tüketicinin bağlantı bileşeni.
10
- * @example import NextLink from 'next/link'; <UiProvider linkComponent={NextLink}>…</Ha…
7
+ * The application's link component.
8
+ * @example import NextLink from 'next/link'; <UiProvider linkComponent={NextLink}>…</UiProvider>
11
9
  */
12
10
  linkComponent?: UiLinkComponent;
13
- /** Arayüz metinleri — bir kez, burada. */
11
+ /** Interface strings — once, here. */
14
12
  labels?: UiLabels;
15
13
  };
16
14
  /**
17
- * Kütüphane sağlayıcısı. `<body>` içine konur: tema ezmesini çocuklarından önce bir `<style>`
18
- * olarak çizer.
19
- * @example <UiProvider linkComponent={NextLink} theme={{ light: { link: '#0a58ca' } }}> <App…
15
+ * Library provider: the router's link component and the interface strings.
16
+ *
17
+ * It renders nothing of its own and injects no style. Colours, type, spacing and motion come from
18
+ * `@handijit/design/tokens.css`, which the application loads once; a brand override is a plain
19
+ * `--hd-*` declaration in the application's own stylesheet.
20
+ * @example <UiProvider linkComponent={NextLink} labels={{ close: 'Kapat' }}><App /></UiProvider>
20
21
  */
21
22
  declare const UiProvider: FC<Props>;
22
23
  export default UiProvider;
@@ -1,30 +1,12 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as f } from "react/jsx-runtime";
3
- import { useMemo as t, useRef as l } from "react";
4
- import { toStyleHtml as d, buildThemeCss as y, THEME_STYLE_ID as p } from "../helpers/theme.helper.js";
5
- import x from "./context.js";
6
- const a = ({ children: m, theme: r, linkComponent: e, labels: o }) => {
7
- const s = t(() => r ? JSON.stringify(r) : "", [r]), i = t(
8
- () => r ? d(y(r)) : "",
9
- // eslint-disable-next-line react-hooks/exhaustive-deps
10
- [s]
11
- ), n = l(r);
12
- n.current = r;
13
- const u = t(
14
- () => ({ theme: n.current, linkComponent: e, labels: o }),
15
- /*
16
- * `themeKey` denetciye GEREKSIZ gorunuyor cunku memo'nun govdesinde gecmiyor — ama tam da isi
17
- * bu: temanin ICERIGI degistiginde yeni bir nesne…
18
- */
19
- // eslint-disable-next-line react-hooks/exhaustive-deps
20
- [s, e, o]
21
- );
22
- return /* @__PURE__ */ c(x.Provider, { value: u, children: [
23
- i !== "" && /* @__PURE__ */ f("style", { id: p, dangerouslySetInnerHTML: { __html: i } }),
24
- m
25
- ] });
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { useMemo as m } from "react";
4
+ import s from "./context.js";
5
+ const d = ({ children: t, linkComponent: r, labels: o }) => {
6
+ const e = m(() => ({ linkComponent: r, labels: o }), [r, o]);
7
+ return /* @__PURE__ */ i(s.Provider, { value: e, children: t });
26
8
  };
27
9
  export {
28
- a as default
10
+ d as default
29
11
  };
30
12
  //# sourceMappingURL=UiProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiProvider.js","sources":["../../src/theme/UiProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type ReactNode, useMemo, useRef } from 'react';\n\nimport { buildThemeCss, THEME_STYLE_ID, toStyleHtml } from '../helpers/theme.helper';\nimport type { UiLinkComponent } from '../types/link.type';\nimport UiContext from './context';\nimport type { UiLabels, UiThemeConfig } from '@/types/theme.type';\n\ntype Props = {\n children: ReactNode;\n /** Tema ezmeleri. */\n theme?: UiThemeConfig;\n /**\n * Tüketicinin bağlantı bileşeni.\n * @example import NextLink from 'next/link'; <UiProvider linkComponent={NextLink}>…</Ha…\n */\n linkComponent?: UiLinkComponent;\n /** Arayüz metinleri — bir kez, burada. */\n labels?: UiLabels;\n};\n\n/**\n * Kütüphane sağlayıcısı. `<body>` içine konur: tema ezmesini çocuklarından önce bir `<style>`\n * olarak çizer.\n * @example <UiProvider linkComponent={NextLink} theme={{ light: { link: '#0a58ca' } }}> <App…\n */\nconst UiProvider: FC<Props> = ({ children, theme, linkComponent, labels }) => {\n /*\n * `JSON.stringify` bagimlilik anahtari olarak kullaniliyor: cagiran taraf neredeyse her zaman\n * satir ici bir nesne literali veriyor ve referans her…\n */\n const themeKey = useMemo(() => (theme ? JSON.stringify(theme) : ''), [theme]);\n\n /*\n * Ezme AGACTA cizilir, efektte belgeye yazilmaz: sunucu ciktisinda da var ve ilk boyamada\n * uygulanir. 5.6.2'ye kadar `useEffect` icindeki `applyThemeConfig` `<head>`e hidrasyondan SONRA\n * yaziyordu; ilk karede varsayilan palet, bir kare sonra tema gorunuyordu. `<body>` icinde\n * oldugu icin tuketicinin `<head>`deki stil sayfalarindan (katman sirasi bildirimi dahil) sonra\n * gelir.\n */\n const themeHtml = useMemo(\n () => (theme ? toStyleHtml(buildThemeCss(theme)) : ''),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [themeKey],\n );\n\n /* `theme` bir REFERANSTAN okunur, bagimliliktan degil. */\n const themeRef = useRef(theme);\n themeRef.current = theme;\n\n const value = useMemo(\n () => ({ theme: themeRef.current, linkComponent, labels }),\n /*\n * `themeKey` denetciye GEREKSIZ gorunuyor cunku memo'nun govdesinde gecmiyor — ama tam da isi\n * bu: temanin ICERIGI degistiginde yeni bir nesne…\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [themeKey, linkComponent, labels],\n );\n\n return (\n <UiContext.Provider value={value}>\n {themeHtml !== '' && (\n <style id={THEME_STYLE_ID} dangerouslySetInnerHTML={{ __html: themeHtml }} />\n )}\n {children}\n </UiContext.Provider>\n );\n};\n\nexport default UiProvider;\n"],"names":["UiProvider","children","theme","linkComponent","labels","themeKey","useMemo","themeHtml","toStyleHtml","buildThemeCss","themeRef","useRef","value","jsxs","UiContext","THEME_STYLE_ID"],"mappings":";;;;;AA0BA,MAAMA,IAAwB,CAAC,EAAE,UAAAC,GAAU,OAAAC,GAAO,eAAAC,GAAe,QAAAC,QAAa;AAK5E,QAAMC,IAAWC,EAAQ,MAAOJ,IAAQ,KAAK,UAAUA,CAAK,IAAI,IAAK,CAACA,CAAK,CAAC,GAStEK,IAAYD;AAAA,IAChB,MAAOJ,IAAQM,EAAYC,EAAcP,CAAK,CAAC,IAAI;AAAA;AAAA,IAEnD,CAACG,CAAQ;AAAA,EAAA,GAILK,IAAWC,EAAOT,CAAK;AAC7B,EAAAQ,EAAS,UAAUR;AAEnB,QAAMU,IAAQN;AAAA,IACZ,OAAO,EAAE,OAAOI,EAAS,SAAS,eAAAP,GAAe,QAAAC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMjD,CAACC,GAAUF,GAAeC,CAAM;AAAA,EAAA;AAGlC,SACE,gBAAAS,EAACC,EAAU,UAAV,EAAmB,OAAAF,GACjB,UAAA;AAAA,IAAAL,MAAc,wBACZ,SAAA,EAAM,IAAIQ,GAAgB,yBAAyB,EAAE,QAAQR,EAAA,EAAU,CAAG;AAAA,IAE5EN;AAAA,EAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"UiProvider.js","sources":["../../src/theme/UiProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type ReactNode, useMemo } from 'react';\n\nimport type { UiLinkComponent } from '../types/link.type';\nimport UiContext from './context';\nimport type { UiLabels } from '@/types/theme.type';\n\ntype Props = {\n children: ReactNode;\n /**\n * The application's link component.\n * @example import NextLink from 'next/link'; <UiProvider linkComponent={NextLink}>…</UiProvider>\n */\n linkComponent?: UiLinkComponent;\n /** Interface strings — once, here. */\n labels?: UiLabels;\n};\n\n/**\n * Library provider: the router's link component and the interface strings.\n *\n * It renders nothing of its own and injects no style. Colours, type, spacing and motion come from\n * `@handijit/design/tokens.css`, which the application loads once; a brand override is a plain\n * `--hd-*` declaration in the application's own stylesheet.\n * @example <UiProvider linkComponent={NextLink} labels={{ close: 'Kapat' }}><App /></UiProvider>\n */\nconst UiProvider: FC<Props> = ({ children, linkComponent, labels }) => {\n const value = useMemo(() => ({ linkComponent, labels }), [linkComponent, labels]);\n\n return <UiContext.Provider value={value}>{children}</UiContext.Provider>;\n};\n\nexport default UiProvider;\n"],"names":["UiProvider","children","linkComponent","labels","value","useMemo","jsx","UiContext"],"mappings":";;;;AA0BA,MAAMA,IAAwB,CAAC,EAAE,UAAAC,GAAU,eAAAC,GAAe,QAAAC,QAAa;AACrE,QAAMC,IAAQC,EAAQ,OAAO,EAAE,eAAAH,GAAe,QAAAC,MAAW,CAACD,GAAeC,CAAM,CAAC;AAEhF,SAAO,gBAAAG,EAACC,EAAU,UAAV,EAAmB,OAAAH,GAAe,UAAAH,EAAA,CAAS;AACrD;"}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),r=require("../helpers/theme.helper.cjs"),i=({storageKey:e})=>t.jsx("script",{dangerouslySetInnerHTML:{__html:r.themeBootScript({storageKey:e})}});exports.default=i;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),r=require("@handijit/design"),s=({nonce:e})=>t.jsx("script",{nonce:e,dangerouslySetInnerHTML:{__html:r.THEME_BOOT_SCRIPT}});exports.default=s;
2
2
  //# sourceMappingURL=UiThemeScript.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiThemeScript.cjs","sources":["../../src/theme/UiThemeScript.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n\nimport { themeBootScript } from '../helpers/theme.helper';\n\ntype Props = {\n /** Kullanıcının seçiminin tutulduğu `localStorage` anahtarı. */\n storageKey: string;\n};\n\n/**\n * İLK BOYAMADAN ÖNCE tema — `<head>` içine, sunucu düzeninde.\n *\n * Kayıtlı açık seçimi (`light` / `dark`) `<html data-ui-theme>`e yazar; kayıt yoksa sistem\n * tercihi izlenir. Sunucu çıktısındaki satır içi betik HTML ayrıştırılırken çalışır; React onu\n * istemcide YENİDEN çalıştırmaz.\n *\n * ⚠ BİR BİLEŞEN, fonksiyon değil: paket `'use client'` taşıdığı için dışa verilen düz bir\n * fonksiyon Next'in sunucu bileşeninde ÇAĞRILAMIYOR (\"Attempted to call … from the server\").\n * Bileşen ise sunucuda da çizilir. Bu yüzden 5.1 taslağındaki `themeBootScript()` dışa verilmedi.\n * @example <head><UiThemeScript storageKey=\"theme\" /></head>\n */\nconst UiThemeScript: FC<Props> = ({ storageKey }) => (\n <script dangerouslySetInnerHTML={{ __html: themeBootScript({ storageKey }) }} />\n);\n\nexport default UiThemeScript;\n"],"names":["UiThemeScript","storageKey","jsx","themeBootScript"],"mappings":"uMAsBMA,EAA2B,CAAC,CAAE,WAAAC,KAClCC,EAAAA,IAAC,SAAA,CAAO,wBAAyB,CAAE,OAAQC,EAAAA,gBAAgB,CAAE,WAAAF,CAAA,CAAY,EAAE,CAAG"}
1
+ {"version":3,"file":"UiThemeScript.cjs","sources":["../../src/theme/UiThemeScript.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n\nimport { THEME_BOOT_SCRIPT } from '@handijit/design';\n\ntype Props = {\n /**\n * The request's CSP nonce. Leave it out when the policy allows the script by hash\n * (`THEME_BOOT_SCRIPT_HASH`), which also works for statically rendered pages.\n */\n nonce?: string;\n};\n\n/**\n * The theme before the first paint — rendered in `<head>`, in the server output.\n *\n * It inlines the boot script of `@handijit/design` unchanged, so its text matches\n * `THEME_BOOT_SCRIPT_HASH`: the stored choice (`localStorage[\"hd-theme\"]`) or the system setting is\n * written to `<html data-theme>` while the HTML is parsed. Put `suppressHydrationWarning` on\n * `<html>`: the attribute is set before React hydrates.\n *\n * A component and not a function: the package carries `'use client'`, and a plain exported function\n * cannot be called from a Next server component, while a component renders on the server too.\n * @example <head><UiThemeScript nonce={nonce} /></head>\n */\nconst UiThemeScript: FC<Props> = ({ nonce }) => (\n <script nonce={nonce} dangerouslySetInnerHTML={{ __html: THEME_BOOT_SCRIPT }} />\n);\n\nexport default UiThemeScript;\n"],"names":["UiThemeScript","nonce","jsx","THEME_BOOT_SCRIPT"],"mappings":"4LAyBMA,EAA2B,CAAC,CAAE,MAAAC,CAAA,IAClCC,MAAC,SAAA,CAAO,MAAAD,EAAc,wBAAyB,CAAE,OAAQE,EAAAA,iBAAA,CAAkB,CAAG"}
@@ -1,19 +1,22 @@
1
1
  import { FC } from 'react';
2
2
  type Props = {
3
- /** Kullanıcının seçiminin tutulduğu `localStorage` anahtarı. */
4
- storageKey: string;
3
+ /**
4
+ * The request's CSP nonce. Leave it out when the policy allows the script by hash
5
+ * (`THEME_BOOT_SCRIPT_HASH`), which also works for statically rendered pages.
6
+ */
7
+ nonce?: string;
5
8
  };
6
9
  /**
7
- * İLK BOYAMADAN ÖNCE tema — `<head>` içine, sunucu düzeninde.
10
+ * The theme before the first paint — rendered in `<head>`, in the server output.
8
11
  *
9
- * Kayıtlı açık seçimi (`light` / `dark`) `<html data-ui-theme>`e yazar; kayıt yoksa sistem
10
- * tercihi izlenir. Sunucu çıktısındaki satır içi betik HTML ayrıştırılırken çalışır; React onu
11
- * istemcide YENİDEN çalıştırmaz.
12
+ * It inlines the boot script of `@handijit/design` unchanged, so its text matches
13
+ * `THEME_BOOT_SCRIPT_HASH`: the stored choice (`localStorage["hd-theme"]`) or the system setting is
14
+ * written to `<html data-theme>` while the HTML is parsed. Put `suppressHydrationWarning` on
15
+ * `<html>`: the attribute is set before React hydrates.
12
16
  *
13
- * ⚠ BİR BİLEŞEN, fonksiyon değil: paket `'use client'` taşıdığı için dışa verilen düz bir
14
- * fonksiyon Next'in sunucu bileşeninde ÇAĞRILAMIYOR ("Attempted to call … from the server").
15
- * Bileşen ise sunucuda da çizilir. Bu yüzden 5.1 taslağındaki `themeBootScript()` dışa verilmedi.
16
- * @example <head><UiThemeScript storageKey="theme" /></head>
17
+ * A component and not a function: the package carries `'use client'`, and a plain exported function
18
+ * cannot be called from a Next server component, while a component renders on the server too.
19
+ * @example <head><UiThemeScript nonce={nonce} /></head>
17
20
  */
18
21
  declare const UiThemeScript: FC<Props>;
19
22
  export default UiThemeScript;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as e } from "react/jsx-runtime";
3
- import { themeBootScript as r } from "../helpers/theme.helper.js";
4
- const m = ({ storageKey: t }) => /* @__PURE__ */ e("script", { dangerouslySetInnerHTML: { __html: r({ storageKey: t }) } });
3
+ import { THEME_BOOT_SCRIPT as r } from "@handijit/design";
4
+ const m = ({ nonce: t }) => /* @__PURE__ */ e("script", { nonce: t, dangerouslySetInnerHTML: { __html: r } });
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"UiThemeScript.js","sources":["../../src/theme/UiThemeScript.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n\nimport { themeBootScript } from '../helpers/theme.helper';\n\ntype Props = {\n /** Kullanıcının seçiminin tutulduğu `localStorage` anahtarı. */\n storageKey: string;\n};\n\n/**\n * İLK BOYAMADAN ÖNCE tema — `<head>` içine, sunucu düzeninde.\n *\n * Kayıtlı açık seçimi (`light` / `dark`) `<html data-ui-theme>`e yazar; kayıt yoksa sistem\n * tercihi izlenir. Sunucu çıktısındaki satır içi betik HTML ayrıştırılırken çalışır; React onu\n * istemcide YENİDEN çalıştırmaz.\n *\n * ⚠ BİR BİLEŞEN, fonksiyon değil: paket `'use client'` taşıdığı için dışa verilen düz bir\n * fonksiyon Next'in sunucu bileşeninde ÇAĞRILAMIYOR (\"Attempted to call … from the server\").\n * Bileşen ise sunucuda da çizilir. Bu yüzden 5.1 taslağındaki `themeBootScript()` dışa verilmedi.\n * @example <head><UiThemeScript storageKey=\"theme\" /></head>\n */\nconst UiThemeScript: FC<Props> = ({ storageKey }) => (\n <script dangerouslySetInnerHTML={{ __html: themeBootScript({ storageKey }) }} />\n);\n\nexport default UiThemeScript;\n"],"names":["UiThemeScript","storageKey","jsx","themeBootScript"],"mappings":";;;AAsBA,MAAMA,IAA2B,CAAC,EAAE,YAAAC,QAClC,gBAAAC,EAAC,UAAA,EAAO,yBAAyB,EAAE,QAAQC,EAAgB,EAAE,YAAAF,EAAA,CAAY,IAAE,CAAG;"}
1
+ {"version":3,"file":"UiThemeScript.js","sources":["../../src/theme/UiThemeScript.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\n\nimport { THEME_BOOT_SCRIPT } from '@handijit/design';\n\ntype Props = {\n /**\n * The request's CSP nonce. Leave it out when the policy allows the script by hash\n * (`THEME_BOOT_SCRIPT_HASH`), which also works for statically rendered pages.\n */\n nonce?: string;\n};\n\n/**\n * The theme before the first paint — rendered in `<head>`, in the server output.\n *\n * It inlines the boot script of `@handijit/design` unchanged, so its text matches\n * `THEME_BOOT_SCRIPT_HASH`: the stored choice (`localStorage[\"hd-theme\"]`) or the system setting is\n * written to `<html data-theme>` while the HTML is parsed. Put `suppressHydrationWarning` on\n * `<html>`: the attribute is set before React hydrates.\n *\n * A component and not a function: the package carries `'use client'`, and a plain exported function\n * cannot be called from a Next server component, while a component renders on the server too.\n * @example <head><UiThemeScript nonce={nonce} /></head>\n */\nconst UiThemeScript: FC<Props> = ({ nonce }) => (\n <script nonce={nonce} dangerouslySetInnerHTML={{ __html: THEME_BOOT_SCRIPT }} />\n);\n\nexport default UiThemeScript;\n"],"names":["UiThemeScript","nonce","jsx","THEME_BOOT_SCRIPT"],"mappings":";;;AAyBA,MAAMA,IAA2B,CAAC,EAAE,OAAAC,EAAA,MAClC,gBAAAC,EAAC,UAAA,EAAO,OAAAD,GAAc,yBAAyB,EAAE,QAAQE,EAAA,EAAkB,CAAG;"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { useContext as t, createContext as e } from "react";
3
- const o = e({}), s = () => t(o);
2
+ import { createContext as t, useContext as e } from "react";
3
+ const o = t({}), s = () => e(o);
4
4
  export {
5
5
  o as default,
6
6
  s as useUi
@@ -1,13 +1,11 @@
1
1
  /**
2
- * SERİ RENKLERİ — ui kategorik paleti (`cat-1…5`, `series-2`). Her ton iki temanın üç
3
- * yüzeyinde ≥3:1 (`check:contrast`) ve iki ton arasında ΔE ≥ 8 (palet üreteci).
4
- * ⚠ Marka yeşilleri (çam, mint) seri rengi OLMAZ: yeşil eylemin rengi. `cat-3` orta aydınlıkta bir
5
- * kategori yeşili.
2
+ * SERIES COLOURS — the six data series tokens of `@handijit/design` (`chart-1…6`), which the design
3
+ * package gates for contrast against the theme surfaces and for distance from each other.
4
+ * `muted` is for a waiting or empty part.
6
5
  */
7
- export type ChartTone = 'cat-1' | 'cat-2' | 'cat-3' | 'cat-4' | 'cat-5' | 'series-1' | 'series-2' | 'muted';
8
- /** Sıra: ilk iki seri en uzak iki ton (mavi, kil) — iki serili grafik en sık durum. */
6
+ export type ChartTone = 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5' | 'chart-6' | 'muted';
9
7
  export declare const TONE_ORDER: readonly ChartTone[];
10
- /** Verilmeyen tonu sıradan alır; altıdan fazla seride döner (lejant adı ayırt eder). */
8
+ /** Takes a missing tone from the order; wraps after six series (the legend name tells them apart). */
11
9
  export declare const toneAt: (index: number, tone?: ChartTone) => ChartTone;
12
- /** CSS rengi — tema değişince yeniden çizim gerekmez, değişken çözülür. */
10
+ /** A CSS colour — the variable resolves when the theme changes, no redraw needed. */
13
11
  export declare const toneColor: (tone: ChartTone) => string;
@@ -1,6 +1,6 @@
1
1
  import { type FC } from 'react';
2
- /** Kategorik paletin adları (`cat-*`, `series-*`) + bekleme/boşluk için `muted`. */
3
- export type LegendTone = 'cat-1' | 'cat-2' | 'cat-3' | 'cat-4' | 'cat-5' | 'series-1' | 'series-2' | 'muted';
2
+ /** The data series tokens of `@handijit/design` (`chart-1…6`) + `muted` for a waiting or empty part. */
3
+ export type LegendTone = 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5' | 'chart-6' | 'muted';
4
4
  export type LegendItem = {
5
5
  id: string;
6
6
  label: string;
@@ -11,6 +11,7 @@ type Props = {
11
11
  className?: string;
12
12
  testId?: string;
13
13
  };
14
+ export declare const legendToneColor: (tone: LegendTone) => string;
14
15
  /**
15
16
  * Grafik lejantı — renk karesi + ad. Renk yalnızca kategorik paletten gelir (iki temanın üç
16
17
  * yüzeyinde ≥3:1); ad her zaman metin olarak yazılır, renk tek başına anlam taşımaz.
@@ -1,54 +1,20 @@
1
+ import { ThemeName, ThemePreference } from '@handijit/design';
1
2
  import { UiLinkComponent } from './link.type';
2
- import { LIGHT_THEME, METRIC_TOKENS } from '../theme/tokens';
3
3
  /**
4
4
  * Sayı biçimlendiricileri: değere bağlı metinler dizeyle verilemez.
5
5
  * ⚠ `helpers/label.helper.ts` de aynı imzayı ELLE taşıyordu.
6
6
  */
7
7
  export type Formatter<TArgs extends unknown[]> = (...args: TArgs) => string;
8
8
  /**
9
- * Dışarıdan verilebilecek tema yapılandırması.
10
- * @example initUi({ theme: { light: { link: '#0a58ca', 'ring-color': '#0d6efd' }, dark: {…
9
+ * The user's CHOICE. `system` = no explicit choice, the operating system's setting is followed.
10
+ * The same union as `ThemePreference` of `@handijit/design`.
11
11
  */
12
- export type UiThemeConfig = Partial<{
13
- light: UiThemeTokens;
14
- dark: UiThemeTokens;
15
- fonts: UiFonts;
16
- /**
17
- * Ölçü ezmeleri — yarıçap, boşluk, punto, süre.
18
- * @example initUi({ theme: { metrics: { 'radius-md': '2px', 'radius-lg': '4px' } } });
19
- */
20
- metrics: UiMetrics;
21
- }>;
22
- /** Yazı tipi ailesi sözleşmesi. */
23
- export type UiFonts = Partial<{
24
- heading: string;
25
- body: string;
26
- mono: string;
27
- }>;
28
- /**
29
- * Kullanıcının SEÇİMİ. `system` = açık bir seçim yok, işletim sistemi tercihi izlenir
30
- * (`prefers-color-scheme`).
31
- */
32
- export type UiColorPreference = UiColorScheme | 'system';
33
- /** ÇÖZÜLMÜŞ tema — ekranda gerçekten hangisi çizili. */
34
- export type UiColorScheme = 'light' | 'dark';
35
- /** Bir temanın TAM eşlemesi. */
36
- export type UiResolvedTokens = Record<UiToken, string>;
37
- /** Bir temanın token → değer eşlemesi. */
38
- export type UiThemeTokens = Partial<Record<UiToken, string>>;
39
- /** Bilgi yoğunluğu. `default` vitrin, `compact` operasyon paneli. */
40
- export type UiDensity = 'default' | 'compact';
41
- /** Ölçü ezmeleri. */
42
- export type UiMetrics = Partial<Record<UiMetricToken, string>>;
43
- /** Ölçü token adları — `METRIC_TOKENS`ten türetilir. */
44
- export type UiMetricToken = keyof typeof METRIC_TOKENS;
45
- /** Token adları — `LIGHT_THEME`den türetilir, elle listelenmez. */
46
- export type UiToken = keyof typeof LIGHT_THEME;
12
+ export type UiColorPreference = ThemePreference;
13
+ /** The RESOLVED theme — the one actually drawn. The same union as design's `ThemeName`. */
14
+ export type UiColorScheme = ThemeName;
47
15
  export type UiContextValue = {
48
16
  /** Tüketicinin yönlendiricisi (`next/link`, `react-router`ın `Link`i…). */
49
17
  linkComponent?: UiLinkComponent;
50
- /** Uygulanan tema ezmeleri. */
51
- theme?: UiThemeConfig;
52
18
  /**
53
19
  * Arayüz metinleri.
54
20
  * ⚠ Referans bir dönem `theme/labels.ts`yi gösteriyordu; o dosya yalnızca tek satırlık bir başlık
@@ -198,14 +164,6 @@ export type UiLabels = Partial<{
198
164
  scale: Record<1 | 2 | 3 | 4 | 5, string>;
199
165
  }>;
200
166
  }>;
201
- export type InitUiOptions = Partial<{
202
- /** Tema ve ölçü ezmeleri. */
203
- theme: UiThemeConfig;
204
- /** Başlangıç şeması. */
205
- colorScheme: UiColorScheme;
206
- /** Bilgi yoğunluğu. */
207
- density: UiDensity;
208
- }>;
209
167
  export type UiThemeState = {
210
168
  /**
211
169
  * ÇÖZÜLMÜŞ tema — ekranda çizili olan. `preference` `system` iken bu alan işletim sisteminin o
@@ -1,54 +1,20 @@
1
+ import type { ThemeName, ThemePreference } from '@handijit/design';
1
2
  import type { UiLinkComponent } from '@/types/link.type';
2
- import { LIGHT_THEME, METRIC_TOKENS } from '@/theme/tokens';
3
3
  /**
4
4
  * Sayı biçimlendiricileri: değere bağlı metinler dizeyle verilemez.
5
5
  * ⚠ `helpers/label.helper.ts` de aynı imzayı ELLE taşıyordu.
6
6
  */
7
7
  export type Formatter<TArgs extends unknown[]> = (...args: TArgs) => string;
8
8
  /**
9
- * Dışarıdan verilebilecek tema yapılandırması.
10
- * @example initUi({ theme: { light: { link: '#0a58ca', 'ring-color': '#0d6efd' }, dark: {…
9
+ * The user's CHOICE. `system` = no explicit choice, the operating system's setting is followed.
10
+ * The same union as `ThemePreference` of `@handijit/design`.
11
11
  */
12
- export type UiThemeConfig = Partial<{
13
- light: UiThemeTokens;
14
- dark: UiThemeTokens;
15
- fonts: UiFonts;
16
- /**
17
- * Ölçü ezmeleri — yarıçap, boşluk, punto, süre.
18
- * @example initUi({ theme: { metrics: { 'radius-md': '2px', 'radius-lg': '4px' } } });
19
- */
20
- metrics: UiMetrics;
21
- }>;
22
- /** Yazı tipi ailesi sözleşmesi. */
23
- export type UiFonts = Partial<{
24
- heading: string;
25
- body: string;
26
- mono: string;
27
- }>;
28
- /**
29
- * Kullanıcının SEÇİMİ. `system` = açık bir seçim yok, işletim sistemi tercihi izlenir
30
- * (`prefers-color-scheme`).
31
- */
32
- export type UiColorPreference = UiColorScheme | 'system';
33
- /** ÇÖZÜLMÜŞ tema — ekranda gerçekten hangisi çizili. */
34
- export type UiColorScheme = 'light' | 'dark';
35
- /** Bir temanın TAM eşlemesi. */
36
- export type UiResolvedTokens = Record<UiToken, string>;
37
- /** Bir temanın token → değer eşlemesi. */
38
- export type UiThemeTokens = Partial<Record<UiToken, string>>;
39
- /** Bilgi yoğunluğu. `default` vitrin, `compact` operasyon paneli. */
40
- export type UiDensity = 'default' | 'compact';
41
- /** Ölçü ezmeleri. */
42
- export type UiMetrics = Partial<Record<UiMetricToken, string>>;
43
- /** Ölçü token adları — `METRIC_TOKENS`ten türetilir. */
44
- export type UiMetricToken = keyof typeof METRIC_TOKENS;
45
- /** Token adları — `LIGHT_THEME`den türetilir, elle listelenmez. */
46
- export type UiToken = keyof typeof LIGHT_THEME;
12
+ export type UiColorPreference = ThemePreference;
13
+ /** The RESOLVED theme — the one actually drawn. The same union as design's `ThemeName`. */
14
+ export type UiColorScheme = ThemeName;
47
15
  export type UiContextValue = {
48
16
  /** Tüketicinin yönlendiricisi (`next/link`, `react-router`ın `Link`i…). */
49
17
  linkComponent?: UiLinkComponent;
50
- /** Uygulanan tema ezmeleri. */
51
- theme?: UiThemeConfig;
52
18
  /**
53
19
  * Arayüz metinleri.
54
20
  * ⚠ Referans bir dönem `theme/labels.ts`yi gösteriyordu; o dosya yalnızca tek satırlık bir başlık
@@ -198,14 +164,6 @@ export type UiLabels = Partial<{
198
164
  scale: Record<1 | 2 | 3 | 4 | 5, string>;
199
165
  }>;
200
166
  }>;
201
- export type InitUiOptions = Partial<{
202
- /** Tema ve ölçü ezmeleri. */
203
- theme: UiThemeConfig;
204
- /** Başlangıç şeması. */
205
- colorScheme: UiColorScheme;
206
- /** Bilgi yoğunluğu. */
207
- density: UiDensity;
208
- }>;
209
167
  export type UiThemeState = {
210
168
  /**
211
169
  * ÇÖZÜLMÜŞ tema — ekranda çizili olan. `preference` `system` iken bu alan işletim sisteminin o
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@handijit/ui",
3
- "version": "1.0.0",
4
- "description": "Accessible, theme-driven React component library built on SCSS Modules. Bootstrap Icons for shell iconography, two built-in themes and a fully overridable design-token contract.",
3
+ "version": "2.0.0",
4
+ "description": "Accessible React component library on SCSS Modules, themed by @handijit/design: light and dark from one set of --hd-* tokens, a CSP-ready theme boot script, and Bootstrap Icons for iconography.",
5
5
  "author": "Ahmet ilhan <ahmetilhan.dev@gmail.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -416,9 +416,8 @@
416
416
  ],
417
417
  "scripts": {
418
418
  "prepare": "git rev-parse --git-dir >/dev/null 2>&1 && git config core.hooksPath .githooks || true",
419
- "tokens": "node scripts/build-palette.mjs && node scripts/build-tokens.mjs",
420
- "build": "npm run tokens && vite build && vite build --config vite.chat.config.ts && vite build --config vite.charts.config.ts && tsc -p tsconfig.subentries.json && node scripts/build-scss.mjs && node scripts/build-exports.mjs --check",
421
- "dev": "npm run tokens && vite build --watch",
419
+ "build": "vite build && vite build --config vite.chat.config.ts && vite build --config vite.charts.config.ts && tsc -p tsconfig.subentries.json && node scripts/build-scss.mjs && node scripts/build-exports.mjs --check",
420
+ "dev": "vite build --watch",
422
421
  "typecheck": "tsc --noEmit",
423
422
  "lint": "eslint src __tests__ scripts --max-warnings 0 && stylelint \"src/**/*.scss\"",
424
423
  "format": "prettier --write \"src/**/*.{ts,tsx,scss}\" \"playground/**/*.{ts,tsx,css}\" \"__tests__/**/*.{ts,tsx}\"",
@@ -433,22 +432,23 @@
433
432
  "test:device": "playwright test --project=ios --project=android",
434
433
  "test:device:install": "playwright install webkit chromium",
435
434
  "playground": "vite --config playground/vite.config.ts",
436
- "playground:build": "npm run tokens && vite build --config playground/vite.config.ts",
435
+ "playground:build": "vite build --config playground/vite.config.ts",
437
436
  "size": "npm run build && size-limit",
438
- "verify": "npm run check:palette && npm run tokens && npm run check:contrast && npm run typecheck && npm run lint && npm run test:coverage && npm run build && npm run check:api && npm run check:animations && size-limit",
439
- "check:palette": "node scripts/build-palette.mjs --check",
437
+ "verify": "npm run check:contrast && npm run typecheck && npm run lint && npm run test:coverage && npm run build && npm run check:api && npm run check:animations && size-limit",
440
438
  "check:exports": "node scripts/build-exports.mjs --check",
441
439
  "exports": "node scripts/build-exports.mjs"
442
440
  },
443
441
  "peerDependencies": {
444
- "@handijit/utils": "^1.0.0",
442
+ "@handijit/design": "^1.0.0",
443
+ "@handijit/utils": "^2.0.0",
445
444
  "react": ">=18",
446
445
  "react-bootstrap-icons": ">=1.11.0",
447
446
  "react-dom": ">=18"
448
447
  },
449
448
  "devDependencies": {
450
449
  "@eslint/js": "^9.18.0",
451
- "@handijit/utils": "^1.0.0",
450
+ "@handijit/design": "^1.0.0",
451
+ "@handijit/utils": "^2.0.0",
452
452
  "@playwright/test": "^1.62.1",
453
453
  "@size-limit/preset-small-lib": "^13.0.3",
454
454
  "@testing-library/jest-dom": "^6.9.1",
@@ -1,119 +0,0 @@
1
- $page: var(--ui-page);
2
- $surface: var(--ui-surface);
3
- $surface-2: var(--ui-surface-2);
4
- $surface-3: var(--ui-surface-3);
5
- $surface-inset: var(--ui-surface-inset);
6
- $border: var(--ui-border);
7
- $border-strong: var(--ui-border-strong);
8
- $text: var(--ui-text);
9
- $text-2: var(--ui-text-2);
10
- $text-3: var(--ui-text-3);
11
- $shell: var(--ui-shell);
12
- $shell-2: var(--ui-shell-2);
13
- $shell-3: var(--ui-shell-3);
14
- $on-shell: var(--ui-on-shell);
15
- $on-shell-2: var(--ui-on-shell-2);
16
- $on-shell-danger: var(--ui-on-shell-danger);
17
- $shell-line: var(--ui-shell-line);
18
- $action: var(--ui-action);
19
- $action-hover: var(--ui-action-hover);
20
- $action-active: var(--ui-action-active);
21
- $on-action: var(--ui-on-action);
22
- $action-line: var(--ui-action-line);
23
- $action-soft: var(--ui-action-soft);
24
- $on-action-soft: var(--ui-on-action-soft);
25
- $cart: var(--ui-cart);
26
- $cart-hover: var(--ui-cart-hover);
27
- $cart-active: var(--ui-cart-active);
28
- $cart-soft: var(--ui-cart-soft);
29
- $on-cart: var(--ui-on-cart);
30
- $selected: var(--ui-selected);
31
- $selected-hover: var(--ui-selected-hover);
32
- $selected-active: var(--ui-selected-active);
33
- $on-selected: var(--ui-on-selected);
34
- $selected-tint: var(--ui-selected-tint);
35
- $selected-line: var(--ui-selected-line);
36
- $link: var(--ui-link);
37
- $link-hover: var(--ui-link-hover);
38
- $ok-bg: var(--ui-ok-bg);
39
- $ok-fg: var(--ui-ok-fg);
40
- $ok-line: var(--ui-ok-line);
41
- $warn-bg: var(--ui-warn-bg);
42
- $warn-fg: var(--ui-warn-fg);
43
- $warn-line: var(--ui-warn-line);
44
- $off-bg: var(--ui-off-bg);
45
- $off-fg: var(--ui-off-fg);
46
- $off-line: var(--ui-off-line);
47
- $bad-bg: var(--ui-bad-bg);
48
- $bad-fg: var(--ui-bad-fg);
49
- $bad-line: var(--ui-bad-line);
50
- $oem-bg: var(--ui-oem-bg);
51
- $oem-fg: var(--ui-oem-fg);
52
- $oem-line: var(--ui-oem-line);
53
- $alt-bg: var(--ui-alt-bg);
54
- $alt-fg: var(--ui-alt-fg);
55
- $alt-line: var(--ui-alt-line);
56
- $sale-bg: var(--ui-sale-bg);
57
- $sale-fg: var(--ui-sale-fg);
58
- $red-accent: var(--ui-red-accent);
59
- $green-accent: var(--ui-green-accent);
60
- $green-accent-hover: var(--ui-green-accent-hover);
61
- $on-green: var(--ui-on-green);
62
- $star: var(--ui-star);
63
- $danger-solid: var(--ui-danger-solid);
64
- $danger-solid-hover: var(--ui-danger-solid-hover);
65
- $on-danger: var(--ui-on-danger);
66
- $nav-bg: var(--ui-nav-bg);
67
- $nav-bg-2: var(--ui-nav-bg-2);
68
- $nav-fg: var(--ui-nav-fg);
69
- $nav-fg-2: var(--ui-nav-fg-2);
70
- $nav-fg-3: var(--ui-nav-fg-3);
71
- $nav-line: var(--ui-nav-line);
72
- $nav-line-strong: var(--ui-nav-line-strong);
73
- $nav-hover: var(--ui-nav-hover);
74
- $footer-bg: var(--ui-footer-bg);
75
- $band-bg: var(--ui-band-bg);
76
- $band-fg: var(--ui-band-fg);
77
- $band-fg-2: var(--ui-band-fg-2);
78
- $band-fg-3: var(--ui-band-fg-3);
79
- $band-accent: var(--ui-band-accent);
80
- $band-line: var(--ui-band-line);
81
- $band-hover: var(--ui-band-hover);
82
- $shadow-xs: var(--ui-shadow-xs);
83
- $shadow-sm: var(--ui-shadow-sm);
84
- $shadow-md: var(--ui-shadow-md);
85
- $shadow-lg: var(--ui-shadow-lg);
86
- $shadow-xl: var(--ui-shadow-xl);
87
- $shadow-up: var(--ui-shadow-up);
88
- $ring: var(--ui-ring);
89
- $ring-color: var(--ui-ring-color);
90
- $ring-danger: var(--ui-ring-danger);
91
- $ring-ok: var(--ui-ring-ok);
92
- $scrim: var(--ui-scrim);
93
- $scrim-soft: var(--ui-scrim-soft);
94
- $glass: var(--ui-glass);
95
- $glass-solid: var(--ui-glass-solid);
96
- $on-scrim: var(--ui-on-scrim);
97
- $skeleton-a: var(--ui-skeleton-a);
98
- $skeleton-b: var(--ui-skeleton-b);
99
- $track: var(--ui-track);
100
- $media-bg: var(--ui-media-bg);
101
- $glow-1: var(--ui-glow-1);
102
- $glow-2: var(--ui-glow-2);
103
- $glow-cart: var(--ui-glow-cart);
104
- $cat-1: var(--ui-cat-1);
105
- $cat-2: var(--ui-cat-2);
106
- $cat-3: var(--ui-cat-3);
107
- $cat-4: var(--ui-cat-4);
108
- $cat-5: var(--ui-cat-5);
109
- $series-1: var(--ui-series-1);
110
- $series-2: var(--ui-series-2);
111
-
112
- $font-heading: var(--ui-font-heading);
113
- $font-body: var(--ui-font-body);
114
- $font-mono: var(--ui-font-mono);
115
- $font-ui: $font-body;
116
-
117
- $header-offset: var(--ui-header-height, 0px);
118
- $sheet-inset-bottom: var(--ui-sheet-inset-bottom, 0px);
119
- $sheet-height: var(--ui-sheet-height, 100dvh);
@@ -1,49 +0,0 @@
1
- $radius-xs: var(--ui-radius-xs);
2
- $radius-sm: var(--ui-radius-sm);
3
- $radius-md: var(--ui-radius-md);
4
- $radius-lg: var(--ui-radius-lg);
5
- $radius-xl: var(--ui-radius-xl);
6
- $radius-pill: var(--ui-radius-pill);
7
- $type-scale: var(--ui-type-scale);
8
- $space-scale: var(--ui-space-scale);
9
- $space-0: var(--ui-space-0);
10
- $space-1: var(--ui-space-1);
11
- $space-2: var(--ui-space-2);
12
- $space-3: var(--ui-space-3);
13
- $space-4: var(--ui-space-4);
14
- $space-5: var(--ui-space-5);
15
- $space-6: var(--ui-space-6);
16
- $space-7: var(--ui-space-7);
17
- $space-8: var(--ui-space-8);
18
- $space-9: var(--ui-space-9);
19
- $font-size-2xs: var(--ui-font-size-2xs);
20
- $font-size-xs: var(--ui-font-size-xs);
21
- $font-size-sm: var(--ui-font-size-sm);
22
- $font-size-base: var(--ui-font-size-base);
23
- $font-size-body: var(--ui-font-size-body);
24
- $font-size-lg: var(--ui-font-size-lg);
25
- $font-size-xl: var(--ui-font-size-xl);
26
- $font-size-2xl: var(--ui-font-size-2xl);
27
- $font-size-3xl: var(--ui-font-size-3xl);
28
- $font-size-4xl: var(--ui-font-size-4xl);
29
- $font-size-control: var(--ui-font-size-control);
30
- $leading-none: var(--ui-leading-none);
31
- $leading-tight: var(--ui-leading-tight);
32
- $leading-snug: var(--ui-leading-snug);
33
- $leading-normal: var(--ui-leading-normal);
34
- $leading-relaxed: var(--ui-leading-relaxed);
35
- $icon-xs: var(--ui-icon-xs);
36
- $icon-sm: var(--ui-icon-sm);
37
- $icon-md: var(--ui-icon-md);
38
- $icon-lg: var(--ui-icon-lg);
39
- $icon-xl: var(--ui-icon-xl);
40
- $duration-instant: var(--ui-duration-instant);
41
- $duration-fast: var(--ui-duration-fast);
42
- $duration-normal: var(--ui-duration-normal);
43
- $duration-slow: var(--ui-duration-slow);
44
- $ease-out: var(--ui-ease-out);
45
- $ease-in-out: var(--ui-ease-in-out);
46
- $ease-spring: var(--ui-ease-spring);
47
- $duration-spin: var(--ui-duration-spin);
48
- $duration-shimmer: var(--ui-duration-shimmer);
49
- $duration-pulse: var(--ui-duration-pulse);