@kapaai/support-form-deflector 0.14.2 → 0.15.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.
@@ -38,6 +38,9 @@ export declare class StyleParser<T extends ThemeConfig, ComponentAttributeName e
38
38
  /**
39
39
  * Builds a flat CSSProperties object by reading all supported style attributes
40
40
  * for a given prefix. Used both for base component styles and state-prefixed styles.
41
+ *
42
+ * @param suffix — optional suffix appended to each attribute name (e.g. "-dark"
43
+ * to read `data-{prefix}-{attr}-dark` instead of `data-{prefix}-{attr}`)
41
44
  */
42
45
  private buildStylesForPrefix;
43
46
  /**
@@ -65,5 +68,30 @@ export declare class StyleParser<T extends ThemeConfig, ComponentAttributeName e
65
68
  * // => { fontSize: "14px", color: "#000", "::placeholder": { color: "#adb5bd" }, ":focus": { borderColor: "blue" } }
66
69
  */
67
70
  getComponentStyles(componentAttributeName: ComponentAttributeName, defaults?: S): S;
71
+ /**
72
+ * Same as `getComponentStyles` but reads dark-mode variants of attributes.
73
+ * For each CSS property, reads `data-{component}-{property}-dark` instead of
74
+ * `data-{component}-{property}`.
75
+ *
76
+ * @example
77
+ * // data-modal-header-background-color-dark="#1a1b1e"
78
+ * getComponentStylesDark("modal-header", { backgroundColor: "#17171a" })
79
+ * // => { backgroundColor: "#1a1b1e" }
80
+ */
81
+ getComponentStylesDark(componentAttributeName: ComponentAttributeName, defaults?: S): S;
82
+ /**
83
+ * Returns a new StyleParser where `getComponentStyles()` reads both
84
+ * standard attributes AND their `-dark` variants, with `-dark` winning.
85
+ *
86
+ * This allows parsers to call `getComponentStyles()` as usual — the dark
87
+ * parser transparently overlays dark-mode overrides on top.
88
+ *
89
+ * @example
90
+ * const darkParser = styleParser.withDarkMode();
91
+ * // darkParser.getComponentStyles("modal-header", defaults)
92
+ * // reads data-modal-header-* AND data-modal-header-*-dark,
93
+ * // with -dark values taking precedence.
94
+ */
95
+ withDarkMode(): StyleParser<T, ComponentAttributeName, S>;
68
96
  }
69
97
  //# sourceMappingURL=style-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/utils/src/config/style-parser.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACvD,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAoHD;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW,CACtB,CAAC,SAAS,WAAW,EACrB,sBAAsB,SAAS,MAAM,EACrC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3B,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,KAAK,CAAI;gBAEL,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC;IAKlD;;;OAGG;IACH,QAAQ,IAAI,CAAC;IAIb;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAWzB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA0B5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,CAChB,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,GAAE,CAAW,GACpB,CAAC;CAoBL"}
1
+ {"version":3,"file":"style-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/utils/src/config/style-parser.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACvD,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAoHD;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW,CACtB,CAAC,SAAS,WAAW,EACrB,sBAAsB,SAAS,MAAM,EACrC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3B,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,KAAK,CAAI;gBAEL,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC;IAKlD;;;OAGG;IACH,QAAQ,IAAI,CAAC;IAIb;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAWzB;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IA+B5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,CAChB,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,GAAE,CAAW,GACpB,CAAC;IAqBJ;;;;;;;;;OASG;IACH,sBAAsB,CACpB,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,GAAE,CAAW,GACpB,CAAC;IAuBJ;;;;;;;;;;;;OAYG;IACH,YAAY,IAAI,WAAW,CAAC,CAAC,EAAE,sBAAsB,EAAE,CAAC,CAAC;CA4C1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapaai/support-form-deflector",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -41,8 +41,7 @@
41
41
  "ts-loader": "^9.4.2",
42
42
  "turndown": "^7.2.0",
43
43
  "@kapaai/gc-publisher": "0.0.0",
44
- "@kapaai/react-sdk": "0.9.5",
45
- "@kapaai/utils": "0.0.2"
44
+ "@kapaai/react-sdk": "0.9.6"
46
45
  },
47
46
  "browserslist": {
48
47
  "production": [
@@ -76,7 +75,8 @@
76
75
  "webpack-cli": "^5.0.1",
77
76
  "webpack-dev-server": "^5.2.2",
78
77
  "@kapaai/eslint-config": "0.0.0",
79
- "@kapaai/tsconfig": "0.0.0"
78
+ "@kapaai/tsconfig": "0.0.0",
79
+ "@kapaai/utils": "0.0.2"
80
80
  },
81
81
  "publishConfig": {
82
82
  "access": "public"