@react-hive/honey-style 4.2.0 → 5.1.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.
@@ -1,4 +1,4 @@
1
- import type { HoneyCSSColor, HoneyCSSDimensionUnit, HoneyCSSDimensionValue, HoneyCSSSpacingValue } from '../css';
1
+ import type { HoneyCssColor, HoneyCssDimensionUnit, HoneyCssDimensionValue, HoneyCssSpacingValue } from '../css';
2
2
  import type { Nullable, HoneyTheme, HoneyColorKey, HoneyDimensionName, HoneyFontName, HoneySpacings, HoneyStyledInterpolation } from '../types';
3
3
  import type { HoneyResolveSpacingResult } from '../utils';
4
4
  export interface HoneyStyleContextValue {
@@ -18,7 +18,7 @@ export interface HoneyStyleContextValue {
18
18
  *
19
19
  * @returns The resolved spacing value, formatted as a string with the appropriate unit.
20
20
  */
21
- resolveSpacing: <Value extends HoneyCSSSpacingValue, Unit extends Nullable<HoneyCSSDimensionUnit> = 'px'>(value: Value, unit?: Unit, type?: keyof HoneySpacings) => HoneyResolveSpacingResult<Value, Unit>;
21
+ resolveSpacing: <Value extends HoneyCssSpacingValue, Unit extends Nullable<HoneyCssDimensionUnit> = 'px'>(value: Value, unit?: Unit, type?: keyof HoneySpacings) => HoneyResolveSpacingResult<Value, Unit>;
22
22
  /**
23
23
  * Function to resolve color values based on the theme.
24
24
  *
@@ -27,7 +27,7 @@ export interface HoneyStyleContextValue {
27
27
  *
28
28
  * @returns The resolved CSS color, optionally with alpha transparency.
29
29
  */
30
- resolveColor: (colorKey: HoneyColorKey, alpha?: number) => HoneyCSSColor;
30
+ resolveColor: (colorKey: HoneyColorKey, alpha?: number) => HoneyCssColor;
31
31
  /**
32
32
  * Function to resolve font styles based on the theme.
33
33
  *
@@ -43,6 +43,6 @@ export interface HoneyStyleContextValue {
43
43
  *
44
44
  * @returns The resolved CSS dimension value (e.g., width, height).
45
45
  */
46
- resolveDimension: (dimensionName: HoneyDimensionName) => HoneyCSSDimensionValue;
46
+ resolveDimension: (dimensionName: HoneyDimensionName) => HoneyCssDimensionValue;
47
47
  }
48
48
  export declare const HoneyStyleContext: import("react").Context<HoneyStyleContextValue | undefined>;
@@ -1,5 +1,5 @@
1
1
  import type { Nullable } from '../../types';
2
- import type { HoneyCSSDimensionValue } from '../types';
2
+ import type { HoneyCssDimensionValue } from '../types';
3
3
  /**
4
4
  * Represents CSS resolution units typically used in media queries.
5
5
  *
@@ -17,12 +17,12 @@ type MediaQueryRuleResolutionValue = `${number}${MediaQueryRuleResolutionUnit}`;
17
17
  * Properties for dimension-based media queries
18
18
  */
19
19
  interface MediaQueryRuleDimensionProperties {
20
- width?: HoneyCSSDimensionValue;
21
- minWidth?: HoneyCSSDimensionValue;
22
- maxWidth?: HoneyCSSDimensionValue;
23
- height?: HoneyCSSDimensionValue;
24
- minHeight?: HoneyCSSDimensionValue;
25
- maxHeight?: HoneyCSSDimensionValue;
20
+ width?: HoneyCssDimensionValue;
21
+ minWidth?: HoneyCssDimensionValue;
22
+ maxWidth?: HoneyCssDimensionValue;
23
+ height?: HoneyCssDimensionValue;
24
+ minHeight?: HoneyCssDimensionValue;
25
+ maxHeight?: HoneyCssDimensionValue;
26
26
  }
27
27
  /**
28
28
  * Properties for resolution-based media queries
@@ -1,3 +1,3 @@
1
- import type { HoneyCSSColorProperty, HoneyCSSSpacingProperty } from './types';
2
- export declare const CSS_SPACING_PROPERTIES: readonly HoneyCSSSpacingProperty[];
3
- export declare const CSS_COLOR_PROPERTIES: readonly HoneyCSSColorProperty[];
1
+ import type { HoneyCssColorProperty, HoneyCssSpacingProperty } from './types';
2
+ export declare const CSS_SPACING_PROPERTIES: readonly HoneyCssSpacingProperty[];
3
+ export declare const CSS_COLOR_PROPERTIES: readonly HoneyCssColorProperty[];
@@ -1,11 +1,11 @@
1
1
  import type { HexColor } from '@react-hive/honey-utils';
2
2
  import * as CSS from 'csstype';
3
- export type HoneyCSSClassName = string | undefined;
3
+ export type HoneyCssClassName = string | undefined;
4
4
  /**
5
5
  * Represents any valid CSS color, either a named color (like `'red'`, `'blue'`)
6
6
  * or a hexadecimal color code (like `'#ff0000'`).
7
7
  */
8
- export type HoneyCSSColor = HexColor | CSS.DataType.ColorBase | CSS.Globals;
8
+ export type HoneyCssColor = HexColor | CSS.DataType.ColorBase | CSS.Globals;
9
9
  /**
10
10
  * Represents absolute CSS dimension units.
11
11
  *
@@ -18,7 +18,7 @@ export type HoneyCSSColor = HexColor | CSS.DataType.ColorBase | CSS.Globals;
18
18
  * - `'pt'` — points
19
19
  * - `'pc'` — picas
20
20
  */
21
- type HoneyCSSAbsoluteDimensionUnit = 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
21
+ type HoneyCssAbsoluteDimensionUnit = 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
22
22
  /**
23
23
  * Represents relative CSS dimension units.
24
24
  *
@@ -32,11 +32,11 @@ type HoneyCSSAbsoluteDimensionUnit = 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
32
32
  * - `'vmin'` — 1% of the smaller dimension of the viewport
33
33
  * - `'vmax'` — 1% of the larger dimension of the viewport
34
34
  */
35
- type HoneyCSSRelativeDimensionUnit = 'em' | 'rem' | '%' | 'vh' | 'vw' | 'vmin' | 'vmax';
35
+ type HoneyCssRelativeDimensionUnit = 'em' | 'rem' | '%' | 'vh' | 'vw' | 'vmin' | 'vmax';
36
36
  /**
37
37
  * Represents any valid CSS dimension unit, including both absolute and relative types.
38
38
  */
39
- export type HoneyCSSDimensionUnit = HoneyCSSAbsoluteDimensionUnit | HoneyCSSRelativeDimensionUnit;
39
+ export type HoneyCssDimensionUnit = HoneyCssAbsoluteDimensionUnit | HoneyCssRelativeDimensionUnit;
40
40
  /**
41
41
  * Represents a numeric CSS dimension value with an optional specific unit.
42
42
  *
@@ -46,7 +46,7 @@ export type HoneyCSSDimensionUnit = HoneyCSSAbsoluteDimensionUnit | HoneyCSSRela
46
46
  *
47
47
  * @template Unit - The CSS unit to use (e.g., `'px'`, `'em'`, `'rem'`).
48
48
  */
49
- export type HoneyCSSDimensionValue<Unit extends HoneyCSSDimensionUnit = HoneyCSSDimensionUnit> = `${number}${Unit}` | 'auto';
49
+ export type HoneyCssDimensionValue<Unit extends HoneyCssDimensionUnit = HoneyCssDimensionUnit> = `${number}${Unit}` | 'auto';
50
50
  /**
51
51
  * Represents a tuple of 2 to 4 values using standard CSS shorthand conventions.
52
52
  *
@@ -60,7 +60,7 @@ export type HoneyCSSDimensionValue<Unit extends HoneyCSSDimensionUnit = HoneyCSS
60
60
  *
61
61
  * @template T - The type of each spacing value (e.g., number, string, or token).
62
62
  */
63
- export type HoneyCSSShorthandTuple<T> = [T, T] | [T, T, T] | [T, T, T, T];
63
+ export type HoneyCssShorthandTuple<T> = [T, T] | [T, T, T] | [T, T, T, T];
64
64
  /**
65
65
  * Converts a tuple of spacing values into a valid CSS shorthand string using a consistent unit.
66
66
  *
@@ -77,7 +77,7 @@ export type HoneyCSSShorthandTuple<T> = [T, T] | [T, T, T] | [T, T, T, T];
77
77
  * @template Tuple - A tuple of 2 to 4 values to be converted into a CSS shorthand string.
78
78
  * @template Unit - The CSS unit to apply to each value (e.g., `'px'`, `'rem'`, `'%'`).
79
79
  */
80
- export type HoneyCSSShorthandDimensionOutput<Tuple extends HoneyCSSShorthandTuple<unknown>, Unit extends HoneyCSSDimensionUnit> = Tuple extends [unknown, unknown] ? `${HoneyCSSDimensionValue<Unit>} ${HoneyCSSDimensionValue<Unit>}` : Tuple extends [unknown, unknown, unknown] ? `${HoneyCSSDimensionValue<Unit>} ${HoneyCSSDimensionValue<Unit>} ${HoneyCSSDimensionValue<Unit>}` : Tuple extends [unknown, unknown, unknown, unknown] ? `${HoneyCSSDimensionValue<Unit>} ${HoneyCSSDimensionValue<Unit>} ${HoneyCSSDimensionValue<Unit>} ${HoneyCSSDimensionValue<Unit>}` : never;
80
+ export type HoneyCssShorthandDimensionOutput<Tuple extends HoneyCssShorthandTuple<unknown>, Unit extends HoneyCssDimensionUnit> = Tuple extends [unknown, unknown] ? `${HoneyCssDimensionValue<Unit>} ${HoneyCssDimensionValue<Unit>}` : Tuple extends [unknown, unknown, unknown] ? `${HoneyCssDimensionValue<Unit>} ${HoneyCssDimensionValue<Unit>} ${HoneyCssDimensionValue<Unit>}` : Tuple extends [unknown, unknown, unknown, unknown] ? `${HoneyCssDimensionValue<Unit>} ${HoneyCssDimensionValue<Unit>} ${HoneyCssDimensionValue<Unit>} ${HoneyCssDimensionValue<Unit>}` : never;
81
81
  /**
82
82
  * Represents a CSS layout value that can be a single value or a shorthand array of values.
83
83
  *
@@ -92,7 +92,7 @@ export type HoneyCSSShorthandDimensionOutput<Tuple extends HoneyCSSShorthandTupl
92
92
  *
93
93
  * @template T - The type of each individual value.
94
94
  */
95
- export type HoneyCSSMultiValue<T> = T | HoneyCSSShorthandTuple<T>;
95
+ export type HoneyCssMultiValue<T> = T | HoneyCssShorthandTuple<T>;
96
96
  /**
97
97
  * Represents a spacing value used in layout-related CSS properties.
98
98
  *
@@ -103,21 +103,21 @@ export type HoneyCSSMultiValue<T> = T | HoneyCSSShorthandTuple<T>;
103
103
  *
104
104
  * Commonly used for properties like `margin`, `padding`, `gap`, etc.
105
105
  */
106
- export type HoneyCSSSpacingValue = HoneyCSSMultiValue<number | HoneyCSSDimensionValue>;
107
- export type HoneyRawCSSSpacingValue = number | HoneyCSSDimensionValue | CSS.Globals;
106
+ export type HoneyCssSpacingValue = HoneyCssMultiValue<number | HoneyCssDimensionValue>;
107
+ export type HoneyRawCssSpacingValue = number | HoneyCssDimensionValue | CSS.Globals;
108
108
  /**
109
109
  * Represents CSS properties related to spacing and positioning.
110
110
  */
111
- export type HoneyCSSSpacingProperty = keyof Pick<CSS.Properties, 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'paddingBlock' | 'paddingBlockStart' | 'paddingBlockEnd' | 'top' | 'right' | 'bottom' | 'left' | 'inset' | 'gap' | 'rowGap' | 'columnGap'>;
111
+ export type HoneyCssSpacingProperty = keyof Pick<CSS.Properties, 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'paddingBlock' | 'paddingBlockStart' | 'paddingBlockEnd' | 'top' | 'right' | 'bottom' | 'left' | 'inset' | 'gap' | 'rowGap' | 'columnGap'>;
112
112
  /**
113
113
  * Represents shorthand spacing properties that support multi-value arrays.
114
114
  *
115
115
  * These properties accept 2–4 space-separated values
116
116
  * to control spacing on multiple sides (e.g., top, right, bottom, left).
117
117
  */
118
- export type HoneyCSSShorthandSpacingProperty = keyof Pick<CSS.Properties, 'margin' | 'padding' | 'gap'>;
118
+ export type HoneyCssShorthandSpacingProperty = keyof Pick<CSS.Properties, 'margin' | 'padding' | 'gap'>;
119
119
  /**
120
120
  * Represents a subset of CSS properties that define color-related styles.
121
121
  */
122
- export type HoneyCSSColorProperty = keyof Pick<CSS.Properties, 'color' | 'backgroundColor' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'outlineColor' | 'textDecorationColor' | 'fill' | 'stroke'>;
122
+ export type HoneyCssColorProperty = keyof Pick<CSS.Properties, 'color' | 'backgroundColor' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'outlineColor' | 'textDecorationColor' | 'fill' | 'stroke'>;
123
123
  export {};
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  /*! For license information please see index.cjs.LICENSE.txt */
2
- (()=>{"use strict";var e={131(e,t){var o=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),t.jsx=function(e,t,n){var r=null;if(void 0!==n&&(r=""+n),void 0!==t.key&&(r=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:o,type:e,key:r,ref:void 0!==t?t:null,props:n}}},615(e,t,o){e.exports=o(131)}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{CSS_COLOR_PROPERTIES:()=>$,CSS_SPACING_PROPERTIES:()=>x,HONEY_BREAKPOINTS:()=>l,HONEY_GLOBAL_STYLE_ATTR:()=>i,HONEY_STYLED_COMPONENT_ID_PROP:()=>a,HONEY_STYLE_ATTR:()=>s,HoneyStyleContext:()=>h,HoneyStyleProvider:()=>fe,VALID_DOM_ELEMENT_ATTRS:()=>y,__DEV__:()=>r,checkIsThemeColorValue:()=>ue,combineClassNames:()=>ie,createCssRule:()=>N,createGlobalStyle:()=>ge,css:()=>D,filterNonHtmlAttrs:()=>pe,generateId:()=>ae,isStyledComponent:()=>le,mediaQuery:()=>Z,processCss:()=>re,pxToRem:()=>ce,resolveClassName:()=>se,resolveColor:()=>me,resolveDimension:()=>he,resolveFont:()=>ye,resolveSpacing:()=>de,styled:()=>Se,useHoneyStyle:()=>be});const r=!1;r&&console.info("[@react-hive/honey-style]: You are running in development mode. This build is not optimized for production and may include extra checks or logs.");const a="$$ComponentId",i="data-honey-global-style",s="data-honey-style",l=["xs","sm","md","lg","xl"],p=new Set(["accept","accessKey","autoCapitalize","autoComplete","autoFocus","capture","class","className","contentEditable","contextMenu","dir","draggable","hidden","id","inert","inputMode","is","lang","nonce","part","slot","spellCheck","style","tabIndex","title","translate","unselectable","checked","disabled","form","formAction","formEncType","formMethod","formNoValidate","formTarget","list","max","maxLength","min","minLength","multiple","name","pattern","placeholder","readOnly","required","size","step","type","value","alt","controls","crossOrigin","height","isMap","loop","media","muted","poster","preload","role","src","srcSet","useMap","width","download","href","hrefLang","referrerPolicy","rel","target","dangerouslySetInnerHTML","key","ref","children","char","charOff","exportparts","popover","popoverTarget","popoverTargetAction","virtualkeyboardpolicy","writingsuggestions"]),c=new Set(["colSpan","rowSpan","headers","abbr","scope","align","valign"]),u=new Set(["viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","strokeDasharray","strokeDashoffset","strokeOpacity","fillOpacity","opacity","pointerEvents","focusable","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","d","points","height","transform","xmlns","preserveAspectRatio","mask","clipPath","pathLength","markerStart","markerMid","markerEnd","refX","refY","dominantBaseline","textAnchor"]),d=new Set(["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onBlur","onChange","onInput","onInvalid","onReset","onSubmit","onKeyDown","onKeyPress","onKeyUp","onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError","onTransitionEnd","onTransitionStart","onTransitionRun","onTransitionCancel","onAnimationStart","onAnimationEnd","onAnimationIteration","onAnimationCancel"]),y=new Set([...p,...c,...u,...d]),m=require("react"),h=(0,m.createContext)(void 0);var f=o(615);function b(e,t){if(!e)throw new Error(t)}const g=e=>"string"==typeof e,v=(e,...t)=>"function"==typeof e?e(...t):e,k=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),x=["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","top","right","bottom","left","inset","gap","rowGap","columnGap"],$=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","fill","stroke"],C=e=>"{"===e||"}"===e||":"===e||";"===e||"@"===e||"("===e||'"'===e||"'"===e||"/"===e;function S(e,t){if(!e)throw new Error(t)}const w=e=>{const t=[],o=()=>t.join("").trim();for(;!e.isEof();){const n=e.peek();if(!n)break;switch(n.type){case"braceOpen":case"braceClose":default:return o();case"colon":t.push(":");break;case"text":case"params":t.push(n.value);break;case"string":t.push(`"${n.value}"`)}e.next()}return o()},E=e=>{const t=e.peek();if(!t)return"";if("colon"===t.type)return w(e);const o=e.mark(),n=w(e);return"braceOpen"===e.peek()?.type?n:(e.reset(o),e.readUntil(["colon","braceOpen","semicolon","braceClose","at"]))},O=(e,t)=>{e.expect("colon");const o=e.readUntil(["semicolon","braceClose"]);return"semicolon"===e.peek()?.type&&e.next(),{type:"declaration",prop:t,value:o}},T=(e,t)=>{let o=0,n=0,r=0,a=null,i=!1;for(let s=0;s<e.length;s++){const l=e.charCodeAt(s);if(i)i=!1;else if(92!==l)if(null===a)if(34!==l&&39!==l)if(40!==l)if(41!==l)if(91!==l)if(93!==l){if(44===l&&0===n&&0===r){const n=e.slice(o,s).trim();n&&t(n),o=s+1}}else r--;else r++;else n--;else n++;else a=l;else l===a&&(a=null);else i=!0}const s=e.slice(o).trim();s&&t(s)},P=(e,t)=>{const o=e.trim();if(!o)return"";const n=t.trim();if(!n)return o;const r=-1!==n.indexOf(","),a=-1!==o.indexOf(","),i=-1!==o.indexOf("&");if(!r&&!a)return i?o.replaceAll("&",n):`${n} ${o}`;const s=[];return T(n,e=>{T(o,t=>{t.includes("&")?s.push(t.replaceAll("&",e)):s.push(`${e} ${t}`)})}),s.join(", ")},R=e=>{switch(e.type){case"declaration":return(e=>{const t=e.value.trim();return t?`${e.prop}:${t};`:""})(e);case"rule":return(e=>{const t=e.body.map(R).join("");return t?`${e.selector}{${t}}`:""})(e);case"atRule":return(e=>{const t=e.params?` ${e.params}`:"";if(null===e.body)return`@${e.name}${t};`;const o=e.body.map(R).join("");return o?`@${e.name}${t}{${o}}`:""})(e);default:return""}},A=(e,t)=>(e.expect("braceOpen"),{type:"rule",selector:t,body:M(e)}),_=(e,{stopAtBraceClose:t})=>{const o=[];for(;!e.isEof();){const n=e.peek();if(!n)break;if(t&&"braceClose"===n.type){e.next();break}if("semicolon"===n.type){e.next();continue}if("at"===n.type){o.push(j(e));continue}const r=E(e);r?"colon"!==e.peek()?.type?"braceOpen"!==e.peek()?.type?e.next():o.push(A(e,r)):o.push(O(e,r)):e.next()}return o},M=e=>_(e,{stopAtBraceClose:!0}),j=e=>{e.expect("at");const t=e.readUntil(["semicolon","braceOpen"]),{name:o,params:n}=(e=>{const t=e.trim();if(!t)return{name:"",params:void 0};let o=0;const n=t.length;for(;o<n;){const e=t[o];if(" "===e||"\t"===e||"\n"===e||"\r"===e||"\f"===e||"("===e)break;o++}const r=t.slice(0,o);for(;o<n;){const e=t[o];if(" "!==e&&"\t"!==e&&"\n"!==e&&"\r"!==e&&"\f"!==e)break;o++}return{name:r,params:t.slice(o)||void 0}})(t);let r=n;if("params"===e.peek()?.type){const t=e.expect("params").value;r=r?`${r}${t}`:t}return"braceOpen"===e.peek()?.type?{type:"atRule",name:o,params:r,body:M(e)}:("semicolon"===e.peek()?.type&&e.next(),{type:"atRule",name:o,params:r,body:null})},L=(e,t)=>{return!1===e||(""===(o=e)||(e=>null==e)(o))?"":(e=>"function"==typeof e)(e)?le(e)?`.${e[a]}`:L(e(t),t):(e=>Array.isArray(e))(e)?e.map(e=>L(e,t)).join("\n"):(e=>"object"==typeof e)(e)?Object.entries(e).filter(([,e])=>void 0!==e&&!1!==e).map(([e,t])=>`${k(e)}: ${t};`).join("\n"):e.toString?.()??"";var o},D=(e,...t)=>o=>e.reduce((e,n,r)=>e+n+L(t[r],o),""),N=(e,t)=>`${e}{${t}}`,H={media:!0,supports:!0,container:!0,layer:!0},B=(e,t)=>{const o=t?P(e.selector,t):e.selector;return I(e.body,o)},I=(e,t)=>{const o=[],n=[],r=()=>{t&&0!==n.length&&(o.push({type:"rule",selector:t,body:n.slice()}),n.length=0)};for(let a=0;a<e.length;a++){const i=e[a];if("declaration"!==i.type)if("rule"!==i.type)if("atRule"!==i.type)r(),o.push(i);else{if(r(),!H[i.name]){o.push(i);continue}o.push({...i,body:i.body&&i.body.length>0?I(i.body,t):i.body})}else r(),o.push(...B(i,t));else n.push(i)}return r(),o},U={media:!0,supports:!0,container:!0,layer:!0},W=(e,t)=>e.map(e=>"rule"===e.type?{...e,selector:P(e.selector,t)}:"atRule"===e.type&&U[e.name]?{...e,body:null===e.body?null:W(e.body,t)}:e),z=(e,t)=>o=>{const n=o=>{const r=[];for(const a of o){if("atRule"===a.type&&a.name===e){const e=n(a.body??[]),o=t({...a,body:e});r.push(...o);continue}"rule"!==a.type?"atRule"!==a.type?r.push(a):r.push({...a,body:null===a.body?null:n(a.body)}):r.push({...a,body:n(a.body)})}return r};return{...o,body:n(o.body)}},Y=z("honey-absolute-fill",e=>[{type:"declaration",prop:"position",value:"absolute"},{type:"declaration",prop:"inset",value:"0"},...e.body??[]]),F=e=>{if(!e)return"";const t=e.trim();return t.startsWith("(")&&t.endsWith(")")?t.slice(1,-1).trim():t},G=z("honey-center",e=>{const t=[];switch(F(e.params)){case"horizontal":case"x":t.push({type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"justify-content",value:"center"});break;case"vertical":case"y":t.push({type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"align-items",value:"center"});break;case"block":t.push({type:"declaration",prop:"display",value:"block"},{type:"declaration",prop:"text-align",value:"center"});break;case"inline":t.push({type:"declaration",prop:"display",value:"inline-flex"},{type:"declaration",prop:"align-items",value:"center"},{type:"declaration",prop:"justify-content",value:"center"});break;default:t.push({type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"align-items",value:"center"},{type:"declaration",prop:"justify-content",value:"center"})}return[...t,...e.body??[]]}),K=z("honey-stack",e=>{const t=F(e.params),o=[{type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"flex-direction",value:"column"}];return t&&o.push({type:"declaration",prop:"gap",value:t}),[...o,...e.body??[]]}),V=x.map(k),q=({theme:e})=>{const t=e?.spacings?.base??0,o=e=>e.map(e=>{if("rule"===e.type)return{...e,body:o(e.body)};if("atRule"===e.type)return{...e,body:null===e.body?null:o(e.body)};if("declaration"===e.type){if(!V.includes(e.prop))return e;if(/[()]/.test(e.value))return e;const o=e.value.trim().split(/\s+/);return{...e,value:o.map(e=>((e,t)=>{const o=e.trim();return/[a-z%]+$/i.test(o)?o:/^-?\d*\.?\d+$/.test(o)?parseFloat(o)*t+"px":o})(e,t)).join(" ")}}return e});return e=>({...e,body:o(e.body)})},Q=z("honey-ellipsis",e=>[{type:"declaration",prop:"white-space",value:"nowrap"},{type:"declaration",prop:"overflow",value:"hidden"},{type:"declaration",prop:"text-overflow",value:"ellipsis"},...e.body??[]]),X=z("honey-inline",e=>{const t=F(e.params),o=[{type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"align-items",value:"center"}];return t&&o.push({type:"declaration",prop:"gap",value:t}),[...o,...e.body??[]]}),Z=e=>`@media ${e.map(e=>{const t=[e.width&&["width",e.width],e.minWidth&&["min-width",e.minWidth],e.maxWidth&&["max-width",e.maxWidth],e.height&&["height",e.height],e.minHeight&&["min-height",e.minHeight],e.maxHeight&&["max-height",e.maxHeight],e.orientation&&["orientation",e.orientation],e.minResolution&&["min-resolution",e.minResolution],e.maxResolution&&["max-resolution",e.maxResolution],e.resolution&&["resolution",e.resolution],e.update&&["update",e.update]],o=(r=t,r.filter(Boolean)).map(([e,t])=>`(${e}: ${t})`).join(" and "),n=o?` and ${o}`:"";var r;return`${e.operator?`${e.operator} `:""}${e.mediaType??"screen"}${n}`}).join(", ")}`,J=e=>"portrait"===e||"landscape"===e,ee=e=>"all"===e||"print"===e||"screen"===e||"speech"===e,te=e=>/^[a-z]+\b(:up|:down)?$/i.test(e),oe=e=>{const[t,o]=e.split(":");return{key:t,direction:o??"up"}},ne=({theme:e})=>z("honey-media",t=>{if(!e?.breakpoints)return[];const o=F(t.params);if(!o)return[];const n=o.split(/\s+/);let a=null,i=null;const s=[];for(const t of n){if(J(t)){a=t;continue}if(ee(t)){i=t;continue}if(!te(t)){r&&console.warn(`[@react-hive/honey-style]: Unknown @honey-media token: "${t}".`);continue}const o=oe(t),n=o.key in e.breakpoints?e.breakpoints[o.key]:null;if(!n){r&&console.warn(`[@react-hive/honey-style]: Unknown breakpoint "${o.key}" in @honey-media.`);continue}let l;"up"===o.direction?l={minWidth:`${n}px`}:"down"===o.direction&&(l={maxWidth:`${n}px`}),l&&s.push(l)}let l=[];return s.length?l=s.map(e=>({...e,orientation:a,mediaType:i})):(i&&l.push({mediaType:i}),a&&l.push({orientation:a})),l.length?[{type:"atRule",name:"media",params:Z(l).replace(/^@media\s*/,""),body:t.body}]:[]}),re=(e,{theme:t,selector:o}={})=>{const n=(e=>{const t=(e=>{const t=[];let o=0;const n=()=>o>=e.length,r=()=>n()?void 0:e[o],a=()=>o+1>=e.length?void 0:e[o+1],i=()=>{for(;;){const e=r();if(!e||!/\s/.test(e))return;o++}},s=()=>{if("/"!==r()||"/"!==a())return!1;for(o+=2;!n();){if("\n"===r()){o++;break}o++}return!0},l=()=>{if("/"!==r()||"*"!==a())return!1;for(o+=2;!n();){if("*"===r()&&"/"===a())return o+=2,!0;o++}return!0},p=()=>{const e=r();if(!e)return"";o++;let t="";for(;!n();){const n=r();if(!n)break;if("\\"===n){t+=n,o++;const e=r();e&&(t+=e,o++);continue}if(n===e){o++;break}t+=n,o++}return t},c=()=>{let e=0,t="";for(;!n();){const n=r();if(!n)break;if("("===n?e++:")"===n&&e--,t+=n,o++,0===e)break}return t},u=()=>{let e="";for(;!n();){const t=r();if(!t)break;if(C(t))break;e+=t,o++}return e.trim()};for(;!n()&&(i(),!n());){if(s()||l())continue;const e=r();if(!e)break;if("{"===e){t.push({type:"braceOpen"}),o++;continue}if("}"===e){t.push({type:"braceClose"}),o++;continue}if(":"===e){t.push({type:"colon"}),o++;continue}if(";"===e){t.push({type:"semicolon"}),o++;continue}if("@"===e){t.push({type:"at"}),o++;continue}if("("===e){t.push({type:"params",value:c()});continue}if('"'===e||"'"===e){t.push({type:"string",value:p()});continue}const n=u();n?t.push({type:"text",value:n}):o++}return t})(e),o=(e=>{let t=0;const o=()=>t>=e.length,n=()=>o()?void 0:e[t],r=()=>o()?void 0:e[t++];return{isEof:o,peek:n,next:r,mark:()=>t,reset:e=>{t=e},expect:e=>{const t=r();return S(t,`[@react-hive/honey-css]: Expected "${e}" but reached end of input.`),S(t.type===e,`[@react-hive/honey-css]: Expected "${e}" but got "${t.type}".`),t},readUntil:e=>{let t,a="";for(;!o();){const o=n();if(!o||e.includes(o.type))break;"text"===o.type?("text"===t&&a&&(a+=" "),a+=o.value):"string"===o.type?a+=`"${o.value}"`:"params"===o.type&&(a+=o.value),t=o.type,r()}return a.trim()},skipUntil:e=>{for(;!o();){const t=n();if(!t||e.includes(t.type))break;r()}}}})(t);return{type:"stylesheet",body:_(o,{stopAtBraceClose:!1})}})(o?N(o,e):e);return((e,t)=>{const o=(e=>({...e,body:I(e.body)}))(t?{...e,body:W(e.body,t)}:e);return o.body.map(R).filter(Boolean).join("")})([K,X,G,Y,Q,ne({theme:t}),q({theme:t})].reduce((e,t)=>t(e),n))},ae=e=>`${e}-${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,ie=e=>e.filter(Boolean).join(" ").trim(),se=e=>`hscn-${(e=>{let t=5381;for(let o=0;o<e.length;o++)t=33*t^e.charCodeAt(o);return(t>>>0).toString(36)})(e)}`,le=e=>a in e,pe=e=>Object.entries(e).reduce((e,[t,o])=>((y.has(t)||t.startsWith("data-")||t.startsWith("aria-"))&&(e[t]=o),e),{}),ce=(e,t=16)=>e/t+"rem",ue=e=>2===e.split(".").length,de=(e,t="px",o="base")=>({theme:n})=>{if("string"==typeof e)return e;const r=n.spacings[o]??0;if("number"==typeof e){const o=e*r;return t?`${o}${t}`:o}return e.map(e=>{if("string"==typeof e)return e;const o=e*r;return t?`${o}${t}`:o}).join(" ")},ye=e=>({theme:t})=>{const o=t.fonts[e];return D`
2
+ (()=>{"use strict";var e={131(e,t){var o=Symbol.for("react.transitional.element");Symbol.for("react.fragment"),t.jsx=function(e,t,n){var r=null;if(void 0!==n&&(r=""+n),void 0!==t.key&&(r=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:o,type:e,key:r,ref:void 0!==t?t:null,props:n}}},615(e,t,o){e.exports=o(131)}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{CSS_COLOR_PROPERTIES:()=>$,CSS_SPACING_PROPERTIES:()=>x,HONEY_BREAKPOINTS:()=>l,HONEY_GLOBAL_STYLE_ATTR:()=>i,HONEY_STYLED_COMPONENT_ID_PROP:()=>a,HONEY_STYLE_ATTR:()=>s,HoneyStyleContext:()=>h,HoneyStyleProvider:()=>fe,VALID_DOM_ELEMENT_ATTRS:()=>y,__DEV__:()=>r,combineClassNames:()=>ie,createCssRule:()=>N,createGlobalStyle:()=>ge,css:()=>D,filterNonHtmlAttrs:()=>pe,generateId:()=>ae,isStyledComponent:()=>le,isThemeColorValue:()=>ue,mediaQuery:()=>Z,processCss:()=>re,pxToRem:()=>ce,resolveClassName:()=>se,resolveColor:()=>me,resolveDimension:()=>he,resolveFont:()=>ye,resolveSpacing:()=>de,styled:()=>Se,useHoneyStyle:()=>be});const r=!1;r&&console.info("[@react-hive/honey-style]: You are running in development mode. This build is not optimized for production and may include extra checks or logs.");const a="$$ComponentId",i="data-honey-global-style",s="data-honey-style",l=["xs","sm","md","lg","xl"],p=new Set(["accept","accessKey","autoCapitalize","autoComplete","autoFocus","capture","class","className","contentEditable","contextMenu","dir","draggable","hidden","id","inert","inputMode","is","lang","nonce","part","slot","spellCheck","style","tabIndex","title","translate","unselectable","checked","disabled","form","formAction","formEncType","formMethod","formNoValidate","formTarget","list","max","maxLength","min","minLength","multiple","name","pattern","placeholder","readOnly","required","size","step","type","value","alt","controls","crossOrigin","height","isMap","loop","media","muted","poster","preload","role","src","srcSet","useMap","width","download","href","hrefLang","referrerPolicy","rel","target","dangerouslySetInnerHTML","key","ref","children","char","charOff","exportparts","popover","popoverTarget","popoverTargetAction","virtualkeyboardpolicy","writingsuggestions"]),c=new Set(["colSpan","rowSpan","headers","abbr","scope","align","valign"]),u=new Set(["viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","strokeDasharray","strokeDashoffset","strokeOpacity","fillOpacity","opacity","pointerEvents","focusable","x","y","x1","x2","y1","y2","cx","cy","r","rx","ry","d","points","height","transform","xmlns","preserveAspectRatio","mask","clipPath","pathLength","markerStart","markerMid","markerEnd","refX","refY","dominantBaseline","textAnchor"]),d=new Set(["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onBlur","onChange","onInput","onInvalid","onReset","onSubmit","onKeyDown","onKeyPress","onKeyUp","onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError","onTransitionEnd","onTransitionStart","onTransitionRun","onTransitionCancel","onAnimationStart","onAnimationEnd","onAnimationIteration","onAnimationCancel"]),y=new Set([...p,...c,...u,...d]),m=require("react"),h=(0,m.createContext)(void 0);var f=o(615);function b(e,t){if(!e)throw new Error(t)}const g=e=>"string"==typeof e,v=(e,...t)=>"function"==typeof e?e(...t):e,k=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),x=["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","top","right","bottom","left","inset","gap","rowGap","columnGap"],$=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","fill","stroke"],C=e=>"{"===e||"}"===e||":"===e||";"===e||"@"===e||"("===e||'"'===e||"'"===e||"/"===e;function S(e,t){if(!e)throw new Error(t)}const w=e=>{const t=[],o=()=>t.join("").trim();for(;!e.isEof();){const n=e.peek();if(!n)break;switch(n.type){case"braceOpen":case"braceClose":default:return o();case"colon":t.push(":");break;case"text":case"params":t.push(n.value);break;case"string":t.push(`"${n.value}"`)}e.next()}return o()},E=e=>{const t=e.peek();if(!t)return"";if("colon"===t.type)return w(e);const o=e.mark(),n=w(e);return"braceOpen"===e.peek()?.type?n:(e.reset(o),e.readUntil(["colon","braceOpen","semicolon","braceClose","at"]))},O=(e,t)=>{e.expect("colon");const o=e.readUntil(["semicolon","braceClose"]);return"semicolon"===e.peek()?.type&&e.next(),{type:"declaration",prop:t,value:o}},T=(e,t)=>{let o=0,n=0,r=0,a=null,i=!1;for(let s=0;s<e.length;s++){const l=e.charCodeAt(s);if(i)i=!1;else if(92!==l)if(null===a)if(34!==l&&39!==l)if(40!==l)if(41!==l)if(91!==l)if(93!==l){if(44===l&&0===n&&0===r){const n=e.slice(o,s).trim();n&&t(n),o=s+1}}else r--;else r++;else n--;else n++;else a=l;else l===a&&(a=null);else i=!0}const s=e.slice(o).trim();s&&t(s)},P=(e,t)=>{const o=e.trim();if(!o)return"";const n=t.trim();if(!n)return o;const r=-1!==n.indexOf(","),a=-1!==o.indexOf(","),i=-1!==o.indexOf("&");if(!r&&!a)return i?o.replaceAll("&",n):`${n} ${o}`;const s=[];return T(n,e=>{T(o,t=>{t.includes("&")?s.push(t.replaceAll("&",e)):s.push(`${e} ${t}`)})}),s.join(", ")},R=e=>{switch(e.type){case"declaration":return(e=>{const t=e.value.trim();return t?`${e.prop}:${t};`:""})(e);case"rule":return(e=>{const t=e.body.map(R).join("");return t?`${e.selector}{${t}}`:""})(e);case"atRule":return(e=>{const t=e.params?` ${e.params}`:"";if(null===e.body)return`@${e.name}${t};`;const o=e.body.map(R).join("");return o?`@${e.name}${t}{${o}}`:""})(e);default:return""}},A=(e,t)=>(e.expect("braceOpen"),{type:"rule",selector:t,body:M(e)}),_=(e,{stopAtBraceClose:t})=>{const o=[];for(;!e.isEof();){const n=e.peek();if(!n)break;if(t&&"braceClose"===n.type){e.next();break}if("semicolon"===n.type){e.next();continue}if("at"===n.type){o.push(j(e));continue}const r=E(e);r?"colon"!==e.peek()?.type?"braceOpen"!==e.peek()?.type?e.next():o.push(A(e,r)):o.push(O(e,r)):e.next()}return o},M=e=>_(e,{stopAtBraceClose:!0}),j=e=>{e.expect("at");const t=e.readUntil(["semicolon","braceOpen"]),{name:o,params:n}=(e=>{const t=e.trim();if(!t)return{name:"",params:void 0};let o=0;const n=t.length;for(;o<n;){const e=t[o];if(" "===e||"\t"===e||"\n"===e||"\r"===e||"\f"===e||"("===e)break;o++}const r=t.slice(0,o);for(;o<n;){const e=t[o];if(" "!==e&&"\t"!==e&&"\n"!==e&&"\r"!==e&&"\f"!==e)break;o++}return{name:r,params:t.slice(o)||void 0}})(t);let r=n;if("params"===e.peek()?.type){const t=e.expect("params").value;r=r?`${r}${t}`:t}return"braceOpen"===e.peek()?.type?{type:"atRule",name:o,params:r,body:M(e)}:("semicolon"===e.peek()?.type&&e.next(),{type:"atRule",name:o,params:r,body:null})},L=(e,t)=>{return!1===e||(""===(o=e)||(e=>null==e)(o))?"":(e=>"function"==typeof e)(e)?le(e)?`.${e[a]}`:L(e(t),t):(e=>Array.isArray(e))(e)?e.map(e=>L(e,t)).join("\n"):(e=>"object"==typeof e)(e)?Object.entries(e).filter(([,e])=>void 0!==e&&!1!==e).map(([e,t])=>`${k(e)}: ${t};`).join("\n"):e.toString?.()??"";var o},D=(e,...t)=>o=>e.reduce((e,n,r)=>e+n+L(t[r],o),""),N=(e,t)=>`${e}{${t}}`,H={media:!0,supports:!0,container:!0,layer:!0},B=(e,t)=>{const o=t?P(e.selector,t):e.selector;return I(e.body,o)},I=(e,t)=>{const o=[],n=[],r=()=>{t&&0!==n.length&&(o.push({type:"rule",selector:t,body:n.slice()}),n.length=0)};for(let a=0;a<e.length;a++){const i=e[a];if("declaration"!==i.type)if("rule"!==i.type)if("atRule"!==i.type)r(),o.push(i);else{if(r(),!H[i.name]){o.push(i);continue}o.push({...i,body:i.body&&i.body.length>0?I(i.body,t):i.body})}else r(),o.push(...B(i,t));else n.push(i)}return r(),o},U={media:!0,supports:!0,container:!0,layer:!0},W=(e,t)=>e.map(e=>"rule"===e.type?{...e,selector:P(e.selector,t)}:"atRule"===e.type&&U[e.name]?{...e,body:null===e.body?null:W(e.body,t)}:e),z=(e,t)=>o=>{const n=o=>{const r=[];for(const a of o){if("atRule"===a.type&&a.name===e){const e=n(a.body??[]),o=t({...a,body:e});r.push(...o);continue}"rule"!==a.type?"atRule"!==a.type?r.push(a):r.push({...a,body:null===a.body?null:n(a.body)}):r.push({...a,body:n(a.body)})}return r};return{...o,body:n(o.body)}},Y=z("honey-absolute-fill",e=>[{type:"declaration",prop:"position",value:"absolute"},{type:"declaration",prop:"inset",value:"0"},...e.body??[]]),F=e=>{if(!e)return"";const t=e.trim();return t.startsWith("(")&&t.endsWith(")")?t.slice(1,-1).trim():t},G=z("honey-center",e=>{const t=[];switch(F(e.params)){case"horizontal":case"x":t.push({type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"justify-content",value:"center"});break;case"vertical":case"y":t.push({type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"align-items",value:"center"});break;case"block":t.push({type:"declaration",prop:"display",value:"block"},{type:"declaration",prop:"text-align",value:"center"});break;case"inline":t.push({type:"declaration",prop:"display",value:"inline-flex"},{type:"declaration",prop:"align-items",value:"center"},{type:"declaration",prop:"justify-content",value:"center"});break;default:t.push({type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"align-items",value:"center"},{type:"declaration",prop:"justify-content",value:"center"})}return[...t,...e.body??[]]}),K=z("honey-stack",e=>{const t=F(e.params),o=[{type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"flex-direction",value:"column"}];return t&&o.push({type:"declaration",prop:"gap",value:t}),[...o,...e.body??[]]}),V=x.map(k),q=({theme:e})=>{const t=e?.spacings?.base??0,o=e=>e.map(e=>{if("rule"===e.type)return{...e,body:o(e.body)};if("atRule"===e.type)return{...e,body:null===e.body?null:o(e.body)};if("declaration"===e.type){if(!V.includes(e.prop))return e;if(/[()]/.test(e.value))return e;const o=e.value.trim().split(/\s+/);return{...e,value:o.map(e=>((e,t)=>{const o=e.trim();return/[a-z%]+$/i.test(o)?o:/^-?\d*\.?\d+$/.test(o)?parseFloat(o)*t+"px":o})(e,t)).join(" ")}}return e});return e=>({...e,body:o(e.body)})},Q=z("honey-ellipsis",e=>[{type:"declaration",prop:"white-space",value:"nowrap"},{type:"declaration",prop:"overflow",value:"hidden"},{type:"declaration",prop:"text-overflow",value:"ellipsis"},...e.body??[]]),X=z("honey-inline",e=>{const t=F(e.params),o=[{type:"declaration",prop:"display",value:"flex"},{type:"declaration",prop:"align-items",value:"center"}];return t&&o.push({type:"declaration",prop:"gap",value:t}),[...o,...e.body??[]]}),Z=e=>`@media ${e.map(e=>{const t=[e.width&&["width",e.width],e.minWidth&&["min-width",e.minWidth],e.maxWidth&&["max-width",e.maxWidth],e.height&&["height",e.height],e.minHeight&&["min-height",e.minHeight],e.maxHeight&&["max-height",e.maxHeight],e.orientation&&["orientation",e.orientation],e.minResolution&&["min-resolution",e.minResolution],e.maxResolution&&["max-resolution",e.maxResolution],e.resolution&&["resolution",e.resolution],e.update&&["update",e.update]],o=(r=t,r.filter(Boolean)).map(([e,t])=>`(${e}: ${t})`).join(" and "),n=o?` and ${o}`:"";var r;return`${e.operator?`${e.operator} `:""}${e.mediaType??"screen"}${n}`}).join(", ")}`,J=e=>"portrait"===e||"landscape"===e,ee=e=>"all"===e||"print"===e||"screen"===e||"speech"===e,te=e=>/^[a-z]+\b(:up|:down)?$/i.test(e),oe=e=>{const[t,o]=e.split(":");return{key:t,direction:o??"up"}},ne=({theme:e})=>z("honey-media",t=>{if(!e?.breakpoints)return[];const o=F(t.params);if(!o)return[];const n=o.split(/\s+/);let a=null,i=null;const s=[];for(const t of n){if(J(t)){a=t;continue}if(ee(t)){i=t;continue}if(!te(t)){r&&console.warn(`[@react-hive/honey-style]: Unknown @honey-media token: "${t}".`);continue}const o=oe(t),n=o.key in e.breakpoints?e.breakpoints[o.key]:null;if(!n){r&&console.warn(`[@react-hive/honey-style]: Unknown breakpoint "${o.key}" in @honey-media.`);continue}let l;"up"===o.direction?l={minWidth:`${n}px`}:"down"===o.direction&&(l={maxWidth:`${n}px`}),l&&s.push(l)}let l=[];return s.length?l=s.map(e=>({...e,orientation:a,mediaType:i})):(i&&l.push({mediaType:i}),a&&l.push({orientation:a})),l.length?[{type:"atRule",name:"media",params:Z(l).replace(/^@media\s*/,""),body:t.body}]:[]}),re=(e,{theme:t,selector:o}={})=>{const n=(e=>{const t=(e=>{const t=[];let o=0;const n=()=>o>=e.length,r=()=>n()?void 0:e[o],a=()=>o+1>=e.length?void 0:e[o+1],i=()=>{for(;;){const e=r();if(!e||!/\s/.test(e))return;o++}},s=()=>{if("/"!==r()||"/"!==a())return!1;for(o+=2;!n();){if("\n"===r()){o++;break}o++}return!0},l=()=>{if("/"!==r()||"*"!==a())return!1;for(o+=2;!n();){if("*"===r()&&"/"===a())return o+=2,!0;o++}return!0},p=()=>{const e=r();if(!e)return"";o++;let t="";for(;!n();){const n=r();if(!n)break;if("\\"===n){t+=n,o++;const e=r();e&&(t+=e,o++);continue}if(n===e){o++;break}t+=n,o++}return t},c=()=>{let e=0,t="";for(;!n();){const n=r();if(!n)break;if("("===n?e++:")"===n&&e--,t+=n,o++,0===e)break}return t},u=()=>{let e="";for(;!n();){const t=r();if(!t)break;if(C(t))break;e+=t,o++}return e.trim()};for(;!n()&&(i(),!n());){if(s()||l())continue;const e=r();if(!e)break;if("{"===e){t.push({type:"braceOpen"}),o++;continue}if("}"===e){t.push({type:"braceClose"}),o++;continue}if(":"===e){t.push({type:"colon"}),o++;continue}if(";"===e){t.push({type:"semicolon"}),o++;continue}if("@"===e){t.push({type:"at"}),o++;continue}if("("===e){t.push({type:"params",value:c()});continue}if('"'===e||"'"===e){t.push({type:"string",value:p()});continue}const n=u();n?t.push({type:"text",value:n}):o++}return t})(e),o=(e=>{let t=0;const o=()=>t>=e.length,n=()=>o()?void 0:e[t],r=()=>o()?void 0:e[t++];return{isEof:o,peek:n,next:r,mark:()=>t,reset:e=>{t=e},expect:e=>{const t=r();return S(t,`[@react-hive/honey-css]: Expected "${e}" but reached end of input.`),S(t.type===e,`[@react-hive/honey-css]: Expected "${e}" but got "${t.type}".`),t},readUntil:e=>{let t,a="";for(;!o();){const o=n();if(!o||e.includes(o.type))break;"text"===o.type?("text"===t&&a&&(a+=" "),a+=o.value):"string"===o.type?a+=`"${o.value}"`:"params"===o.type&&(a+=o.value),t=o.type,r()}return a.trim()},skipUntil:e=>{for(;!o();){const t=n();if(!t||e.includes(t.type))break;r()}}}})(t);return{type:"stylesheet",body:_(o,{stopAtBraceClose:!1})}})(o?N(o,e):e);return((e,t)=>{const o=(e=>({...e,body:I(e.body)}))(t?{...e,body:W(e.body,t)}:e);return o.body.map(R).filter(Boolean).join("")})([K,X,G,Y,Q,ne({theme:t}),q({theme:t})].reduce((e,t)=>t(e),n))},ae=e=>`${e}-${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,ie=e=>e.filter(Boolean).join(" ").trim(),se=e=>`hscn-${(e=>{let t=5381;for(let o=0;o<e.length;o++)t=33*t^e.charCodeAt(o);return(t>>>0).toString(36)})(e)}`,le=e=>a in e,pe=e=>Object.entries(e).reduce((e,[t,o])=>((y.has(t)||t.startsWith("data-")||t.startsWith("aria-"))&&(e[t]=o),e),{}),ce=(e,t=16)=>e/t+"rem",ue=e=>2===e.split(".").length,de=(e,t="px",o="base")=>({theme:n})=>{if("string"==typeof e)return e;const r=n.spacings[o]??0;if("number"==typeof e){const o=e*r;return t?`${o}${t}`:o}return e.map(e=>{if("string"==typeof e)return e;const o=e*r;return t?`${o}${t}`:o}).join(" ")},ye=e=>({theme:t})=>{const o=t.fonts[e];return D`
3
3
  font-family: ${o.family};
4
4
  font-size: ${ce(o.size)};
5
5
  font-weight: ${o.weight};
6
6
  line-height: ${void 0!==o.lineHeight&&ce(o.lineHeight)};
7
7
  letter-spacing: ${void 0!==o.letterSpacing&&ce(o.letterSpacing)};
8
- `},me=(e,t)=>({theme:o})=>{const[n,r]=e.split("."),a=r?o.colors[n][r]:n;return void 0===t?a:((e,t)=>{b(t>=0&&t<=1,`[@react-hive/honey-utils]: Alpha "${t}" must be a number between 0 and 1.`);const o=e.match(/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/);b(o,`[@react-hive/honey-utils]: Invalid hex format: ${e}`);const n=o[1];return`#${(3===n.length?n[0]+n[0]+n[1]+n[1]+n[2]+n[2]:n)+Math.round(255*t).toString(16).toUpperCase().padStart(2,"0")}`})(a,t)},he=e=>({theme:t})=>t.dimensions[e],fe=({children:e,theme:t})=>{const o=(0,m.useMemo)(()=>({theme:t,resolveSpacing:(...e)=>de(...e)({theme:t}),resolveColor:(...e)=>me(...e)({theme:t}),resolveFont:(...e)=>ye(...e)({theme:t}),resolveDimension:(...e)=>he(...e)({theme:t})}),[t]);return(0,f.jsx)(h,{value:o,children:e})},be=()=>{const e=(0,m.useContext)(h);return b(e,"The `useHoneyStyle()` hook must be used inside <HoneyStyleProvider/> component!"),e},ge=(e,...t)=>{const o=ae("hsg"),n=D(e,...t);return()=>{const{theme:e}=be();return(0,m.useInsertionEffect)(()=>{const t=n({theme:e}),r=re(t,{theme:e}),a=document.createElement("style");return a.id=o,a.innerHTML=r,a.setAttribute(i,"true"),document.head.insertBefore(a,document.head.firstChild),()=>{a.remove()}},[e]),null}},ve=(window.__honeyStyleRegistry||(window.__honeyStyleRegistry=new Map),window.__honeyStyleRegistry);let ke=null;const xe=()=>{const e=(ke||(ke=document.querySelector(`style[${s}="true"]`),ke||(ke=document.createElement("style"),ke.setAttribute(s,"true"),document.head.appendChild(ke))),ke),t=Array.from(ve.entries()).sort(([,e],[,t])=>e.priority-t.priority).map(([,e])=>e.css).join("\n");e.textContent=t},$e=e=>()=>{const t=ve.get(e);t&&(t.usages--,t.usages<=0&&(ve.delete(e),xe()))},Ce=(e,t,o=0)=>{const n=ve.get(e);return n?(n.usages++,$e(e)):(ve.set(e,{css:t,priority:o,usages:1}),xe(),$e(e))},Se=(e,t,{omitProps:o}={})=>(n,...i)=>{const s=ae("hsc"),l=D(n,...i),p=({as:n,className:a,__compositionDepth:i=0,css:p,...c})=>{r&&p&&console.warn('[@react-hive/honey-style]: The "css" prop is deprecated. Please use inheritance or composition instead.');const{theme:u}=be(),d=(k=c,Object.entries(k).reduce((e,[t,o])=>(void 0!==o&&(e[t]=o),e),{})),y={...v(t,{theme:u,as:n,className:a,...d})??{},...a&&{className:a}},h={...y,...d,theme:u},f=l(h),b=se(f);var k;(0,m.useInsertionEffect)(()=>{const e=re(f,{theme:u,selector:`.${b}`});return Ce(b,e,i)},[b]);const x=((e,t)=>e?g(e)?e:D([""],[e])(t):"")(v(p,h),h),$=x?se(x):"";(0,m.useInsertionEffect)(()=>{if($){const e=re(x,{theme:u,selector:`.${$}`});return Ce($,e,1)}},[$]);const C=ie([s,b,y.className,$]),S={...y,...d,className:C},w=o?Object.entries(S).reduce((e,[t,n])=>o(t)?e:{...e,[t]:n},{}):S,E=n||e;if(g(e)){const e=g(E)?pe(w):w;return(0,m.createElement)(E,e)}return(0,m.createElement)(e,{...w,...n&&{as:n},...le(e)&&{__compositionDepth:i-1}})};if(p[a]=s,r){const t=g(e)?e:e.displayName||e.name||"Component";p.displayName=`HoneyStyledComponent(${t})`}return p};module.exports=n})();
8
+ `},me=(e,t)=>({theme:o})=>{const[n,r]=e.split("."),a=r?o.colors[n][r]:n;return void 0===t?a:((e,t)=>{b(t>=0&&t<=1,`[@react-hive/honey-utils]: Alpha "${t}" must be a number between 0 and 1.`);const o=e.match(/^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/);b(o,`[@react-hive/honey-utils]: Invalid hex format: ${e}`);const n=o[1];return`#${(3===n.length?n[0]+n[0]+n[1]+n[1]+n[2]+n[2]:n)+Math.round(255*t).toString(16).toUpperCase().padStart(2,"0")}`})(a,t)},he=e=>({theme:t})=>t.dimensions[e],fe=({children:e,theme:t})=>{const o=(0,m.useMemo)(()=>({theme:t,resolveSpacing:(...e)=>de(...e)({theme:t}),resolveColor:(...e)=>me(...e)({theme:t}),resolveFont:(...e)=>ye(...e)({theme:t}),resolveDimension:(...e)=>he(...e)({theme:t})}),[t]);return(0,f.jsx)(h,{value:o,children:e})},be=()=>{const e=(0,m.useContext)(h);return b(e,"The `useHoneyStyle()` hook must be used inside <HoneyStyleProvider/> component!"),e},ge=(e,...t)=>{const o=ae("hsg"),n=D(e,...t);return()=>{const{theme:e}=be();return(0,m.useInsertionEffect)(()=>{const t=n({theme:e}),r=re(t,{theme:e}),a=document.createElement("style");return a.id=o,a.innerHTML=r,a.setAttribute(i,"true"),document.head.insertBefore(a,document.head.firstChild),()=>{a.remove()}},[e]),null}},ve=(window.__honeyStyleRegistry||(window.__honeyStyleRegistry=new Map),window.__honeyStyleRegistry);let ke=null;const xe=()=>{const e=(ke||(ke=document.querySelector(`style[${s}="true"]`),ke||(ke=document.createElement("style"),ke.setAttribute(s,"true"),document.head.appendChild(ke))),ke),t=Array.from(ve.entries()).sort(([,e],[,t])=>e.priority-t.priority).map(([,e])=>e.css).join("\n");e.textContent=t},$e=e=>()=>{const t=ve.get(e);t&&(t.usages--,t.usages<=0&&(ve.delete(e),xe()))},Ce=(e,t,o=0)=>{const n=ve.get(e);return n?(n.usages++,$e(e)):(ve.set(e,{css:t,priority:o,usages:1}),xe(),$e(e))},Se=(e,t,{omitProps:o}={})=>(n,...i)=>{const s=ae("hsc"),l=D(n,...i),p=({as:n,className:a,__compositionDepth:i=0,css:p,...c})=>{r&&p&&console.warn('[@react-hive/honey-style]: The "css" prop is deprecated. Please use inheritance or composition instead.');const{theme:u}=be(),d=(k=c,Object.entries(k).reduce((e,[t,o])=>(void 0!==o&&(e[t]=o),e),{})),y={...v(t,{theme:u,as:n,className:a,...d})??{},...a&&{className:a}},h={...y,...d,theme:u},f=l(h),b=se(f);var k;(0,m.useInsertionEffect)(()=>{const e=re(f,{theme:u,selector:`.${b}`});return Ce(b,e,i)},[b]);const x=((e,t)=>e?g(e)?e:D([""],[e])(t):"")(v(p,h),h),$=x?se(x):"";(0,m.useInsertionEffect)(()=>{if($){const e=re(x,{theme:u,selector:`.${$}`});return Ce($,e,1)}},[$]);const C=ie([s,y.className,b,$]),S={...y,...d,className:C},w=o?Object.entries(S).reduce((e,[t,n])=>o(t)?e:{...e,[t]:n},{}):S,E=n||e;if(g(e)){const e=g(E)?pe(w):w;return(0,m.createElement)(E,e)}return(0,m.createElement)(e,{...w,...n&&{as:n},...le(e)&&{__compositionDepth:i-1}})};if(p[a]=s,r){const t=g(e)?e:e.displayName||e.name||"Component";p.displayName=`HoneyStyledComponent(${t})`}return p};module.exports=n})();
9
9
  //# sourceMappingURL=index.cjs.map