@osdk/react-components 0.19.0-main-b5d7e7b9644f6f9d2b3771c6fafca28cd20a3cbb → 0.19.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 (112) hide show
  1. package/CHANGELOG.md +3 -11
  2. package/build/browser/object-table/EditableCell.module.css +2 -2
  3. package/build/browser/public/experimental/theme.js +19 -0
  4. package/build/browser/public/experimental/theme.js.map +1 -0
  5. package/build/browser/public/experimental.js +1 -0
  6. package/build/browser/public/experimental.js.map +1 -1
  7. package/build/browser/styles.css +10 -99
  8. package/build/browser/theme/OsdkThemeContext.js +19 -0
  9. package/build/browser/theme/OsdkThemeContext.js.map +1 -0
  10. package/build/browser/theme/OsdkThemeProvider.js +74 -0
  11. package/build/browser/theme/OsdkThemeProvider.js.map +1 -0
  12. package/build/browser/theme/types.js +2 -0
  13. package/build/browser/theme/types.js.map +1 -0
  14. package/build/browser/theme/useOsdkTheme.js +40 -0
  15. package/build/browser/theme/useOsdkTheme.js.map +1 -0
  16. package/build/browser/theme/useSystemTheme.js +45 -0
  17. package/build/browser/theme/useSystemTheme.js.map +1 -0
  18. package/build/browser/tokens/base-tokens/dark.css +8 -99
  19. package/build/browser/util/UserAgent.js +1 -1
  20. package/build/browser/util/UserAgent.js.map +1 -1
  21. package/build/cjs/chunk-2YA74OKB.cjs +86 -0
  22. package/build/cjs/chunk-2YA74OKB.cjs.map +1 -0
  23. package/build/cjs/{chunk-74XNR3YF.cjs → chunk-3OUALM3K.cjs} +4 -4
  24. package/build/cjs/{chunk-74XNR3YF.cjs.map → chunk-3OUALM3K.cjs.map} +1 -1
  25. package/build/cjs/chunk-3Y4W37E3.cjs +11 -0
  26. package/build/cjs/{chunk-G2AYUCKB.cjs.map → chunk-3Y4W37E3.cjs.map} +1 -1
  27. package/build/cjs/chunk-62DGPKOC.cjs +11 -0
  28. package/build/cjs/{chunk-6Z2CEPQP.cjs.map → chunk-62DGPKOC.cjs.map} +1 -1
  29. package/build/cjs/{chunk-BIPWKG5Q.cjs → chunk-6XRF4IAL.cjs} +4 -4
  30. package/build/cjs/{chunk-BIPWKG5Q.cjs.map → chunk-6XRF4IAL.cjs.map} +1 -1
  31. package/build/cjs/chunk-774FGQHO.cjs +11 -0
  32. package/build/cjs/{chunk-O5LBEGUH.cjs.map → chunk-774FGQHO.cjs.map} +1 -1
  33. package/build/cjs/{chunk-BBSLIWGB.cjs → chunk-BXCHISUQ.cjs} +3 -3
  34. package/build/cjs/chunk-BXCHISUQ.cjs.map +1 -0
  35. package/build/cjs/{chunk-B26H5TLV.cjs → chunk-DKPG7O4B.cjs} +4 -4
  36. package/build/cjs/{chunk-B26H5TLV.cjs.map → chunk-DKPG7O4B.cjs.map} +1 -1
  37. package/build/cjs/{chunk-5ZI6OPSJ.cjs → chunk-FIAYYZHY.cjs} +5 -5
  38. package/build/cjs/{chunk-5ZI6OPSJ.cjs.map → chunk-FIAYYZHY.cjs.map} +1 -1
  39. package/build/cjs/{chunk-NFFAHI3U.cjs → chunk-L6QDNMMG.cjs} +4 -4
  40. package/build/cjs/chunk-L6QDNMMG.cjs.map +1 -0
  41. package/build/cjs/{chunk-GABRYORZ.cjs → chunk-P7R4RWMU.cjs} +4 -4
  42. package/build/cjs/{chunk-GABRYORZ.cjs.map → chunk-P7R4RWMU.cjs.map} +1 -1
  43. package/build/cjs/{chunk-NXXHABK7.cjs → chunk-QOI2FQSL.cjs} +4 -4
  44. package/build/cjs/{chunk-NXXHABK7.cjs.map → chunk-QOI2FQSL.cjs.map} +1 -1
  45. package/build/cjs/chunk-S25XCKOA.cjs +11 -0
  46. package/build/cjs/{chunk-C6IVBY3E.cjs.map → chunk-S25XCKOA.cjs.map} +1 -1
  47. package/build/cjs/chunk-SLHKSOQC.cjs +11 -0
  48. package/build/cjs/{chunk-5NPRZBFO.cjs.map → chunk-SLHKSOQC.cjs.map} +1 -1
  49. package/build/cjs/public/experimental/action-form.cjs +4 -4
  50. package/build/cjs/public/experimental/document-viewer.cjs +5 -5
  51. package/build/cjs/public/experimental/email-viewer.cjs +3 -3
  52. package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
  53. package/build/cjs/public/experimental/filter-list.cjs +13 -13
  54. package/build/cjs/public/experimental/image-viewer.cjs +3 -3
  55. package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
  56. package/build/cjs/public/experimental/object-table.cjs +8 -8
  57. package/build/cjs/public/experimental/object-table.css +2 -2
  58. package/build/cjs/public/experimental/object-table.css.map +1 -1
  59. package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
  60. package/build/cjs/public/experimental/theme.cjs +17 -0
  61. package/build/cjs/public/experimental/theme.cjs.map +1 -0
  62. package/build/cjs/public/experimental/theme.d.cts +88 -0
  63. package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
  64. package/build/cjs/public/experimental/video-viewer.cjs +3 -3
  65. package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
  66. package/build/cjs/public/experimental.cjs +63 -54
  67. package/build/cjs/public/experimental.css +2 -2
  68. package/build/cjs/public/experimental.css.map +1 -1
  69. package/build/cjs/public/experimental.d.cts +1 -0
  70. package/build/esm/object-table/EditableCell.module.css +2 -2
  71. package/build/esm/public/experimental/theme.js +19 -0
  72. package/build/esm/public/experimental/theme.js.map +1 -0
  73. package/build/esm/public/experimental.js +1 -0
  74. package/build/esm/public/experimental.js.map +1 -1
  75. package/build/esm/theme/OsdkThemeContext.js +19 -0
  76. package/build/esm/theme/OsdkThemeContext.js.map +1 -0
  77. package/build/esm/theme/OsdkThemeProvider.js +74 -0
  78. package/build/esm/theme/OsdkThemeProvider.js.map +1 -0
  79. package/build/esm/theme/types.js +2 -0
  80. package/build/esm/theme/types.js.map +1 -0
  81. package/build/esm/theme/useOsdkTheme.js +40 -0
  82. package/build/esm/theme/useOsdkTheme.js.map +1 -0
  83. package/build/esm/theme/useSystemTheme.js +45 -0
  84. package/build/esm/theme/useSystemTheme.js.map +1 -0
  85. package/build/esm/tokens/base-tokens/dark.css +8 -99
  86. package/build/esm/util/UserAgent.js +1 -1
  87. package/build/esm/util/UserAgent.js.map +1 -1
  88. package/build/types/public/experimental/theme.d.ts +3 -0
  89. package/build/types/public/experimental/theme.d.ts.map +1 -0
  90. package/build/types/public/experimental.d.ts +1 -0
  91. package/build/types/public/experimental.d.ts.map +1 -1
  92. package/build/types/theme/OsdkThemeContext.d.ts +3 -0
  93. package/build/types/theme/OsdkThemeContext.d.ts.map +1 -0
  94. package/build/types/theme/OsdkThemeProvider.d.ts +45 -0
  95. package/build/types/theme/OsdkThemeProvider.d.ts.map +1 -0
  96. package/build/types/theme/types.d.ts +25 -0
  97. package/build/types/theme/types.d.ts.map +1 -0
  98. package/build/types/theme/useOsdkTheme.d.ts +16 -0
  99. package/build/types/theme/useOsdkTheme.d.ts.map +1 -0
  100. package/build/types/theme/useSystemTheme.d.ts +7 -0
  101. package/build/types/theme/useSystemTheme.d.ts.map +1 -0
  102. package/docs/CSSVariables.md +4 -16
  103. package/docs/OsdkThemeProvider.md +239 -0
  104. package/docs/Prerequisites.md +23 -0
  105. package/package.json +17 -8
  106. package/build/cjs/chunk-5NPRZBFO.cjs +0 -11
  107. package/build/cjs/chunk-6Z2CEPQP.cjs +0 -11
  108. package/build/cjs/chunk-BBSLIWGB.cjs.map +0 -1
  109. package/build/cjs/chunk-C6IVBY3E.cjs +0 -11
  110. package/build/cjs/chunk-G2AYUCKB.cjs +0 -11
  111. package/build/cjs/chunk-NFFAHI3U.cjs.map +0 -1
  112. package/build/cjs/chunk-O5LBEGUH.cjs +0 -11
