@orion-ds/react 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.types.d.ts +130 -11
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Field/Field.types.d.ts +124 -11
- package/dist/components/Field/Field.types.d.ts.map +1 -1
- package/dist/contexts/ThemeContext.d.ts +15 -1
- package/dist/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/examples/LandingPage.example.d.ts +36 -0
- package/dist/examples/LandingPage.example.d.ts.map +1 -0
- package/dist/examples/index.d.ts +22 -0
- package/dist/examples/index.d.ts.map +1 -0
- package/dist/index.cjs +103 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +14019 -13517
- package/dist/index.mjs.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/react.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +94 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export * from './icons';
|
|
7
7
|
export { BRAND_FONTS, ALL_FONTS, GOOGLE_FONTS_URL, FONT_PRECONNECT_URLS, isFontLoaded, areBrandFontsLoaded, getMissingFonts, waitForFonts, getFontLinkTags, } from './fonts';
|
|
8
|
+
export { warnMissingAriaLabel, warnBrandProp, warnThemeProp, warnGlassVariant, warnHardcodedColors, warnFieldChildren, warnUsePrebuiltSection, } from './validation';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orion React Validation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Runtime validation helpers that provide helpful console warnings
|
|
5
|
+
* during development to catch common AI-generated code mistakes.
|
|
6
|
+
*
|
|
7
|
+
* These warnings only appear in development mode (process.env.NODE_ENV !== 'production').
|
|
8
|
+
*
|
|
9
|
+
* @module validation
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Warn when an icon-only button is missing aria-label.
|
|
13
|
+
*
|
|
14
|
+
* @param component - Component name (e.g., 'Button')
|
|
15
|
+
* @param iconOnly - Whether the component is icon-only
|
|
16
|
+
* @param hasAriaLabel - Whether aria-label is provided
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // In Button.tsx
|
|
21
|
+
* warnMissingAriaLabel('Button', iconOnly, !!rest['aria-label']);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function warnMissingAriaLabel(component: string, iconOnly: boolean, hasAriaLabel: boolean): void;
|
|
25
|
+
/**
|
|
26
|
+
* Warn when a component receives a brand prop.
|
|
27
|
+
* Brand should be set globally via ThemeProvider, not on individual components.
|
|
28
|
+
*
|
|
29
|
+
* @param component - Component name (e.g., 'Button')
|
|
30
|
+
* @param hasBrandProp - Whether the component received a brand prop
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // In Button.tsx
|
|
35
|
+
* warnBrandProp('Button', 'brand' in rest);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function warnBrandProp(component: string, hasBrandProp: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Warn when a component receives a theme prop.
|
|
41
|
+
* Theme should be set globally via ThemeProvider, not on individual components.
|
|
42
|
+
*
|
|
43
|
+
* @param component - Component name (e.g., 'Card')
|
|
44
|
+
* @param hasThemeProp - Whether the component received a theme prop
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* // In Card.tsx
|
|
49
|
+
* warnThemeProp('Card', 'theme' in rest);
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function warnThemeProp(component: string, hasThemeProp: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* Warn when glass variant is used outside Display mode.
|
|
55
|
+
* Glass effects only work properly in Display mode.
|
|
56
|
+
*
|
|
57
|
+
* @param component - Component name (e.g., 'Card', 'Navbar')
|
|
58
|
+
* @param variant - The variant being used
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* // In Card.tsx
|
|
63
|
+
* warnGlassVariant('Card', variant);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function warnGlassVariant(component: string, variant: string | undefined): void;
|
|
67
|
+
/**
|
|
68
|
+
* Warn when hardcoded colors are detected in style prop.
|
|
69
|
+
*
|
|
70
|
+
* @param component - Component name
|
|
71
|
+
* @param style - The style object
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* warnHardcodedColors('Button', style);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function warnHardcodedColors(component: string, style: React.CSSProperties | undefined): void;
|
|
79
|
+
/**
|
|
80
|
+
* Warn when Field component might be misused.
|
|
81
|
+
* Called when children are passed to Field (which doesn't support them).
|
|
82
|
+
*
|
|
83
|
+
* @param hasChildren - Whether children were passed
|
|
84
|
+
*/
|
|
85
|
+
export declare function warnFieldChildren(hasChildren: boolean): void;
|
|
86
|
+
/**
|
|
87
|
+
* Warn when a section component is created instead of using pre-built sections.
|
|
88
|
+
* This is for documentation/guidance purposes.
|
|
89
|
+
*
|
|
90
|
+
* @param customComponentName - Name of the custom component being created
|
|
91
|
+
* @param suggestedSection - The pre-built section to use instead
|
|
92
|
+
*/
|
|
93
|
+
export declare function warnUsePrebuiltSection(customComponentName: string, suggestedSection: string): void;
|
|
94
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,OAAO,GACpB,IAAI,CAmBN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,OAAO,GACpB,IAAI,CA4BN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,OAAO,GACpB,IAAI,CA6BN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAsCN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,GACrC,IAAI,CAuCN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CA6B5D;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,MAAM,EAC3B,gBAAgB,EAAE,MAAM,GACvB,IAAI,CA+BN"}
|