@nkootstra/block-kit 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.css CHANGED
@@ -1,6 +1,8 @@
1
1
  /* Entry stylesheet. The build inlines these imports into dist/styles.css. */
2
2
  /* Values measured from Slack's Block Kit Builder (light theme, desktop). */
3
- :root {
3
+ :root,
4
+ [data-theme="light"] {
5
+ --sbk-hover-actions-shadow: 0 0 0 1px rgba(29, 28, 29, 0.13), 0 1px 3px 0 #00000014;
4
6
  --sbk-font: "Slack-Lato", Lato, appleLogo, sans-serif;
5
7
  --sbk-font-mono:
6
8
  "Slack-Roboto-Mono", "Roboto Mono", Monaco, Menlo, Consolas, "Courier New", monospace;
@@ -895,9 +897,11 @@
895
897
 
896
898
  /* Dark theme: Slack's `.sk-client-theme--dark` design tokens (base-pry #1a1d21, content-pry
897
899
  #f8f8f8, content-hgl-1 #2ba5ce, ...), with hover/press overlays blended with `lighten` as Slack
898
- does. Applies under `prefers-color-scheme: dark` unless an ancestor sets `data-theme="light"`,
899
- or always with `data-theme="dark"` on the root. Component tokens are remapped here too so the
900
- whole dark palette lives in one place. */
900
+ does. Applies under `prefers-color-scheme: dark` unless the root sets `data-theme="light"`, and
901
+ always inside an element with `data-theme="dark"` (BlockKitProvider's `theme` prop sets it on its
902
+ wrapper). Inside `data-theme="light"` the light tokens apply again (base.css). Component tokens
903
+ are remapped here too so the whole dark palette lives in one place. `:root[data-theme="dark"]`
904
+ outranks the `:root` light tokens of the block stylesheets loaded after this one. */
901
905
  @media (prefers-color-scheme: dark) {
902
906
  :root:not([data-theme="light"]) {
903
907
  --sbk-text: #f8f8f8;
@@ -969,22 +973,29 @@
969
973
  --sbk-data-table-sep: #797c814d;
970
974
  --sbk-data-table-active: #3daa7c;
971
975
  --sbk-plan-text: #9a9b9e;
972
- --sbk-plan-complete: #3daa7c;
973
- --sbk-plan-in-progress: #2ba5ce;
974
- --sbk-plan-pending: #9a9b9e;
975
- --sbk-plan-sep: #797c814d;
976
976
  --sbk-task-card-text: #9a9b9e;
977
- --sbk-task-card-in-progress: #2ba5ce;
978
977
  --sbk-alert-default-bg: #f8f8f81a;
979
978
  --sbk-alert-default-icon: #b9babd;
980
979
  --sbk-alert-info-icon: #2ba5ce;
981
980
  --sbk-alert-warning-icon: #e8a723;
982
981
  --sbk-alert-error-icon: #d94c75;
983
982
  --sbk-alert-success-icon: #3daa7c;
983
+ --sbk-callout-border: #797c814d;
984
+ --sbk-callout-green-bg: #203430;
985
+ --sbk-callout-blue-bg: #1d333d;
986
+ --sbk-callout-red-bg: #39252e;
987
+ --sbk-callout-yellow-bg: #3b3321;
988
+ --sbk-callout-purple-bg: #312c3f;
989
+ --sbk-callout-gray-bg: #272a2e;
990
+ --sbk-chart-area-1: #583422;
991
+ --sbk-chart-area-2: #1c4539;
992
+ --sbk-chart-area-3: #4d3756;
993
+ --sbk-chart-area-4: #164356;
984
994
  }
985
995
  }
986
996
 
987
- :root[data-theme="dark"] {
997
+ :root[data-theme="dark"],
998
+ [data-theme="dark"] {
988
999
  --sbk-text: #f8f8f8;
989
1000
  --sbk-link: #2ba5ce;
990
1001
  --sbk-code-text: #de678a;
@@ -1054,18 +1065,24 @@
1054
1065
  --sbk-data-table-sep: #797c814d;
1055
1066
  --sbk-data-table-active: #3daa7c;
1056
1067
  --sbk-plan-text: #9a9b9e;
1057
- --sbk-plan-complete: #3daa7c;
1058
- --sbk-plan-in-progress: #2ba5ce;
1059
- --sbk-plan-pending: #9a9b9e;
1060
- --sbk-plan-sep: #797c814d;
1061
1068
  --sbk-task-card-text: #9a9b9e;
1062
- --sbk-task-card-in-progress: #2ba5ce;
1063
1069
  --sbk-alert-default-bg: #f8f8f81a;
1064
1070
  --sbk-alert-default-icon: #b9babd;
1065
1071
  --sbk-alert-info-icon: #2ba5ce;
1066
1072
  --sbk-alert-warning-icon: #e8a723;
1067
1073
  --sbk-alert-error-icon: #d94c75;
1068
1074
  --sbk-alert-success-icon: #3daa7c;
1075
+ --sbk-callout-border: #797c814d;
1076
+ --sbk-callout-green-bg: #203430;
1077
+ --sbk-callout-blue-bg: #1d333d;
1078
+ --sbk-callout-red-bg: #39252e;
1079
+ --sbk-callout-yellow-bg: #3b3321;
1080
+ --sbk-callout-purple-bg: #312c3f;
1081
+ --sbk-callout-gray-bg: #272a2e;
1082
+ --sbk-chart-area-1: #583422;
1083
+ --sbk-chart-area-2: #1c4539;
1084
+ --sbk-chart-area-3: #4d3756;
1085
+ --sbk-chart-area-4: #164356;
1069
1086
  }
1070
1087
 
1071
1088
  /* A clickable user mention and its profile card popover (Slack's `p-member_profile_card`): a
@@ -1238,11 +1255,7 @@
1238
1255
  padding: 4px;
1239
1256
  background: var(--sbk-menu-bg);
1240
1257
  border-radius: 12px;
1241
- box-shadow: var(
1242
- --sbk-hover-actions-shadow,
1243
- 0 0 0 1px rgba(29, 28, 29, 0.13),
1244
- 0 1px 3px 0 #00000014
1245
- );
1258
+ box-shadow: var(--sbk-hover-actions-shadow);
1246
1259
  opacity: 0;
1247
1260
  pointer-events: none;
1248
1261
  }
@@ -1320,7 +1333,8 @@ a.sbk-hover-actions__button {
1320
1333
 
1321
1334
  /* Measured from the Builder's modal preview (`c-alert--boxed`). Dark values aren't measured; they
1322
1335
  reuse the dark palette's matching hues. */
1323
- :root {
1336
+ :root,
1337
+ [data-theme="light"] {
1324
1338
  --sbk-alert-default-bg: rgb(234, 234, 234);
1325
1339
  --sbk-alert-default-icon: rgb(94, 93, 96);
1326
1340
  --sbk-alert-info-bg: rgba(54, 197, 240, 0.13);
@@ -1388,9 +1402,23 @@ a.sbk-hover-actions__button {
1388
1402
  color: var(--sbk-alert-success-icon);
1389
1403
  }
1390
1404
 
1405
+ /* Light values measured from Builder references (green, blue); the other light values are
1406
+ extrapolated. Dark values (Message.css) aren't measured: each is its hue from the dark palette
1407
+ at 16% over the dark background (gray: 6% white), like the alert colours. */
1408
+ :root,
1409
+ [data-theme="light"] {
1410
+ --sbk-callout-border: rgba(94, 93, 96, 0.13);
1411
+ --sbk-callout-green-bg: #f4ffdb;
1412
+ --sbk-callout-blue-bg: #e3f8ff;
1413
+ --sbk-callout-red-bg: #ffeceb;
1414
+ --sbk-callout-yellow-bg: #fff8db;
1415
+ --sbk-callout-purple-bg: #f3ecff;
1416
+ --sbk-callout-gray-bg: #f4f4f4;
1417
+ }
1418
+
1391
1419
  .sbk-callout {
1392
1420
  padding: 12px;
1393
- border: 1px solid rgba(94, 93, 96, 0.13);
1421
+ border: 1px solid var(--sbk-callout-border);
1394
1422
  border-radius: 12px;
1395
1423
  overflow: hidden;
1396
1424
  }
@@ -1949,7 +1977,8 @@ a.sbk-hover-actions__button {
1949
1977
  }
1950
1978
 
1951
1979
  /* Values measured from Slack's Block Kit Builder for the `data_table` block. */
1952
- :root {
1980
+ :root,
1981
+ [data-theme="light"] {
1953
1982
  --sbk-data-table-bg: rgba(29, 28, 29, 0.06);
1954
1983
  --sbk-data-table-sep: rgba(94, 93, 96, 0.13);
1955
1984
  --sbk-data-table-active: #007a5a;
@@ -2312,7 +2341,15 @@ a.sbk-hover-actions__button {
2312
2341
  padding: 1px 3px;
2313
2342
  }
2314
2343
 
2315
- :root {
2344
+ :root,
2345
+ [data-theme="light"] {
2346
+ /* Area fills: measured for the first two series colours, tinted 88% toward white for the
2347
+ others. Dark values (Message.css) aren't measured: the series colour at 30% over the dark
2348
+ background. */
2349
+ --sbk-chart-area-1: rgb(255, 237, 229);
2350
+ --sbk-chart-area-2: rgb(227, 255, 243);
2351
+ --sbk-chart-area-3: rgb(248, 238, 250);
2352
+ --sbk-chart-area-4: rgb(226, 243, 250);
2316
2353
  --sbk-dataviz-border: rgba(94, 93, 96, 0.13);
2317
2354
  --sbk-dataviz-tick: #5e5d60;
2318
2355
  }
@@ -2735,7 +2772,8 @@ a.sbk-hover-actions__button {
2735
2772
  border-bottom-right-radius: 4px;
2736
2773
  }
2737
2774
 
2738
- :root {
2775
+ :root,
2776
+ [data-theme="light"] {
2739
2777
  --sbk-plan-text: rgb(94, 93, 96);
2740
2778
  }
2741
2779
 
@@ -3163,7 +3201,8 @@ a.sbk-hover-actions__button {
3163
3201
  }
3164
3202
 
3165
3203
  /* Values measured from Slack's Block Kit Builder for the `table` block. */
3166
- :root {
3204
+ :root,
3205
+ [data-theme="light"] {
3167
3206
  --sbk-table-border: rgba(94, 93, 96, 0.13);
3168
3207
  }
3169
3208
 
@@ -3230,7 +3269,8 @@ a.sbk-hover-actions__button {
3230
3269
  border-bottom-right-radius: 4px;
3231
3270
  }
3232
3271
 
3233
- :root {
3272
+ :root,
3273
+ [data-theme="light"] {
3234
3274
  --sbk-task-card-text: rgb(94, 93, 96);
3235
3275
  }
3236
3276
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { N as BlockKitProviderProps, ht as ViewResponseAction } from "./index-BV_5_J_Q.js";
2
+ import { N as BlockKitProviderProps, ht as ViewResponseAction } from "./index-FPjJcmn3.js";
3
3
  //#region src/interactivity/transport.d.ts
4
4
  export interface InteractionResult {
5
5
  ok: boolean;
package/dist/web-api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { z as Resolvers } from "./index-BV_5_J_Q.js";
2
+ import { z as Resolvers } from "./index-FPjJcmn3.js";
3
3
  import { WebClient } from "@slack/web-api";
4
4
  //#region src/web-api/resolvers.d.ts
5
5
  interface WebApiResolversOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nkootstra/block-kit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Render Slack Block Kit JSON in React, pixel-for-pixel the way Slack does.",
5
5
  "keywords": [
6
6
  "block-kit",
@@ -42,8 +42,7 @@
42
42
  "build": "tsdown",
43
43
  "dev": "tsdown --watch",
44
44
  "test": "vitest run",
45
- "type-check": "tsc --noEmit",
46
- "prepublishOnly": "tsdown"
45
+ "type-check": "tsc --noEmit"
47
46
  },
48
47
  "dependencies": {
49
48
  "@slack/types": "3.1.0",