package/CHANGELOG.md CHANGED
@@ -1,13 +1,9 @@
1
1
  # @osdk/react-components
2
2
 
3
- ## 0.19.0-main-b5d7e7b9644f6f9d2b3771c6fafca28cd20a3cbb
3
+ ## 0.19.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - dad4c44: Support disabled fields in ActionForm field definitions.
8
-
9
- ### Patch Changes
10
-
11
7
  - cffbe7c: Add ActionForm guide links and document unsupported ActionForm features.
12
8
  - a218b1a: right-align Clear all in FilterList exclude row
13
9
  - b5d7e7b: fix filter-list "no value" baseline and range hyphen vertical alignment
@@ -25,12 +21,8 @@
25
21
  - b3229eb: Fix ObjectTable overlay menus and dialogs inside drawers and dialogs.
26
22
  - 1760597: Change experimental labels to beta
27
23
  - 64652ed: Fix `ObjectTable` pinned columns rendering with a transparent background, causing scrolled cells from non-pinned columns to bleed through and overlap pinned text. Regression introduced in v0.18.0 by the `--osdk-table-cell-bg` token — declaring `--osdk-table-cell-bg: inherit` at `:root` silently resolved to the guaranteed-invalid value (no parent to inherit from), so `var(--osdk-table-cell-bg)` fell back to `transparent`. The default is now expressed as a `var()` fallback (`var(--osdk-table-cell-bg, inherit)`) so unset cells inherit the row background while consumer overrides still apply.
28
- - Updated dependencies [198f219]
29
- - Updated dependencies [ef156b6]
30
- - Updated dependencies [8290dd7]
31
- - @osdk/api@2.23.0-main-b5d7e7b9644f6f9d2b3771c6fafca28cd20a3cbb
32
- - @osdk/client@2.23.0-main-b5d7e7b9644f6f9d2b3771c6fafca28cd20a3cbb
33
- - @osdk/react@2.23.0-main-b5d7e7b9644f6f9d2b3771c6fafca28cd20a3cbb
24
+ - 4c0bdaf: Add `<OsdkThemeProvider>` and `useOsdkTheme` (from `@osdk/react-components/experimental/theme`) for opt-in theming.
25
+ - dad4c44: Support disabled fields in ActionForm field definitions.
34
26
 
35
27
  ## 0.18.0
36
28
 
@@ -52,8 +52,8 @@
52
52
 
53
53
  /* Match the text-input editable cell background so the row reads as a
54
54
  single field strip instead of mixed surface colors. */
55
- --osdk-select-trigger-bg: var(--osdk-table-cell-editable-bg);
56
- --osdk-combobox-trigger-bg: var(--osdk-table-cell-editable-bg);
55
+ --osdk-select-trigger-bg: var(--osdk-table-cell-input-bg);
56
+ --osdk-combobox-trigger-bg: var(--osdk-table-cell-input-bg);
57
57
 
58
58
  --osdk-combobox-input-padding: var(--osdk-surface-spacing)
59
59
  calc(var(--osdk-surface-spacing) * 3);
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export { OsdkThemeProvider } from "../../theme/OsdkThemeProvider.js";
18
+ export { useOsdkTheme } from "../../theme/useOsdkTheme.js";
19
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","names":["OsdkThemeProvider","useOsdkTheme"],"sources":["theme.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport {\n OsdkThemeProvider,\n type OsdkThemeProviderProps,\n} from \"../../theme/OsdkThemeProvider.js\";\nexport type {\n OsdkThemeContextValue,\n OsdkThemeMode,\n ResolvedOsdkTheme,\n} from \"../../theme/types.js\";\nexport { useOsdkTheme } from \"../../theme/useOsdkTheme.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,iBAAiB,QAEZ,kCAAkC;AAMzC,SAASC,YAAY,QAAQ,6BAA6B","ignoreList":[]}
@@ -23,6 +23,7 @@ export * from "./experimental/image-viewer.js";
23
23
  export * from "./experimental/markdown-renderer.js";
24
24
  export * from "./experimental/object-table.js";
25
25
  export * from "./experimental/pdf-viewer.js";
26
+ export * from "./experimental/theme.js";
26
27
  export * from "./experimental/tiff-renderer.js";
27
28
  export * from "./experimental/video-viewer.js";
