@atom-learning/components 1.21.2 → 1.22.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.
- package/CHANGELOG.md +3 -3
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/icon/Icon.js +1 -1
- package/dist/components/toggle-group/ToggleGroupButton.d.ts +1 -1
- package/dist/components/toggle-group/ToggleGroupButton.js +1 -1
- package/dist/components/toggle-group/ToggleGroupRoot.d.ts +2 -3
- package/dist/components/toggle-group/ToggleGroupRoot.js +1 -1
- package/dist/components/toggle-group/index.d.ts +3 -4
- package/dist/docgen.json +1 -1
- package/dist/docs/ToggleGroup.mdx +6 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# [1.22.0](https://github.com/Atom-Learning/components/compare/v1.21.4...v1.22.0) (2022-07-29)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* focusVisibleStyleBlock export ([21366ab](https://github.com/Atom-Learning/components/commit/21366abeeca1421174bf74348da46bb386c3ca37))
|
|
7
7
|
|
|
8
8
|
# [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ChevronLeft as
|
|
1
|
+
import{ChevronLeft as I,ChevronRight as S}from"@atom-learning/icons";import{useDayzed as B}from"dayzed";import*as e from"react";import{ActionIcon as h}from"../action-icon/ActionIcon.js";import{Box as y}from"../box/Box.js";import{Flex as g}from"../flex/Flex.js";import{Heading as M}from"../heading/Heading.js";import{Icon as u}from"../icon/Icon.js";import{Text as W}from"../text/Text.js";import{styled as j}from"../../stitches.js";import{monthNamesShort as A,weekdayNamesShort as F}from"./constants.js";import{Day as G}from"./Day.js";const $=j("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),H=(t,r)=>{const s=t.slice(0,r);return t.slice(r).concat(s)},E=({css:t,refDateSelected:r,refDateToday:s,firstDayOfWeek:l=0,monthNames:x=A,weekdayNames:k=F,labels:c={next:"Next month",previous:"Previous month"},...v})=>{const{calendars:o,getBackProps:D,getForwardProps:b,getDateProps:N}=B({firstDayOfWeek:l,showOutsideDays:!0,...v});return o.length?e.createElement(y,{css:{position:"relative",width:"min-content",mt:"-$1",...t}},e.createElement(g,{css:{position:"absolute",top:0,right:"-$1"}},e.createElement(h,{label:c.previous,theme:"neutral",size:"lg",...D({calendars:o})},e.createElement(u,{is:I})),e.createElement(h,{label:c.next,theme:"neutral",size:"lg",...b({calendars:o})},e.createElement(u,{is:S}))),o.map(({month:a,year:m,weeks:w})=>e.createElement(y,{key:`${a}${m}`},e.createElement(g,{css:{height:"$4",alignItems:"center",mb:"$4"}},e.createElement(M,{size:"xs"},x[a]," ",m)),e.createElement($,{css:{mb:"$3"}},H(k,l).map(n=>e.createElement(W,{as:"span",size:"sm",key:`${a}${m}${n}`,css:{fontWeight:600,textAlign:"center"}},n))),e.createElement($,null,w.map((n,z)=>n.map((i,C)=>{const p=`${a}${m}${z}${C}`;if(!i)return e.createElement("div",{key:p});const{date:O,selected:d,today:f,prevMonth:P,nextMonth:T}=i;return e.createElement(G,{isOutsideMonth:P||T,isSelected:d,isToday:f,key:p,ref:d?r:f?s:null,...N({dateObj:i}),type:"button"},O.getDate())})))))):null};E.displayName="Calendar";export{E as Calendar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{styled as n}from"../../stitches.js";const i=n("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.
|
|
1
|
+
import*as e from"react";import{styled as n}from"../../stitches.js";const i=n("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),d=e.forwardRef(({is:r,size:o="md",...s},t)=>e.createElement(i,{size:o,"aria-hidden":"true",...s,as:r,ref:t}));export{d as Icon,i as StyledIcon};
|
|
@@ -531,4 +531,4 @@ export declare const StyledButton: import("@stitches/react/types/styled-componen
|
|
|
531
531
|
};
|
|
532
532
|
};
|
|
533
533
|
}>>;
|
|
534
|
-
export declare const ToggleGroupButton: React.
|
|
534
|
+
export declare const ToggleGroupButton: React.ForwardRefExoticComponent<React.ComponentProps<typeof StyledButton>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as n from"react";import{styled as
|
|
1
|
+
import*as n from"react";import{styled as g}from"../../stitches.js";import{StyledIcon as f,Icon as r}from"../icon/Icon.js";import{StyledItem as h}from"./ToggleGroupItem.js";const t={sm:"32px",md:"40px",lg:"48px"},$={sm:"$4",md:"$5",lg:"$5"},u={sm:"$2",md:"$3",lg:"$3"},l=i=>({fontSize:`$${i}`,px:$[i],minHeight:t[i],"& > *:not(:last-child)":{mr:u[i]}}),d=g(h,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",[`& ${f}`]:{flexShrink:0},variants:{size:{sm:l("sm"),md:l("md"),lg:l("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:t.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:t.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:t.lg,p:0}}]}),x=n.forwardRef(({size:i="md",children:p,...c},a)=>{var o;const s=n.Children.toArray(p),m=s.length<=1,y=m&&n.isValidElement(s[0])&&((o=s[0])==null?void 0:o.type)===r;return n.createElement(d,{ref:a,size:i,isIconOnly:y,...c},s.map(e=>!m&&typeof e=="string"?n.createElement("span",{key:e},e):n.isValidElement(e)&&(e==null?void 0:e.type)===r?n.cloneElement(e,{...e.props,size:i}):e))});export{d as StyledButton,x as ToggleGroupButton};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as ToggleGroup from '@radix-ui/react-toggle-group';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare type RootType = {
|
|
4
|
-
size: 'sm' | 'md' | 'lg';
|
|
5
4
|
orientation?: 'horizontal' | 'vertical';
|
|
6
5
|
gap?: number;
|
|
7
6
|
isFullWidth?: boolean;
|
|
8
|
-
wrap
|
|
7
|
+
wrap?: 'wrap' | 'no-wrap' | 'wrap-reverse';
|
|
9
8
|
};
|
|
10
9
|
export declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<(ToggleGroup.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>) | (ToggleGroup.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>)>, {
|
|
11
10
|
isFullWidth?: boolean | "true" | undefined;
|
|
@@ -276,5 +275,5 @@ export declare const StyledRoot: import("@stitches/react/types/styled-component"
|
|
|
276
275
|
};
|
|
277
276
|
};
|
|
278
277
|
}>>;
|
|
279
|
-
export declare const ToggleGroupRoot: React.
|
|
278
|
+
export declare const ToggleGroupRoot: React.ForwardRefExoticComponent<React.ComponentProps<typeof StyledRoot> & RootType>;
|
|
280
279
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as h from"@radix-ui/react-toggle-group";import*as r from"react";import{Stack as f}from"../stack/Stack.js";import{styled as m}from"../../stitches.js";import{StyledItem as t}from"./ToggleGroupItem.js";const s=m(h.Root,{width:"fit-content",variants:{isFullWidth:{true:{width:"100%",[`& ${t}`]:{flexBasis:0,flexGrow:1}}},hasGap:{true:{[`& ${t}`]:{borderRadius:"$0"}},false:{borderRadius:"$0",bg:"white",[`& ${t}`]:{bg:"transparent",borderRadius:0,position:"relative","&:not(:last-child)::before":{content:"",position:"absolute"}}}},direction:{column:{},row:{}}},compoundVariants:[{hasGap:!1,direction:"row",css:{[`& ${t}`]:{"&:not(:last-child)::before":{top:"-1px",height:"calc(100% + 2px)",width:"1px",right:"0",transform:"translateX(150%)"},"&:not(:first-child)":{borderLeftColor:"transparent"},"&:not(:last-child)":{borderRightColor:"transparent"},"&:first-child":{borderTopLeftRadius:"$0",borderBottomLeftRadius:"$0"},"&:last-child":{borderTopRightRadius:"$0",borderBottomRightRadius:"$0"}}}},{hasGap:!1,direction:"column",css:{[`& ${t}`]:{"&:not(:last-child)::before":{bottom:0,left:"-1px",height:"1px",width:"calc(100% + 2px)",transform:"translateY(150%)"},"&:first-child":{borderTopLeftRadius:"$0",borderTopRightRadius:"$0"},"&:last-child":{borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},"&:not(:first-child)":{borderTopColor:"transparent"},"&:not(:last-child)":{borderBottomColor:"transparent"}}}}]}),u=o=>o==="horizontal"?"row":"column",b=r.forwardRef(({orientation:o="horizontal",gap:i=!1,isFullWidth:d,children:n,wrap:l="no-wrap",...p},c)=>{const e=typeof i=="number",a=u(o);return r.createElement(s,{ref:c,direction:a,hasGap:e,isFullWidth:d,orientation:o,...p},r.createElement(f,{direction:a,gap:e&&i,align:!1,wrap:l},n))});export{s as StyledRoot,b as ToggleGroupRoot};
|
|
@@ -265,7 +265,7 @@ export declare const ToggleGroup: {
|
|
|
265
265
|
};
|
|
266
266
|
};
|
|
267
267
|
}>>;
|
|
268
|
-
Button: import("react").
|
|
268
|
+
Button: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-toggle-group").ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>, "css"> & import("@stitches/react/types/styled-component").TransformProps<{}, {
|
|
269
269
|
sm: string;
|
|
270
270
|
md: string;
|
|
271
271
|
lg: string;
|
|
@@ -801,7 +801,7 @@ export declare const ToggleGroup: {
|
|
|
801
801
|
};
|
|
802
802
|
}> | undefined;
|
|
803
803
|
}>;
|
|
804
|
-
Root: import("react").
|
|
804
|
+
Root: import("react").ForwardRefExoticComponent<((Omit<import("@radix-ui/react-toggle-group").ToggleGroupSingleProps & import("react").RefAttributes<HTMLDivElement>, "direction" | "css" | "isFullWidth" | "hasGap"> & import("@stitches/react/types/styled-component").TransformProps<{
|
|
805
805
|
isFullWidth?: boolean | "true" | undefined;
|
|
806
806
|
hasGap?: boolean | "true" | "false" | undefined;
|
|
807
807
|
direction?: "row" | "column" | undefined;
|
|
@@ -1342,10 +1342,9 @@ export declare const ToggleGroup: {
|
|
|
1342
1342
|
};
|
|
1343
1343
|
}> | undefined;
|
|
1344
1344
|
})) & {
|
|
1345
|
-
size: "sm" | "md" | "lg";
|
|
1346
1345
|
orientation?: "horizontal" | "vertical" | undefined;
|
|
1347
1346
|
gap?: number | undefined;
|
|
1348
1347
|
isFullWidth?: boolean | undefined;
|
|
1349
|
-
wrap
|
|
1348
|
+
wrap?: "wrap" | "wrap-reverse" | "no-wrap" | undefined;
|
|
1350
1349
|
}>;
|
|
1351
1350
|
};
|