@stackshift-ui/checkbox-group 7.0.0-beta.1 → 7.0.0-beta.3
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/checkbox-group.js +1 -1
- package/dist/checkbox-group.mjs +1 -1
- package/dist/chunk-4O7QC542.mjs +1 -0
- package/dist/chunk-6DZX6EAA.mjs +37 -0
- package/dist/chunk-V62CKPYQ.mjs +39 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/setupTests.js +36 -40
- package/dist/setupTests.mjs +34 -38
- package/package.json +6 -6
- package/src/checkbox-group.tsx +2 -1
- package/dist/chunk-XEYIWPWZ.mjs +0 -1
package/dist/checkbox-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var V=Object.create;var r=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var P=(e,a)=>{for(var n in a)r(e,n,{get:a[n],enumerable:!0})},y=(e,a,n,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of G(a))!M.call(e,t)&&t!==n&&r(e,t,{get:()=>a[t],enumerable:!(o=E(a,t))||o.enumerable});return e};var R=(e,a,n)=>(n=e!=null?V(H(e)):{},y(a||!e||!e.__esModule?r(n,"default",{value:e,enumerable:!0}):n,e)),S=e=>y(r({},"__esModule",{value:!0}),e);var $={};P($,{CheckboxGroup:()=>d});module.exports=S($);var l=require("@stackshift-ui/system"),b=R(require("classnames")),i=require("react"),s=require("react/jsx-runtime"),C="CheckboxGroup",d=(0,i.forwardRef)((e,a)=>{var c;let{variant:n="primary",name:o,label:t,noLabel:f=!1,labelClass:g,children:x,className:N,as:T,...h}=e,{[C]:k=l.DefaultComponent}=(0,l.useStackShiftUIComponents)(),m="ml-2",p=`${m} block`,L=`${m} flex gap-4`,u=`mb-2 ${g}`,v=(c={primary:p,inline:L}[n])!=null?c:p;return(0,s.jsxs)(i.Fragment,{children:[!f&&(0,s.jsx)("p",{className:u,children:t||o}),(0,s.jsx)(k,{ref:a,as:T,className:(0,b.default)(v,N),...h,children:x})]})});d.displayName=C;0&&(module.exports={CheckboxGroup});
|
package/dist/checkbox-group.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-4O7QC542.mjs";import"./chunk-3EYN2AKU.mjs";export{a as CheckboxGroup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DefaultComponent as T,useStackShiftUIComponents as h}from"@stackshift-ui/system";import k from"classnames";import{forwardRef as L,Fragment as u}from"react";import{jsx as t,jsxs as V}from"react/jsx-runtime";var s="CheckboxGroup",v=L((o,r)=>{var n;let{variant:l="primary",name:i,label:m,noLabel:p=!1,labelClass:c,children:y,className:b,as:C,...d}=o,{[s]:f=T}=h(),e="ml-2",a=`${e} block`,g=`${e} flex gap-4`,x=`mb-2 ${c}`,N=(n={primary:a,inline:g}[l])!=null?n:a;return V(u,{children:[!p&&t("p",{className:x,children:m||i}),t(f,{ref:r,as:C,className:k(N,b),...d,children:y})]})});v.displayName=s;export{v as a};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__require,
|
|
35
|
+
__commonJS,
|
|
36
|
+
__toESM
|
|
37
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/checkbox-group.tsx
|
|
2
|
+
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import { forwardRef, Fragment } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var displayName = "CheckboxGroup";
|
|
7
|
+
var CheckboxGroup = forwardRef((props, ref) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const {
|
|
10
|
+
variant = "primary",
|
|
11
|
+
name,
|
|
12
|
+
label,
|
|
13
|
+
noLabel = false,
|
|
14
|
+
labelClass,
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
as,
|
|
18
|
+
...rest
|
|
19
|
+
} = props;
|
|
20
|
+
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
21
|
+
const commonClass = "ml-2";
|
|
22
|
+
const primary = `${commonClass} block`;
|
|
23
|
+
const inline = `${commonClass} flex gap-4`;
|
|
24
|
+
const combinedLabelClass = `mb-2 ${labelClass}`;
|
|
25
|
+
const variants = {
|
|
26
|
+
primary,
|
|
27
|
+
inline
|
|
28
|
+
};
|
|
29
|
+
const variantClass = (_a = variants[variant]) != null ? _a : primary;
|
|
30
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
+
!noLabel && /* @__PURE__ */ jsx("p", { className: combinedLabelClass, children: label || name }),
|
|
32
|
+
/* @__PURE__ */ jsx(Component, { ref, as, className: cn(variantClass, className), ...rest, children })
|
|
33
|
+
] });
|
|
34
|
+
});
|
|
35
|
+
CheckboxGroup.displayName = displayName;
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
CheckboxGroup
|
|
39
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var V=Object.create;var r=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var P=(e,a)=>{for(var n in a)r(e,n,{get:a[n],enumerable:!0})},y=(e,a,n,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of G(a))!M.call(e,t)&&t!==n&&r(e,t,{get:()=>a[t],enumerable:!(o=E(a,t))||o.enumerable});return e};var R=(e,a,n)=>(n=e!=null?V(H(e)):{},y(a||!e||!e.__esModule?r(n,"default",{value:e,enumerable:!0}):n,e)),S=e=>y(r({},"__esModule",{value:!0}),e);var $={};P($,{CheckboxGroup:()=>f});module.exports=S($);var l=require("@stackshift-ui/system"),b=R(require("classnames")),i=require("react"),s=require("react/jsx-runtime"),C="CheckboxGroup",f=(0,i.forwardRef)((e,a)=>{var c;let{variant:n="primary",name:o,label:t,noLabel:d=!1,labelClass:g,children:x,className:N,as:T,...h}=e,{[C]:k=l.DefaultComponent}=(0,l.useStackShiftUIComponents)(),m="ml-2",p=`${m} block`,u=`${m} flex gap-4`,L=`mb-2 ${g}`,v=(c={primary:p,inline:u}[n])!=null?c:p;return(0,s.jsxs)(i.Fragment,{children:[!d&&(0,s.jsx)("p",{className:L,children:t||o}),(0,s.jsx)(k,{ref:a,as:T,className:(0,b.default)(v,N),...h,children:x})]})});f.displayName=C;0&&(module.exports={CheckboxGroup});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as e}from"./chunk-
|
|
2
|
+
"use strict";import{a as e}from"./chunk-4O7QC542.mjs";import"./chunk-3EYN2AKU.mjs";export{e as CheckboxGroup};
|