28
29
  export * from "./experimental/xml-viewer.js";
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":[],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from \"./experimental/action-form.js\";\nexport * from \"./experimental/document-viewer.js\";\nexport * from \"./experimental/email-viewer.js\";\nexport * from \"./experimental/excel-viewer.js\";\nexport * from \"./experimental/filter-list.js\";\nexport * from \"./experimental/image-viewer.js\";\nexport * from \"./experimental/markdown-renderer.js\";\nexport * from \"./experimental/object-table.js\";\nexport * from \"./experimental/pdf-viewer.js\";\nexport * from \"./experimental/tiff-renderer.js\";\nexport * from \"./experimental/video-viewer.js\";\nexport * from \"./experimental/xml-viewer.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,+BAA+B;AAC7C,cAAc,mCAAmC;AACjD,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,+BAA+B;AAC7C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,gCAAgC;AAC9C,cAAc,8BAA8B;AAC5C,cAAc,iCAAiC;AAC/C,cAAc,gCAAgC;AAC9C,cAAc,8BAA8B","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":[],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from \"./experimental/action-form.js\";\nexport * from \"./experimental/document-viewer.js\";\nexport * from \"./experimental/email-viewer.js\";\nexport * from \"./experimental/excel-viewer.js\";\nexport * from \"./experimental/filter-list.js\";\nexport * from \"./experimental/image-viewer.js\";\nexport * from \"./experimental/markdown-renderer.js\";\nexport * from \"./experimental/object-table.js\";\nexport * from \"./experimental/pdf-viewer.js\";\nexport * from \"./experimental/theme.js\";\nexport * from \"./experimental/tiff-renderer.js\";\nexport * from \"./experimental/video-viewer.js\";\nexport * from \"./experimental/xml-viewer.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,+BAA+B;AAC7C,cAAc,mCAAmC;AACjD,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,+BAA+B;AAC7C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,gCAAgC;AAC9C,cAAc,8BAA8B;AAC5C,cAAc,yBAAyB;AACvC,cAAc,iCAAiC;AAC/C,cAAc,gCAAgC;AAC9C,cAAc,8BAA8B","ignoreList":[]}
@@ -487,20 +487,13 @@
487
487
  }
488
488
  }
489
489
  /*
490
- * Dark theme overrides for OSDK semantic tokens. Activated by any of:
491
- * - `prefers-color-scheme: dark` (OS-level, matches Foundry custom-widgets)
492
- * - `[data-bp-color-scheme="dark"]` / `.bp6-dark` (Blueprint convention)
493
- * - `[data-theme="dark"]` (Tailwind/Primer/Storybook toolbar convention;
494
- * lets Storybook import this file directly instead of duplicating)
490
+ * Dark theme overrides for OSDK semantic tokens. Activated by `[data-bp-color-scheme="dark"]`
491
+ * written by `<OsdkThemeProvider>` onto the document root, matching Blueprint's own convention so the
492
+ * theme also applies to portaled overlays. Keeping `.bp6-dark` as well to match Blueprint's class-based
493
+ * variant of the same convention.
495
494
  *
496
495
  * Source-of-truth dark values live in `--osdk-dark-*` helpers at `:root`
497
- * (private — do not consume directly). The three activation blocks below
498
- * map those helpers onto the public `--bp-*` / `--osdk-*` tokens.
499
- *
500
- * `[data-bp-color-scheme="dark"], .bp6-dark` only re-maps `--osdk-*` —
501
- * Blueprint flips `--bp-*` itself under those selectors. The other two
502
- * blocks also flip `--bp-*` because Blueprint doesn't fire there.
503
- *
496
+ * (private — do not consume directly).
504
497
  */
505
498
  :root {
506
499
  /* --bp-* dark values (single source of truth) */
@@ -511,16 +504,13 @@
511
504
  0px 0px 10px 0px rgba(0, 0, 0, 0.2);
512
505
  --osdk-dark-bp-surface-shadow-1:
513
506
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
514
- 0px 1px 10px 0px rgba(0, 0, 0, 0.2),
515
- 0px 1px 10px -1px rgba(0, 0, 0, 0.2);
507
+ 0px 1px 10px 0px rgba(0, 0, 0, 0.2), 0px 1px 10px -1px rgba(0, 0, 0, 0.2);
516
508
  --osdk-dark-bp-surface-shadow-2:
517
509
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
518
- 0px 4px 6px -4px rgba(0, 0, 0, 0.5),
519
- 0px 10px 30px -5px rgba(0, 0, 0, 0.5);
510
+ 0px 4px 6px -4px rgba(0, 0, 0, 0.5), 0px 10px 30px -5px rgba(0, 0, 0, 0.5);
520
511
  --osdk-dark-bp-surface-shadow-3:
521
512
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
522
- 0px 20px 25px -5px rgba(0, 0, 0, 0.3),
523
- 0px 10px 30px -5px rgba(0, 0, 0, 0.3);
513
+ 0px 20px 25px -5px rgba(0, 0, 0, 0.3), 0px 10px 30px -5px rgba(0, 0, 0, 0.3);
524
514
  --osdk-dark-bp-surface-shadow-4:
525
515
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
526
516
  0px 25px 60px -12px rgba(0, 0, 0, 0.85);
@@ -554,85 +544,6 @@
554
544
  var(--osdk-background-primary)
555
545
  );
556
546
  }
