@cryptlex/web-components 6.6.63 → 6.6.64

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.
@@ -0,0 +1,6 @@
1
+ import { TagGroupProps as AriaTagGroupProps, TagListProps, TagProps as AriaTagProps } from 'react-aria-components';
2
+ export interface TagGroupProps<T extends object> extends Omit<AriaTagGroupProps, 'children' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState' | 'className'> {
3
+ }
4
+ export type TagProps = AriaTagProps;
5
+ export declare function TagGroup<T extends object>({ items, children, renderEmptyState, className, ...props }: TagGroupProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function Tag({ children, className, ...props }: TagProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as r,jsxs as l,Fragment as p}from"react/jsx-runtime";import{Tag as c,composeRenderProps as i,TagGroup as d,TagList as u}from"react-aria-components";import{classNames as n}from"../utilities/theme.js";import{IcRemove as f}from"./icons.js";import{Button as g}from"./button.js";import"clsx";import"@icons-pack/react-simple-icons";import"react";import"class-variance-authority";import"./loader.js";const x="body-sm rounded-md inline-flex items-center gap-1 px-2 h-input-sm cursor-default select-none border";function B({items:e,children:s,renderEmptyState:a,className:m,...o}){return r(d,{className:"flex flex-col gap-2",selectionMode:"none",...o,children:r(u,{items:e,renderEmptyState:a,className:i(m,t=>n("flex flex-wrap gap-1",t)),children:s})})}function R({children:e,className:s,...a}){return r(c,{textValue:typeof e=="string"?e:void 0,className:i(s,(o,t)=>n(x,"bg-muted/10 text-muted",t.isDisabled&&"disabled-muted cursor-not-allowed",o)),...a,children:i(e,(o,{allowsRemoving:t})=>l(p,{children:[o,t&&r(g,{slot:"remove",size:"none",variant:"ghost",className:"rounded-full p-0.5",children:r(f,{"aria-hidden":!0,className:"size-icon"})})]}))})}export{R as Tag,B as TagGroup};
2
+ //# sourceMappingURL=tag-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-group.js","sources":["../../lib/components/tag-group.tsx"],"sourcesContent":["'use client';\n\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagList,\n composeRenderProps,\n type TagGroupProps as AriaTagGroupProps,\n type TagListProps,\n type TagProps as AriaTagProps,\n} from 'react-aria-components';\n\nimport { classNames } from '../utilities/theme';\nimport { IcRemove } from './icons';\nimport { Button } from './button';\n\nconst tagBase = 'body-sm rounded-md inline-flex items-center gap-1 px-2 h-input-sm cursor-default select-none border';\n\nexport interface TagGroupProps<T extends object>\n extends Omit<AriaTagGroupProps, 'children' | 'className'>,\n Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState' | 'className'> {}\n\nexport type TagProps = AriaTagProps;\n\nexport function TagGroup<T extends object>({\n items,\n children,\n renderEmptyState,\n className,\n ...props\n}: TagGroupProps<T>) {\n return (\n <AriaTagGroup className=\"flex flex-col gap-2\" selectionMode=\"none\" {...props}>\n <TagList\n items={items}\n renderEmptyState={renderEmptyState}\n className={composeRenderProps(className, className => classNames('flex flex-wrap gap-1', className))}\n >\n {children}\n </TagList>\n </AriaTagGroup>\n );\n}\n\nexport function Tag({ children, className, ...props }: TagProps) {\n const textValue = typeof children === 'string' ? children : undefined;\n\n return (\n <AriaTag\n textValue={textValue}\n className={composeRenderProps(className, (className, renderProps) =>\n classNames(\n tagBase,\n 'bg-muted/10 text-muted',\n renderProps.isDisabled && 'disabled-muted cursor-not-allowed',\n className\n )\n )}\n {...props}\n >\n {composeRenderProps(children, (children, { allowsRemoving }) => (\n <>\n {children}\n {allowsRemoving && (\n <Button slot=\"remove\" size=\"none\" variant=\"ghost\" className=\"rounded-full p-0.5\">\n <IcRemove aria-hidden className=\"size-icon\" />\n </Button>\n )}\n </>\n ))}\n </AriaTag>\n );\n}\n"],"names":["tagBase","TagGroup","items","children","renderEmptyState","className","props","AriaTagGroup","jsx","TagList","composeRenderProps","classNames","Tag","AriaTag","renderProps","allowsRemoving","jsxs","Fragment","Button","IcRemove"],"mappings":"iaAgBA,MAAMA,EAAU,sGAQT,SAASC,EAA2B,CACvC,MAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,UAAAC,EACA,GAAGC,CACP,EAAqB,CACjB,SACKC,EAAA,CAAa,UAAU,sBAAsB,cAAc,OAAQ,GAAGD,EACnE,SAAAE,EAACC,EAAA,CACG,MAAAP,EACA,iBAAAE,EACA,UAAWM,EAAmBL,EAAWA,GAAaM,EAAW,uBAAwBN,CAAS,CAAC,EAElG,SAAAF,CAAA,CAAA,EAET,CAER,CAEO,SAASS,EAAI,CAAE,SAAAT,EAAU,UAAAE,EAAW,GAAGC,GAAmB,CAG7D,OACIE,EAACK,EAAA,CACG,UAJU,OAAOV,GAAa,SAAWA,EAAW,OAKpD,UAAWO,EAAmBL,EAAW,CAACA,EAAWS,IACjDH,EACIX,EACA,yBACAc,EAAY,YAAc,oCAC1BT,CAAA,CACJ,EAEH,GAAGC,EAEH,WAAmBH,EAAU,CAACA,EAAU,CAAE,eAAAY,CAAA,IACvCC,EAAAC,EAAA,CACK,SAAA,CAAAd,EACAY,GACGP,EAACU,EAAA,CAAO,KAAK,SAAS,KAAK,OAAO,QAAQ,QAAQ,UAAU,qBACxD,SAAAV,EAACW,EAAA,CAAS,cAAW,GAAC,UAAU,YAAY,CAAA,CAChD,CAAA,EAER,CACH,CAAA,CAAA,CAGb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptlex/web-components",
3
- "version": "6.6.63",
3
+ "version": "6.6.64",
4
4
  "description": "React component library for Cryptlex web applications",
5
5
  "author": "Cryptlex",
6
6
  "type": "module",