jattac.libs.web.zest-button 1.2.6 → 1.2.8

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/index.esm.js CHANGED
@@ -1389,18 +1389,18 @@ var styles = {"force-light":"ZestButton-module_force-light__zZTIZ","force-dark":
1389
1389
  styleInject(css_248z);
1390
1390
 
1391
1391
  // Create the Zest Context with a default empty configuration
1392
- const ZestContext = require$$0.createContext(undefined);
1392
+ const ZestButtonConfigContext = require$$0.createContext(undefined);
1393
1393
  // Custom hook to use the Zest Context
1394
- const useZest = () => {
1395
- const context = useContext(ZestContext);
1394
+ const useZestButtonConfig = () => {
1395
+ const context = useContext(ZestButtonConfigContext);
1396
1396
  // Optional: Add a check here if context is undefined, meaning provider is not used
1397
1397
  // if (context === undefined) {
1398
- // console.warn("useZest must be used within a ZestProvider. Falling back to default ZestButton props.");
1398
+ // console.warn("useZestButtonConfig must be used within a ZestButtonConfigProvider. Falling back to default ZestButton props.");
1399
1399
  // }
1400
1400
  return context;
1401
1401
  };
1402
1402
 
1403
- const semanticTypeDefaults = {
1403
+ const semanticTypeButtonConfigDefaults = {
1404
1404
  // Creation / Add
1405
1405
  'add': {
1406
1406
  visualOptions: {
@@ -1571,7 +1571,7 @@ const deepMerge = (target, source) => {
1571
1571
  return output;
1572
1572
  };
1573
1573
  const useZestConfig = (localZestProps) => {
1574
- const globalConfig = useZest();
1574
+ const globalConfig = useZestButtonConfig();
1575
1575
  const globalDefaultProps = globalConfig?.defaultProps;
1576
1576
  const customSemanticDefaults = globalConfig?.semanticTypeDefaults;
1577
1577
  // 1. Start with global defaults (lowest precedence)
@@ -1580,8 +1580,8 @@ const useZestConfig = (localZestProps) => {
1580
1580
  const semanticType = localZestProps?.semanticType || effectiveZestConfig.semanticType;
1581
1581
  if (semanticType) {
1582
1582
  // 2. Apply built-in semantic defaults
1583
- if (semanticTypeDefaults[semanticType]) {
1584
- effectiveZestConfig = deepMerge(effectiveZestConfig, semanticTypeDefaults[semanticType]);
1583
+ if (semanticTypeButtonConfigDefaults[semanticType]) {
1584
+ effectiveZestConfig = deepMerge(effectiveZestConfig, semanticTypeButtonConfigDefaults[semanticType]);
1585
1585
  }
1586
1586
  // 3. Apply custom semantic defaults from provider (overrides built-in ones)
1587
1587
  if (customSemanticDefaults && customSemanticDefaults[semanticType]) {
@@ -1849,9 +1849,9 @@ const ZestButton = ({ className = "", disabled, children, onClick, zest: localZe
1849
1849
  ].join(" "), disabled: isDisabled, "aria-busy": effectiveBusy, onClick: handleConfirmClick, ...props, children: jsxRuntimeExports.jsxs("span", { className: styles.inner, children: [renderLeftIcon(), jsxRuntimeExports.jsxs("span", { className: styles.content, children: [currentChildren, iconRight && jsxRuntimeExports.jsx("span", { className: styles.icon, children: iconRight })] })] }) }));
1850
1850
  };
1851
1851
 
1852
- const ZestProvider = ({ config, children }) => {
1853
- return (jsxRuntimeExports.jsx(ZestContext.Provider, { value: config, children: children }));
1852
+ const ZestButtonConfigProvider = ({ config, children }) => {
1853
+ return (jsxRuntimeExports.jsx(ZestButtonConfigContext.Provider, { value: config, children: children }));
1854
1854
  };
1855
1855
 
1856
- export { ZestButton, ZestProvider, useZest };
1856
+ export { ZestButton, ZestButtonConfigProvider, useZestButtonConfig };
1857
1857
  //# sourceMappingURL=index.esm.js.map