557
- @media (prefers-color-scheme: dark) {
558
- :root {
559
- /* --bp-* flips (Blueprint doesn't respond to prefers-color-scheme) */
560
- --bp-surface-border-color-default: var(--osdk-dark-bp-surface-border-color-default);
561
- --bp-surface-border-color-strong: var(--osdk-dark-bp-surface-border-color-strong);
562
- --bp-surface-shadow-0: var(--osdk-dark-bp-surface-shadow-0);
563
- --bp-surface-shadow-1: var(--osdk-dark-bp-surface-shadow-1);
564
- --bp-surface-shadow-2: var(--osdk-dark-bp-surface-shadow-2);
565
- --bp-surface-shadow-3: var(--osdk-dark-bp-surface-shadow-3);
566
- --bp-surface-shadow-4: var(--osdk-dark-bp-surface-shadow-4);
567
- --bp-surface-color-code: var(--osdk-dark-bp-surface-color-code);
568
- --bp-surface-background-color-default-rest: var(--osdk-dark-bp-surface-background-color-default-rest);
569
- --bp-surface-background-color-default-hover: var(--osdk-dark-bp-surface-background-color-default-hover);
570
- --bp-surface-background-color-default-active: var(--osdk-dark-bp-surface-background-color-default-active);
571
- --bp-surface-background-color-default-disabled: var(--osdk-dark-bp-surface-background-color-default-disabled);
572
- --bp-typography-color-default-rest: var(--osdk-dark-bp-typography-color-default-rest);
573
- --bp-typography-color-default-hover: var(--osdk-dark-bp-typography-color-default-hover);
574
- --bp-typography-color-default-active: var(--osdk-dark-bp-typography-color-default-active);
575
-
576
- /* --osdk-* overrides */
577
- --osdk-background-primary: var(--osdk-dark-background-primary);
578
- --osdk-background-secondary: var(--osdk-dark-background-secondary);
579
- --osdk-background-tertiary: var(--osdk-dark-background-tertiary);
580
- --osdk-typography-color-muted: var(--osdk-dark-typography-color-muted);
581
- --osdk-intent-default-rest: var(--osdk-dark-intent-default-rest);
582
- --osdk-intent-default-foreground: var(--osdk-dark-intent-default-foreground);
583
- --osdk-button-secondary-bg: var(--osdk-dark-button-secondary-bg);
584
- --osdk-button-secondary-color: var(--osdk-dark-button-secondary-color);
585
- --osdk-table-row-bg-default: var(--osdk-dark-table-row-bg-default);
586
- --osdk-table-header-bg: var(--osdk-dark-table-header-bg);
587
- --osdk-table-header-color: var(--osdk-dark-table-header-color);
588
- --osdk-table-cell-color: var(--osdk-dark-table-cell-color);
589
- --osdk-table-header-menu-color: var(--osdk-dark-table-header-menu-color);
590
- --osdk-table-border-color: var(--osdk-dark-table-border-color);
591
- --osdk-table-cell-divider: var(--osdk-table-border-width) solid
592
- var(--osdk-table-border-color);
593
- --osdk-table-row-bg-hover: var(--osdk-dark-table-row-bg-hover);
594
- --osdk-table-row-bg-active: var(--osdk-dark-table-row-bg-hover);
595
- }
596
- }
597
- [data-theme="dark"] {
598
- /* --bp-* flips (Blueprint doesn't respond to data-theme).
599
- Mirrors the @media (prefers-color-scheme: dark) block above. */
600
- --bp-surface-border-color-default: var(--osdk-dark-bp-surface-border-color-default);
601
- --bp-surface-border-color-strong: var(--osdk-dark-bp-surface-border-color-strong);
602
- --bp-surface-shadow-0: var(--osdk-dark-bp-surface-shadow-0);
603
- --bp-surface-shadow-1: var(--osdk-dark-bp-surface-shadow-1);
604
- --bp-surface-shadow-2: var(--osdk-dark-bp-surface-shadow-2);
605
- --bp-surface-shadow-3: var(--osdk-dark-bp-surface-shadow-3);
606
- --bp-surface-shadow-4: var(--osdk-dark-bp-surface-shadow-4);
607
- --bp-surface-color-code: var(--osdk-dark-bp-surface-color-code);
608
- --bp-surface-background-color-default-rest: var(--osdk-dark-bp-surface-background-color-default-rest);
609
- --bp-surface-background-color-default-hover: var(--osdk-dark-bp-surface-background-color-default-hover);
610
- --bp-surface-background-color-default-active: var(--osdk-dark-bp-surface-background-color-default-active);
611
- --bp-surface-background-color-default-disabled: var(--osdk-dark-bp-surface-background-color-default-disabled);
612
- --bp-typography-color-default-rest: var(--osdk-dark-bp-typography-color-default-rest);
613
- --bp-typography-color-default-hover: var(--osdk-dark-bp-typography-color-default-hover);
614
- --bp-typography-color-default-active: var(--osdk-dark-bp-typography-color-default-active);
615
-
616
- /* --osdk-* overrides */
617
- --osdk-background-primary: var(--osdk-dark-background-primary);
618
- --osdk-background-secondary: var(--osdk-dark-background-secondary);
619
- --osdk-background-tertiary: var(--osdk-dark-background-tertiary);
620
- --osdk-typography-color-muted: var(--osdk-dark-typography-color-muted);
621
- --osdk-intent-default-rest: var(--osdk-dark-intent-default-rest);
622
- --osdk-intent-default-foreground: var(--osdk-dark-intent-default-foreground);
623
- --osdk-button-secondary-bg: var(--osdk-dark-button-secondary-bg);
624
- --osdk-button-secondary-color: var(--osdk-dark-button-secondary-color);
625
- --osdk-table-row-bg-default: var(--osdk-dark-table-row-bg-default);
626
- --osdk-table-header-bg: var(--osdk-dark-table-header-bg);
627
- --osdk-table-header-color: var(--osdk-dark-table-header-color);
628
- --osdk-table-cell-color: var(--osdk-dark-table-cell-color);
629
- --osdk-table-header-menu-color: var(--osdk-dark-table-header-menu-color);
630
- --osdk-table-border-color: var(--osdk-dark-table-border-color);
631
- --osdk-table-cell-divider: var(--osdk-table-border-width) solid
632
- var(--osdk-table-border-color);
633
- --osdk-table-row-bg-hover: var(--osdk-dark-table-row-bg-hover);
634
- --osdk-table-row-bg-active: var(--osdk-dark-table-row-bg-hover);
635
- }
636
547
  [data-bp-color-scheme="dark"],
637
548
  .bp6-dark {
638
549
  /* Blueprint already flips --bp-* under these selectors, so any --osdk-*
@@ -8070,8 +7981,8 @@
8070
7981
 
8071
7982
  /* Match the text-input editable cell background so the row reads as a
8072
7983
  single field strip instead of mixed surface colors. */
8073
- --osdk-select-trigger-bg: var(--osdk-table-cell-editable-bg);
8074
- --osdk-combobox-trigger-bg: var(--osdk-table-cell-editable-bg);
7984
+ --osdk-select-trigger-bg: var(--osdk-table-cell-input-bg);
7985
+ --osdk-combobox-trigger-bg: var(--osdk-table-cell-input-bg);
8075
7986
 
8076
7987
  --osdk-combobox-input-padding: var(--osdk-surface-spacing)
8077
7988
  calc(var(--osdk-surface-spacing) * 3);
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { createContext } from "react";
18
+ export const OsdkThemeContext = /*#__PURE__*/createContext(null);
19
+ //# sourceMappingURL=OsdkThemeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OsdkThemeContext.js","names":["createContext","OsdkThemeContext"],"sources":["OsdkThemeContext.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type Context, createContext } from \"react\";\nimport type { OsdkThemeContextValue } from \"./types.js\";\n\nexport const OsdkThemeContext: Context<OsdkThemeContextValue | null> =\n createContext<OsdkThemeContextValue | null>(null);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAuBA,aAAa,QAAQ,OAAO;AAGnD,OAAO,MAAMC,gBAAuD,gBAClED,aAAa,CAA+B,IAAI,CAAC","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ import { OsdkThemeContext } from "./OsdkThemeContext.js";
19
+ import { useSystemTheme } from "./useSystemTheme.js";
20
+ export const DATA_THEME_ATTR = "data-bp-color-scheme";
21
+ /**
22
+ * Provides OSDK theme state to descendants and writes a
23
+ * `data-bp-color-scheme` attribute onto the document so the CSS in
24
+ * `tokens/base-tokens/dark.css` activates the right theme.
25
+ *
26
+ * `defaultTheme="system"` (default) follows the OS `prefers-color-scheme`
27
+ * setting and re-renders when it changes. `defaultTheme="light"` /
28
+ * `defaultTheme="dark"` start in the given theme regardless of the OS
29
+ * preference. Call {@link useOsdkTheme}().setTheme from a descendant to
30
+ * switch modes at runtime.
31
+ *
32
+ * To integrate with an external theme store, pass `theme` (controlled
33
+ * mode)
34
+ */
35
+ export function OsdkThemeProvider({
36
+ theme: controlledTheme,
37
+ defaultTheme = "system",
38
+ onThemeChanged,
39
+ target,
40
+ children
41
+ }) {
42
+ const [internalTheme, setInternalTheme] = React.useState(defaultTheme);
43
+ const theme = controlledTheme ?? internalTheme;
44
+ const systemTheme = useSystemTheme();
45
+ const resolvedTheme = theme === "system" ? systemTheme : theme;
46
+ React.useLayoutEffect(() => {
47
+ const element = target ?? (typeof document !== "undefined" ? document.documentElement : null);
48
+ if (element == null) return;
49
+ const previous = element.getAttribute(DATA_THEME_ATTR);
50
+ element.setAttribute(DATA_THEME_ATTR, resolvedTheme);
51
+ return () => {
52
+ if (previous == null) {
53
+ element.removeAttribute(DATA_THEME_ATTR);
54
+ } else {
55
+ element.setAttribute(DATA_THEME_ATTR, previous);
56
+ }
57
+ };
58
+ }, [resolvedTheme, target]);
59
+ const setTheme = React.useCallback(next => {
60
+ if (controlledTheme === undefined) {
61
+ setInternalTheme(next);
62
+ }
63
+ onThemeChanged?.(next);
64
+ }, [controlledTheme, onThemeChanged]);
65
+ const value = React.useMemo(() => ({
66
+ theme,
67
+ resolvedTheme,
68
+ setTheme
69
+ }), [theme, resolvedTheme, setTheme]);
70
+ return /*#__PURE__*/React.createElement(OsdkThemeContext.Provider, {
71
+ value: value
72
+ }, children);
73
+ }
74
+ //# sourceMappingURL=OsdkThemeProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OsdkThemeProvider.js","names":["React","OsdkThemeContext","useSystemTheme","DATA_THEME_ATTR","OsdkThemeProvider","theme","controlledTheme","defaultTheme","onThemeChanged","target","children","internalTheme","setInternalTheme","useState","systemTheme","resolvedTheme","useLayoutEffect","element","document","documentElement","previous","getAttribute","setAttribute","removeAttribute","setTheme","useCallback","next","undefined","value","useMemo","createElement","Provider"],"sources":["OsdkThemeProvider.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { OsdkThemeContext } from \"./OsdkThemeContext.js\";\nimport type {\n OsdkThemeContextValue,\n OsdkThemeMode,\n ResolvedOsdkTheme,\n} from \"./types.js\";\nimport { useSystemTheme } from \"./useSystemTheme.js\";\n\nexport const DATA_THEME_ATTR = \"data-bp-color-scheme\";\n\nexport interface OsdkThemeProviderProps {\n /**\n * Controlled theme. When provided, the provider does not maintain its\n * own state — the parent must respond to `onThemeChanged` (or update its\n * own external store) and re-render with the new value. Use this when an\n * external store already owns the theme value (e.g. Redux/Zustand, a\n * parent design-system provider, or a Storybook toolbar).\n */\n theme?: OsdkThemeMode;\n\n /**\n * Initial theme when uncontrolled. Ignored when `theme` is provided.\n *\n * @default \"system\"\n */\n defaultTheme?: OsdkThemeMode;\n\n /** Fires whenever `setTheme` is called from a descendant. */\n onThemeChanged?: (theme: OsdkThemeMode) => void;\n\n /**\n * Element to write `data-bp-color-scheme` onto.\n *\n * @default `document.documentElement` - (the `<html>` element), which is\n * the safest target because Blueprint portals (popovers, dialogs,\n * tooltips) render outside the React tree.\n */\n target?: HTMLElement | null;\n\n children: React.ReactNode;\n}\n\n/**\n * Provides OSDK theme state to descendants and writes a\n * `data-bp-color-scheme` attribute onto the document so the CSS in\n * `tokens/base-tokens/dark.css` activates the right theme.\n *\n * `defaultTheme=\"system\"` (default) follows the OS `prefers-color-scheme`\n * setting and re-renders when it changes. `defaultTheme=\"light\"` /\n * `defaultTheme=\"dark\"` start in the given theme regardless of the OS\n * preference. Call {@link useOsdkTheme}().setTheme from a descendant to\n * switch modes at runtime.\n *\n * To integrate with an external theme store, pass `theme` (controlled\n * mode)\n */\nexport function OsdkThemeProvider({\n theme: controlledTheme,\n defaultTheme = \"system\",\n onThemeChanged,\n target,\n children,\n}: OsdkThemeProviderProps): React.ReactElement {\n const [internalTheme, setInternalTheme] = React.useState<OsdkThemeMode>(\n defaultTheme,\n );\n const theme = controlledTheme ?? internalTheme;\n\n const systemTheme = useSystemTheme();\n const resolvedTheme: ResolvedOsdkTheme = theme === \"system\"\n ? systemTheme\n : theme;\n\n React.useLayoutEffect(() => {\n const element = target\n ?? (typeof document !== \"undefined\" ? document.documentElement : null);\n if (element == null) return;\n\n const previous = element.getAttribute(DATA_THEME_ATTR);\n element.setAttribute(DATA_THEME_ATTR, resolvedTheme);\n return () => {\n if (previous == null) {\n element.removeAttribute(DATA_THEME_ATTR);\n } else {\n element.setAttribute(DATA_THEME_ATTR, previous);\n }\n };\n }, [resolvedTheme, target]);\n\n const setTheme = React.useCallback(\n (next: OsdkThemeMode) => {\n if (controlledTheme === undefined) {\n setInternalTheme(next);\n }\n onThemeChanged?.(next);\n },\n [controlledTheme, onThemeChanged],\n );\n\n const value = React.useMemo<OsdkThemeContextValue>(\n () => ({ theme, resolvedTheme, setTheme }),\n [theme, resolvedTheme, setTheme],\n );\n\n return (\n <OsdkThemeContext.Provider value={value}>\n {children}\n </OsdkThemeContext.Provider>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,uBAAuB;AAMxD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,OAAO,MAAMC,eAAe,GAAG,sBAAsB;AAkCrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,KAAK,EAAEC,eAAe;EACtBC,YAAY,GAAG,QAAQ;EACvBC,cAAc;EACdC,MAAM;EACNC;AACsB,CAAC,EAAsB;EAC7C,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGZ,KAAK,CAACa,QAAQ,CACtDN,YACF,CAAC;EACD,MAAMF,KAAK,GAAGC,eAAe,IAAIK,aAAa;EAE9C,MAAMG,WAAW,GAAGZ,cAAc,CAAC,CAAC;EACpC,MAAMa,aAAgC,GAAGV,KAAK,KAAK,QAAQ,GACvDS,WAAW,GACXT,KAAK;EAETL,KAAK,CAACgB,eAAe,CAAC,MAAM;IAC1B,MAAMC,OAAO,GAAGR,MAAM,KAChB,OAAOS,QAAQ,KAAK,WAAW,GAAGA,QAAQ,CAACC,eAAe,GAAG,IAAI,CAAC;IACxE,IAAIF,OAAO,IAAI,IAAI,EAAE;IAErB,MAAMG,QAAQ,GAAGH,OAAO,CAACI,YAAY,CAAClB,eAAe,CAAC;IACtDc,OAAO,CAACK,YAAY,CAACnB,eAAe,EAAEY,aAAa,CAAC;IACpD,OAAO,MAAM;MACX,IAAIK,QAAQ,IAAI,IAAI,EAAE;QACpBH,OAAO,CAACM,eAAe,CAACpB,eAAe,CAAC;MAC1C,CAAC,MAAM;QACLc,OAAO,CAACK,YAAY,CAACnB,eAAe,EAAEiB,QAAQ,CAAC;MACjD;IACF,CAAC;EACH,CAAC,EAAE,CAACL,aAAa,EAAEN,MAAM,CAAC,CAAC;EAE3B,MAAMe,QAAQ,GAAGxB,KAAK,CAACyB,WAAW,CAC/BC,IAAmB,IAAK;IACvB,IAAIpB,eAAe,KAAKqB,SAAS,EAAE;MACjCf,gBAAgB,CAACc,IAAI,CAAC;IACxB;IACAlB,cAAc,GAAGkB,IAAI,CAAC;EACxB,CAAC,EACD,CAACpB,eAAe,EAAEE,cAAc,CAClC,CAAC;EAED,MAAMoB,KAAK,GAAG5B,KAAK,CAAC6B,OAAO,CACzB,OAAO;IAAExB,KAAK;IAAEU,aAAa;IAAES;EAAS,CAAC,CAAC,EAC1C,CAACnB,KAAK,EAAEU,aAAa,EAAES,QAAQ,CACjC,CAAC;EAED,oBACExB,KAAA,CAAA8B,aAAA,CAAC7B,gBAAgB,CAAC8B,QAAQ;IAACH,KAAK,EAAEA;EAAM,GACrClB,QACwB,CAAC;AAEhC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Requested theme mode.\n *\n * - `\"light\"` / `\"dark\"` — force the given theme regardless of OS preference.\n * - `\"system\"` — follow `prefers-color-scheme` and react to changes at runtime.\n */\nexport type OsdkThemeMode = \"light\" | \"dark\" | \"system\";\n\n/**\n * The concrete theme actually applied to the DOM. `OsdkThemeMode` of\n * `\"system\"` resolves to either `\"light\"` or `\"dark\"` depending on the\n * current value of `prefers-color-scheme`.\n */\nexport type ResolvedOsdkTheme = \"light\" | \"dark\";\n\nexport interface OsdkThemeContextValue {\n /** The requested mode, including `\"system\"`. */\n theme: OsdkThemeMode;\n /** The concrete theme currently applied to the DOM. */\n resolvedTheme: ResolvedOsdkTheme;\n /**\n * Update the requested mode. In controlled mode (`theme` prop on the\n * provider) this only invokes `onThemeChanged`; the consumer is expected\n * to re-render the provider with the new value.\n */\n setTheme: (theme: OsdkThemeMode) => void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useContext } from "react";
18
+ import { OsdkThemeContext } from "./OsdkThemeContext.js";
19
+ /**
20
+ * Read the active OSDK theme and update it imperatively.
21
+ *
22
+ * Must be called from a descendant of `<OsdkThemeProvider>`; throws otherwise.
23
+ *
24
+ * @returns
25
+ * - `theme` — the requested mode (`"light" | "dark" | "system"`).
26
+ * - `resolvedTheme` — the concrete theme on the DOM (`"light" | "dark"`).
27
+ * When `theme === "system"`, this tracks `prefers-color-scheme` and
28
+ * updates as the OS preference changes.
29
+ * - `setTheme(next)` — update the mode. In controlled mode this only
30
+ * invokes the provider's `onThemeChanged`; the consumer must re-render
31
+ * the provider with the new value.
32
+ */
33
+ export function useOsdkTheme() {
34
+ const ctx = useContext(OsdkThemeContext);
35
+ if (ctx == null) {
36
+ throw new Error("useOsdkTheme must be used within an <OsdkThemeProvider>.");
37
+ }
38
+ return ctx;
39
+ }
40
+ //# sourceMappingURL=useOsdkTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOsdkTheme.js","names":["useContext","OsdkThemeContext","useOsdkTheme","ctx","Error"],"sources":["useOsdkTheme.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useContext } from \"react\";\nimport { OsdkThemeContext } from \"./OsdkThemeContext.js\";\nimport type { OsdkThemeContextValue } from \"./types.js\";\n\n/**\n * Read the active OSDK theme and update it imperatively.\n *\n * Must be called from a descendant of `<OsdkThemeProvider>`; throws otherwise.\n *\n * @returns\n * - `theme` — the requested mode (`\"light\" | \"dark\" | \"system\"`).\n * - `resolvedTheme` — the concrete theme on the DOM (`\"light\" | \"dark\"`).\n * When `theme === \"system\"`, this tracks `prefers-color-scheme` and\n * updates as the OS preference changes.\n * - `setTheme(next)` — update the mode. In controlled mode this only\n * invokes the provider's `onThemeChanged`; the consumer must re-render\n * the provider with the new value.\n */\nexport function useOsdkTheme(): OsdkThemeContextValue {\n const ctx = useContext(OsdkThemeContext);\n if (ctx == null) {\n throw new Error(\n \"useOsdkTheme must be used within an <OsdkThemeProvider>.\",\n );\n }\n return ctx;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,gBAAgB,QAAQ,uBAAuB;AAGxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAA0B;EACpD,MAAMC,GAAG,GAAGH,UAAU,CAACC,gBAAgB,CAAC;EACxC,IAAIE,GAAG,IAAI,IAAI,EAAE;IACf,MAAM,IAAIC,KAAK,CACb,0DACF,CAAC;EACH;EACA,OAAOD,GAAG;AACZ","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { useSyncExternalStore } from "react";
18
+ const DARK_QUERY = "(prefers-color-scheme: dark)";
19
+ function subscribe(callback) {
20
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
21
+ return () => {};
22
+ }
23
+ const mql = window.matchMedia(DARK_QUERY);
24
+ mql.addEventListener("change", callback);
25
+ return () => mql.removeEventListener("change", callback);
26
+ }
27
+ function getSnapshot() {
28
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
29
+ return "light";
30
+ }
31
+ return window.matchMedia(DARK_QUERY).matches ? "dark" : "light";
32
+ }
33
+ function getServerSnapshot() {
34
+ return "light";
35
+ }
36
+
37
+ /**
38
+ * Subscribes to the OS-level `prefers-color-scheme` media query and returns
39
+ * the current resolved value. Re-renders the consumer when the OS preference
40
+ * changes. SSR-safe: returns `"light"` on the server.
41
+ */
42
+ export function useSystemTheme() {
43
+ return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
44
+ }
45
+ //# sourceMappingURL=useSystemTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSystemTheme.js","names":["useSyncExternalStore","DARK_QUERY","subscribe","callback","window","matchMedia","mql","addEventListener","removeEventListener","getSnapshot","matches","getServerSnapshot","useSystemTheme"],"sources":["useSystemTheme.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useSyncExternalStore } from \"react\";\nimport type { ResolvedOsdkTheme } from \"./types.js\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nfunction subscribe(callback: () => void): () => void {\n if (\n typeof window === \"undefined\" || typeof window.matchMedia !== \"function\"\n ) {\n return () => {};\n }\n const mql = window.matchMedia(DARK_QUERY);\n mql.addEventListener(\"change\", callback);\n return () => mql.removeEventListener(\"change\", callback);\n}\n\nfunction getSnapshot(): ResolvedOsdkTheme {\n if (\n typeof window === \"undefined\" || typeof window.matchMedia !== \"function\"\n ) {\n return \"light\";\n }\n return window.matchMedia(DARK_QUERY).matches ? \"dark\" : \"light\";\n}\n\nfunction getServerSnapshot(): ResolvedOsdkTheme {\n return \"light\";\n}\n\n/**\n * Subscribes to the OS-level `prefers-color-scheme` media query and returns\n * the current resolved value. Re-renders the consumer when the OS preference\n * changes. SSR-safe: returns `\"light\"` on the server.\n */\nexport function useSystemTheme(): ResolvedOsdkTheme {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,OAAO;AAG5C,MAAMC,UAAU,GAAG,8BAA8B;AAEjD,SAASC,SAASA,CAACC,QAAoB,EAAc;EACnD,IACE,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,UAAU,EACxE;IACA,OAAO,MAAM,CAAC,CAAC;EACjB;EACA,MAAMC,GAAG,GAAGF,MAAM,CAACC,UAAU,CAACJ,UAAU,CAAC;EACzCK,GAAG,CAACC,gBAAgB,CAAC,QAAQ,EAAEJ,QAAQ,CAAC;EACxC,OAAO,MAAMG,GAAG,CAACE,mBAAmB,CAAC,QAAQ,EAAEL,QAAQ,CAAC;AAC1D;AAEA,SAASM,WAAWA,CAAA,EAAsB;EACxC,IACE,OAAOL,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,UAAU,EACxE;IACA,OAAO,OAAO;EAChB;EACA,OAAOD,MAAM,CAACC,UAAU,CAACJ,UAAU,CAAC,CAACS,OAAO,GAAG,MAAM,GAAG,OAAO;AACjE;AAEA,SAASC,iBAAiBA,CAAA,EAAsB;EAC9C,OAAO,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAsB;EAClD,OAAOZ,oBAAoB,CAACE,SAAS,EAAEO,WAAW,EAAEE,iBAAiB,CAAC;AACxE","ignoreList":[]}
@@ -1,18 +1,11 @@
1
1
  /*
2
- * Dark theme overrides for OSDK semantic tokens. Activated by any of:
3
- * - `prefers-color-scheme: dark` (OS-level, matches Foundry custom-widgets)
4
- * - `[data-bp-color-scheme="dark"]` / `.bp6-dark` (Blueprint convention)
5
- * - `[data-theme="dark"]` (Tailwind/Primer/Storybook toolbar convention;
6
- * lets Storybook import this file directly instead of duplicating)
2
+ * Dark theme overrides for OSDK semantic tokens. Activated by `[data-bp-color-scheme="dark"]`
3
+ * written by `<OsdkThemeProvider>` onto the document root, matching Blueprint's own convention so the
4
+ * theme also applies to portaled overlays. Keeping `.bp6-dark` as well to match Blueprint's class-based
5
+ * variant of the same convention.
7
6
  *
8
7
  * Source-of-truth dark values live in `--osdk-dark-*` helpers at `:root`
9
- * (private — do not consume directly). The three activation blocks below
10
- * map those helpers onto the public `--bp-*` / `--osdk-*` tokens.
11
- *
12
- * `[data-bp-color-scheme="dark"], .bp6-dark` only re-maps `--osdk-*` —
13
- * Blueprint flips `--bp-*` itself under those selectors. The other two
14
- * blocks also flip `--bp-*` because Blueprint doesn't fire there.
15
- *
8
+ * (private — do not consume directly).
16
9
  */
17
10
 
18
11
  :root {
@@ -24,16 +17,13 @@
24
17
  0px 0px 10px 0px rgba(0, 0, 0, 0.2);
25
18
  --osdk-dark-bp-surface-shadow-1:
26
19
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
27
- 0px 1px 10px 0px rgba(0, 0, 0, 0.2),
28
- 0px 1px 10px -1px rgba(0, 0, 0, 0.2);
20
+ 0px 1px 10px 0px rgba(0, 0, 0, 0.2), 0px 1px 10px -1px rgba(0, 0, 0, 0.2);
29
21
  --osdk-dark-bp-surface-shadow-2:
30
22
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
31
- 0px 4px 6px -4px rgba(0, 0, 0, 0.5),
32
- 0px 10px 30px -5px rgba(0, 0, 0, 0.5);
23
+ 0px 4px 6px -4px rgba(0, 0, 0, 0.5), 0px 10px 30px -5px rgba(0, 0, 0, 0.5);
33
24
  --osdk-dark-bp-surface-shadow-3:
34
25
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
35
- 0px 20px 25px -5px rgba(0, 0, 0, 0.3),
36
- 0px 10px 30px -5px rgba(0, 0, 0, 0.3);
26
+ 0px 20px 25px -5px rgba(0, 0, 0, 0.3), 0px 10px 30px -5px rgba(0, 0, 0, 0.3);
37
27
  --osdk-dark-bp-surface-shadow-4:
38
28
  inset 0px 0px 0px 1px rgba(255, 255, 255, 0.2),
39
29
  0px 25px 60px -12px rgba(0, 0, 0, 0.85);
@@ -68,87 +58,6 @@
68
58
  );
69
59
  }
70
60
 
71
- @media (prefers-color-scheme: dark) {
72
- :root {
73
- /* --bp-* flips (Blueprint doesn't respond to prefers-color-scheme) */
74
- --bp-surface-border-color-default: var(--osdk-dark-bp-surface-border-color-default);
75
- --bp-surface-border-color-strong: var(--osdk-dark-bp-surface-border-color-strong);
76
- --bp-surface-shadow-0: var(--osdk-dark-bp-surface-shadow-0);
77
- --bp-surface-shadow-1: var(--osdk-dark-bp-surface-shadow-1);
78
- --bp-surface-shadow-2: var(--osdk-dark-bp-surface-shadow-2);
79
- --bp-surface-shadow-3: var(--osdk-dark-bp-surface-shadow-3);
80
- --bp-surface-shadow-4: var(--osdk-dark-bp-surface-shadow-4);
81
- --bp-surface-color-code: var(--osdk-dark-bp-surface-color-code);
82
- --bp-surface-background-color-default-rest: var(--osdk-dark-bp-surface-background-color-default-rest);
83
- --bp-surface-background-color-default-hover: var(--osdk-dark-bp-surface-background-color-default-hover);
84
- --bp-surface-background-color-default-active: var(--osdk-dark-bp-surface-background-color-default-active);
85
- --bp-surface-background-color-default-disabled: var(--osdk-dark-bp-surface-background-color-default-disabled);
86
- --bp-typography-color-default-rest: var(--osdk-dark-bp-typography-color-default-rest);
87
- --bp-typography-color-default-hover: var(--osdk-dark-bp-typography-color-default-hover);
88
- --bp-typography-color-default-active: var(--osdk-dark-bp-typography-color-default-active);
89
-
90
- /* --osdk-* overrides */
91
- --osdk-background-primary: var(--osdk-dark-background-primary);
92
- --osdk-background-secondary: var(--osdk-dark-background-secondary);
93
- --osdk-background-tertiary: var(--osdk-dark-background-tertiary);
94
- --osdk-typography-color-muted: var(--osdk-dark-typography-color-muted);
95
- --osdk-intent-default-rest: var(--osdk-dark-intent-default-rest);
96
- --osdk-intent-default-foreground: var(--osdk-dark-intent-default-foreground);
97
- --osdk-button-secondary-bg: var(--osdk-dark-button-secondary-bg);
98
- --osdk-button-secondary-color: var(--osdk-dark-button-secondary-color);
99
- --osdk-table-row-bg-default: var(--osdk-dark-table-row-bg-default);
100
- --osdk-table-header-bg: var(--osdk-dark-table-header-bg);
101
- --osdk-table-header-color: var(--osdk-dark-table-header-color);
102
- --osdk-table-cell-color: var(--osdk-dark-table-cell-color);
103
- --osdk-table-header-menu-color: var(--osdk-dark-table-header-menu-color);
104
- --osdk-table-border-color: var(--osdk-dark-table-border-color);
105
- --osdk-table-cell-divider: var(--osdk-table-border-width) solid
106
- var(--osdk-table-border-color);
107
- --osdk-table-row-bg-hover: var(--osdk-dark-table-row-bg-hover);
108
- --osdk-table-row-bg-active: var(--osdk-dark-table-row-bg-hover);
109
- }
110
- }
111
-
112
- [data-theme="dark"] {
113
- /* --bp-* flips (Blueprint doesn't respond to data-theme).
114
- Mirrors the @media (prefers-color-scheme: dark) block above. */
115
- --bp-surface-border-color-default: var(--osdk-dark-bp-surface-border-color-default);
116
- --bp-surface-border-color-strong: var(--osdk-dark-bp-surface-border-color-strong);
117
- --bp-surface-shadow-0: var(--osdk-dark-bp-surface-shadow-0);
118
- --bp-surface-shadow-1: var(--osdk-dark-bp-surface-shadow-1);
119
- --bp-surface-shadow-2: var(--osdk-dark-bp-surface-shadow-2);
120
- --bp-surface-shadow-3: var(--osdk-dark-bp-surface-shadow-3);
121
- --bp-surface-shadow-4: var(--osdk-dark-bp-surface-shadow-4);
122
- --bp-surface-color-code: var(--osdk-dark-bp-surface-color-code);
123
- --bp-surface-background-color-default-rest: var(--osdk-dark-bp-surface-background-color-default-rest);
124
- --bp-surface-background-color-default-hover: var(--osdk-dark-bp-surface-background-color-default-hover);
125
- --bp-surface-background-color-default-active: var(--osdk-dark-bp-surface-background-color-default-active);
126
- --bp-surface-background-color-default-disabled: var(--osdk-dark-bp-surface-background-color-default-disabled);
127
- --bp-typography-color-default-rest: var(--osdk-dark-bp-typography-color-default-rest);
128
- --bp-typography-color-default-hover: var(--osdk-dark-bp-typography-color-default-hover);
129
- --bp-typography-color-default-active: var(--osdk-dark-bp-typography-color-default-active);
130
-
131
- /* --osdk-* overrides */
132
- --osdk-background-primary: var(--osdk-dark-background-primary);
133
- --osdk-background-secondary: var(--osdk-dark-background-secondary);
134
- --osdk-background-tertiary: var(--osdk-dark-background-tertiary);
135
- --osdk-typography-color-muted: var(--osdk-dark-typography-color-muted);
136
- --osdk-intent-default-rest: var(--osdk-dark-intent-default-rest);
137
- --osdk-intent-default-foreground: var(--osdk-dark-intent-default-foreground);
138
- --osdk-button-secondary-bg: var(--osdk-dark-button-secondary-bg);
139
- --osdk-button-secondary-color: var(--osdk-dark-button-secondary-color);
140
- --osdk-table-row-bg-default: var(--osdk-dark-table-row-bg-default);
141
- --osdk-table-header-bg: var(--osdk-dark-table-header-bg);
142
- --osdk-table-header-color: var(--osdk-dark-table-header-color);
143
- --osdk-table-cell-color: var(--osdk-dark-table-cell-color);
144
- --osdk-table-header-menu-color: var(--osdk-dark-table-header-menu-color);
145
- --osdk-table-border-color: var(--osdk-dark-table-border-color);
146
- --osdk-table-cell-divider: var(--osdk-table-border-width) solid
147
- var(--osdk-table-border-color);
148
- --osdk-table-row-bg-hover: var(--osdk-dark-table-row-bg-hover);
149
- --osdk-table-row-bg-active: var(--osdk-dark-table-row-bg-hover);
150
- }
151
-
152
61
  [data-bp-color-scheme="dark"],
153
62
  .bp6-dark {
154
63
  /* Blueprint already flips --bp-* under these selectors, so any --osdk-*
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- const PACKAGE_USER_AGENT = `osdk-react-components/${"0.19.0-main-b5d7e7b9644f6f9d2b3771c6fafca28cd20a3cbb"}`;
17
+ const PACKAGE_USER_AGENT = `osdk-react-components/${"0.19.0"}`;
18
18
  export function componentUserAgent(componentName) {
19
19
  return `${PACKAGE_USER_AGENT}/${componentName}`;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,iFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,mCAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}