@atom-learning/components 2.28.3-beta.2 → 2.28.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/accordion/AccordionContent.js +1 -1
  3. package/dist/components/accordion/AccordionItem.js +1 -1
  4. package/dist/components/accordion/AccordionTrigger.d.ts +4 -5
  5. package/dist/components/accordion/AccordionTrigger.js +1 -1
  6. package/dist/components/button/Button.d.ts +0 -1
  7. package/dist/components/button/Button.js +1 -1
  8. package/dist/components/calendar/Calendar.js +1 -1
  9. package/dist/components/tabs/{TabsTrigger.d.ts → TabTrigger.d.ts} +6 -3
  10. package/dist/components/tabs/TabTrigger.js +1 -0
  11. package/dist/components/tabs/Tabs.d.ts +276 -7
  12. package/dist/components/tabs/Tabs.js +1 -1
  13. package/dist/components/tabs/TabsTriggerList.d.ts +9 -5
  14. package/dist/components/tabs/TabsTriggerList.js +1 -1
  15. package/dist/components/tabs/utils.d.ts +2 -0
  16. package/dist/components/tabs/utils.js +1 -0
  17. package/dist/components/top-bar/TopBar.js +1 -1
  18. package/dist/docgen.json +1 -1
  19. package/dist/docs/Accordion.mdx +7 -56
  20. package/dist/docs/Button.mdx +0 -8
  21. package/dist/docs/Tabs.mdx +57 -31
  22. package/dist/index.cjs.js +1 -1
  23. package/dist/utilities/hooks/useCallbackRef.js +1 -1
  24. package/dist/utilities/hooks/useScrollPosition.d.ts +3 -6
  25. package/dist/utilities/hooks/useScrollPosition.js +1 -1
  26. package/package.json +2 -3
  27. package/dist/components/tabs/TabsContent.d.ts +0 -267
  28. package/dist/components/tabs/TabsContent.js +0 -1
  29. package/dist/components/tabs/TabsTrigger.js +0 -1
  30. package/dist/docs/README.mdx +0 -79
  31. package/dist/experiments/color-scheme/ColorScheme.d.ts +0 -201
  32. package/dist/experiments/color-scheme/ColorScheme.js +0 -1
  33. package/dist/experiments/color-scheme/blue.json.js +0 -1
  34. package/dist/experiments/color-scheme/generateAlphaColors.d.ts +0 -1
  35. package/dist/experiments/color-scheme/generateAlphaColors.js +0 -1
  36. package/dist/experiments/color-scheme/index.d.ts +0 -1
  37. package/dist/experiments/color-scheme/slate.json.js +0 -1
  38. package/dist/experiments/color-scheme/stitches.colorscheme.config.d.ts +0 -452
  39. package/dist/experiments/color-scheme/stitches.colorscheme.config.js +0 -1
  40. package/dist/utilities/hooks/useWindowScrollPosition.d.ts +0 -6
  41. package/dist/utilities/hooks/useWindowScrollPosition.js +0 -1
  42. package/dist/utilities/hooks/useWindowSize.d.ts +0 -8
  43. package/dist/utilities/hooks/useWindowSize.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [2.28.3](https://github.com/Atom-Learning/components/compare/v2.28.2...v2.28.3) (2023-01-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove isRounded button variant ([102a47f](https://github.com/Atom-Learning/components/commit/102a47ffbeba4d41756508ca32c2f642286a1611))
7
+ * stop using isRounded in calendar component ([765ba5c](https://github.com/Atom-Learning/components/commit/765ba5ce3a78fe8618ee75e43cf2561c8ead0590))
8
+
1
9
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
2
10
 
3
11
 
@@ -1 +1 @@
1
- import{Content as n}from"@radix-ui/react-accordion";import t from"react";import{keyframes as o,styled as i}from"../../stitches.js";import{CSSWrapper as d}from"../../utilities/css-wrapper/CSSWrapper.js";const c=o({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),s=o({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),m=i(n,{border:0,width:"100%",bg:"$background",overflow:"hidden",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${c} 300ms ease-out`},'&[data-state="closed"]':{animation:`${s} 300ms ease-out`}}}),h=({children:e,css:r,...a})=>t.createElement(m,{...a},t.createElement(d,{css:r},e));export{h as AccordionContent};
1
+ import{Content as i}from"@radix-ui/react-accordion";import t from"react";import{keyframes as e,styled as n}from"../../stitches.js";import{CSSWrapper as c}from"../../utilities/css-wrapper/CSSWrapper.js";const d=e({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),m=e({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),s=n(i,{border:0,width:"100%",bg:"#fff",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${d} 300ms ease-out`},'&[data-state="closed"]':{animation:`${m} 300ms ease-out`}}}),h=({children:o,css:a,...r})=>t.createElement(s,{...r},t.createElement(c,{css:a},o));export{h as AccordionContent};
@@ -1 +1 @@
1
- import{Item as m}from"@radix-ui/react-accordion";import r from"react";import{styled as l}from"../../stitches.js";const c=l(m,{width:"100%","&:not(:last-child)":{mb:"$1"}}),i=({children:t,value:e,...o})=>r.createElement(c,{value:e,...o},t);export{i as AccordionItem};
1
+ import{Item as r}from"@radix-ui/react-accordion";import m from"react";import{styled as d}from"../../stitches.js";const l=d(r,{width:"100%",overflow:"hidden","&:not(:last-child)":{mb:"$1"}}),i=({children:t,value:e,...o})=>m.createElement(l,{value:e,...o},t);export{i as AccordionItem};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { ColorScheme } from '../../experiments/color-scheme';
3
- declare const StyledTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-accordion").AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>, {}, {
2
+ declare const StyledTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-accordion").AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>>, {
3
+ theme?: "primaryDark" | "light" | "tonal" | undefined;
4
+ }, {
4
5
  sm: string;
5
6
  md: string;
6
7
  lg: string;
@@ -266,8 +267,6 @@ declare const StyledTrigger: import("@stitches/react/types/styled-component").St
266
267
  };
267
268
  };
268
269
  }>>;
269
- declare type AccordionTriggerProps = React.ComponentProps<typeof StyledTrigger> & {
270
- colorScheme?: typeof ColorScheme;
271
- };
270
+ declare type AccordionTriggerProps = React.ComponentProps<typeof StyledTrigger>;
272
271
  export declare const AccordionTrigger: React.FC<AccordionTriggerProps>;
273
272
  export {};
@@ -1 +1 @@
1
- import{ChevronDown as i}from"@atom-learning/icons";import{Trigger as s}from"@radix-ui/react-accordion";import e from"react";import{styled as t}from"../../stitches.js";import{Icon as n}from"../icon/Icon.js";import{focusVisibleStyleBlock as c}from"../../utilities/style/focus-visible-style-block.js";import{ColorScheme as d}from"../../experiments/color-scheme/ColorScheme.js";const l=t(n,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),m=t(s,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...c()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"}}),f=({children:o,colorScheme:r={},...a})=>e.createElement(d,{asChild:!0,accent:"slate",interactive:"loContrast1",...r},e.createElement(m,{...a},o,e.createElement(l,{is:i})));export{f as AccordionTrigger};
1
+ import{ChevronDown as s}from"@atom-learning/icons";import{Trigger as l}from"@radix-ui/react-accordion";import{darken as r}from"color2k";import n from"react";import{styled as i,theme as f}from"../../stitches.js";import{Icon as d}from"../icon/Icon.js";const a=(t,e,o,m="#fff")=>({bg:t,color:m,"&[disabled]":{bg:"$tonal100",cursor:"not-allowed",color:"$tonal400"},"&:not([disabled]):hover":{bg:e},"&:not([disabled]):active":{bg:o}}),p=i(d,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),c=i(l,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"},variants:{theme:{primaryDark:a("$primaryDark",r(f.colors.primaryDark.value,.1),r(f.colors.primaryDark.value,.15)),light:a("#fff",r("#fff",.1),r("#fff",.15),"$tonal600"),tonal:a("$tonal100",r("#fff",.1),r("#fff",.15),"$tonal500")}}}),g=({theme:t="primaryDark",children:e,...o})=>n.createElement(c,{theme:t,...o},e,n.createElement(p,{is:s}));export{g as AccordionTrigger};
@@ -8,7 +8,6 @@ export declare const StyledButton: import("@stitches/react/types/styled-componen
8
8
  size?: "sm" | "md" | "lg" | undefined;
9
9
  isLoading?: boolean | "true" | undefined;
10
10
  fullWidth?: boolean | "true" | "false" | undefined;
11
- isRounded?: boolean | "true" | undefined;
12
11
  }, {
13
12
  sm: string;
14
13
  md: string;
@@ -1 +1 @@
1
- import{darken as i,opacify as s}from"color2k";import*as o from"react";import{Box as b}from"../box/Box.js";import{Icon as w}from"../icon/Icon.js";import{Loader as k}from"../loader/Loader.js";import{styled as v,theme as l}from"../../stitches.js";const d=(e,r,a)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:r},"&:not([disabled]):active":{color:a}}),n=(e,r,a,t="white")=>({bg:e,color:t,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:r,color:t},"&:not([disabled]):active":{bg:a}}),p=v("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4"},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5"},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5"}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:n("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:n("$primaryDark",i(l.colors.primaryDark.value,.1),i(l.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:n("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:n("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:n("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:n("white",s("white",-.1),s("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:d("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:d("white",s("white",-.2),s("white",-.35))},{theme:"secondary",appearance:"outline",css:d("$primaryDark",i(l.colors.primaryDark.value,.1),i(l.colors.primaryDark.value,.15))}]}),D=({isLoading:e,children:r})=>o.createElement(o.Fragment,null,o.createElement(k,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),o.createElement(b,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},r)),x=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},m=(e,r)=>o.Children.map(e,(a,t)=>(a==null?void 0:a.type)===w?o.cloneElement(a,{css:{[t===0?"mr":"ml"]:r==="sm"?"$2":"$3",size:x(r),...a.props.css?a.props.css:{}}}):a),u=o.forwardRef(({children:e,isLoading:r,onClick:a,href:t,appearance:h="solid",size:c="md",theme:y="primary",type:$="button",...g},f)=>o.createElement(p,{isLoading:r||!1,onClick:r?void 0:a,appearance:h,size:c,theme:y,...g,...t?{as:"a",href:t,onClick:void 0}:{},...t?{}:{type:$},ref:f},typeof r=="boolean"?o.createElement(D,{isLoading:r},m(e,c)):m(e,c)));u.displayName="Button";export{u as Button,p as StyledButton};
1
+ import{darken as i,opacify as s}from"color2k";import*as o from"react";import{Box as b}from"../box/Box.js";import{Icon as w}from"../icon/Icon.js";import{Loader as k}from"../loader/Loader.js";import{styled as v,theme as l}from"../../stitches.js";const d=(e,r,a)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:r},"&:not([disabled]):active":{color:a}}),n=(e,r,a,t="white")=>({bg:e,color:t,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:r,color:t},"&:not([disabled]):active":{bg:a}}),p=v("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4"},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5"},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5"}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:n("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:n("$primaryDark",i(l.colors.primaryDark.value,.1),i(l.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:n("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:n("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:n("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:n("white",s("white",-.1),s("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:d("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:d("white",s("white",-.2),s("white",-.35))},{theme:"secondary",appearance:"outline",css:d("$primaryDark",i(l.colors.primaryDark.value,.1),i(l.colors.primaryDark.value,.15))}]}),D=({isLoading:e,children:r})=>o.createElement(o.Fragment,null,o.createElement(k,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),o.createElement(b,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},r)),x=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},m=(e,r)=>o.Children.map(e,(a,t)=>(a==null?void 0:a.type)===w?o.cloneElement(a,{css:{[t===0?"mr":"ml"]:r==="sm"?"$2":"$3",size:x(r),...a.props.css?a.props.css:{}}}):a),u=o.forwardRef(({children:e,isLoading:r,onClick:a,href:t,appearance:h="solid",size:c="md",theme:y="primary",type:g="button",...$},f)=>o.createElement(p,{isLoading:r||!1,onClick:r?void 0:a,appearance:h,size:c,theme:y,...$,...t?{as:"a",href:t,onClick:void 0}:{},...t?{}:{type:g},ref:f},typeof r=="boolean"?o.createElement(D,{isLoading:r},m(e,c)):m(e,c)));u.displayName="Button";export{u as Button,p as StyledButton};
@@ -1 +1 @@
1
- import{ChevronLeft as q,ChevronRight as H}from"@atom-learning/icons";import{useDayzed as J}from"dayzed";import*as e from"react";import{ActionIcon as x}from"../action-icon/ActionIcon.js";import{Box as g}from"../box/Box.js";import{Flex as C}from"../flex/Flex.js";import{Icon as Y}from"../icon/Icon.js";import{Text as K}from"../text/Text.js";import{Button as w}from"../button/Button.js";import{styled as F}from"../../stitches.js";import{monthNamesShort as Q,weekdayNamesShort as V,DEFAULT_LABELS as X}from"./constants.js";import{Day as Z}from"./Day.js";const f=F("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),ee=F(w,{color:"$tonal600",p:"$3",width:"$6",variants:{selected:{false:{color:"$tonal600 !important",fontWeight:"400","&:hover":{bg:"$tonal100 !important",color:"$tonal600 !important"},"&[disabled]":{bg:"white !important"}}}}}),te=(i,c)=>{const u=i.slice(0,c);return i.slice(c).concat(u)},S=({css:i,refDateSelected:c,refDateToday:u,firstDayOfWeek:$=0,monthNames:N=Q,weekdayNames:T=V,labels:y=X,date:o=new Date,minDate:l,maxDate:s,setYear:A,...L})=>{const[a,E]=e.useState(!1),[m,k]=e.useState(o==null?void 0:o.getFullYear()),O=t=>{const r=o;r.setFullYear(t),A(r),E(!1)},W=l&&m-16<=l.getFullYear(),z=s&&m>=s.getFullYear(),B=Array.from({length:16},(t,r)=>{const n=m-r;return s&&n>s.getFullYear()||l&&n<l.getFullYear()?0:n}),{calendars:d,getBackProps:I,getForwardProps:M,getDateProps:G}=J({firstDayOfWeek:$,showOutsideDays:!0,date:o,minDate:l,maxDate:s,...L});return d.length?e.createElement(g,{css:{position:"relative",width:"min-content",mt:"-$1",...i}},e.createElement(C,{css:{position:"absolute",top:0,right:"-$1"}},e.createElement(x,{label:y[a?"previousYear":"previous"],theme:"neutral",size:"md",...!a&&I({calendars:d}),...a&&{onClick:()=>k(m-16)},disabled:a&&W},e.createElement(Y,{is:q})),e.createElement(x,{label:y[a?"nextYear":"next"],theme:"neutral",size:"md",...!a&&M({calendars:d}),...a&&{onClick:()=>k(m+16)},disabled:a&&z},e.createElement(Y,{is:H}))),a&&e.createElement(f,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},B.map((t,r)=>{const n=t===o.getFullYear();return t?e.createElement(ee,{key:`${t}${r}`,theme:n?"primary":"neutral",isRounded:!0,onClick:()=>O(t),selected:n},t):e.createElement(g,{key:r,css:{width:"$6",height:"$4"}})})),!a&&d.map(({month:t,year:r,weeks:n})=>e.createElement(g,{key:`${t}${r}`},e.createElement(C,{css:{height:"$4",alignItems:"center",mb:"$4"}},e.createElement(w,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>E(!0)},N[t]," ",r)),e.createElement(f,{css:{mb:"$3"}},te(T,$).map(p=>e.createElement(K,{as:"span",size:"sm",key:`${t}${r}${p}`,css:{fontWeight:600,textAlign:"center"}},p))),e.createElement(f,null,n.map((p,P)=>p.map((h,R)=>{const D=`${t}${r}${P}${R}`;if(!h)return e.createElement("div",{key:D});const{date:j,selected:b,today:v,prevMonth:U,nextMonth:_}=h;return e.createElement(Z,{isOutsideMonth:U||_,isSelected:b,isToday:v,key:D,ref:b?c:v?u:null,...G({dateObj:h}),type:"button"},j.getDate())})))))):null};S.displayName="Calendar";export{S as Calendar};
1
+ import{ChevronLeft as q,ChevronRight as H}from"@atom-learning/icons";import{useDayzed as J}from"dayzed";import*as e from"react";import{ActionIcon as x}from"../action-icon/ActionIcon.js";import{Box as g}from"../box/Box.js";import{Flex as C}from"../flex/Flex.js";import{Icon as Y}from"../icon/Icon.js";import{Text as K}from"../text/Text.js";import{Button as w}from"../button/Button.js";import{styled as F}from"../../stitches.js";import{monthNamesShort as Q,weekdayNamesShort as V,DEFAULT_LABELS as X}from"./constants.js";import{Day as Z}from"./Day.js";const f=F("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),ee=F(w,{color:"$tonal600",p:"$3",width:"$6",variants:{selected:{false:{color:"$tonal600 !important",fontWeight:"400","&:hover":{bg:"$tonal100 !important",color:"$tonal600 !important"},"&[disabled]":{bg:"white !important"}}}}}),te=(i,c)=>{const u=i.slice(0,c);return i.slice(c).concat(u)},S=({css:i,refDateSelected:c,refDateToday:u,firstDayOfWeek:$=0,monthNames:N=Q,weekdayNames:T=V,labels:y=X,date:o=new Date,minDate:l,maxDate:m,setYear:A,...L})=>{const[a,E]=e.useState(!1),[s,k]=e.useState(o==null?void 0:o.getFullYear()),O=t=>{const r=o;r.setFullYear(t),A(r),E(!1)},W=l&&s-16<=l.getFullYear(),z=m&&s>=m.getFullYear(),B=Array.from({length:16},(t,r)=>{const n=s-r;return m&&n>m.getFullYear()||l&&n<l.getFullYear()?0:n}),{calendars:d,getBackProps:I,getForwardProps:M,getDateProps:G}=J({firstDayOfWeek:$,showOutsideDays:!0,date:o,minDate:l,maxDate:m,...L});return d.length?e.createElement(g,{css:{position:"relative",width:"min-content",mt:"-$1",...i}},e.createElement(C,{css:{position:"absolute",top:0,right:"-$1"}},e.createElement(x,{label:y[a?"previousYear":"previous"],theme:"neutral",size:"md",...!a&&I({calendars:d}),...a&&{onClick:()=>k(s-16)},disabled:a&&W},e.createElement(Y,{is:q})),e.createElement(x,{label:y[a?"nextYear":"next"],theme:"neutral",size:"md",...!a&&M({calendars:d}),...a&&{onClick:()=>k(s+16)},disabled:a&&z},e.createElement(Y,{is:H}))),a&&e.createElement(f,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},B.map((t,r)=>{const n=t===o.getFullYear();return t?e.createElement(ee,{key:`${t}${r}`,theme:n?"primary":"neutral",onClick:()=>O(t),selected:n},t):e.createElement(g,{key:r,css:{width:"$6",height:"$4"}})})),!a&&d.map(({month:t,year:r,weeks:n})=>e.createElement(g,{key:`${t}${r}`},e.createElement(C,{css:{height:"$4",alignItems:"center",mb:"$4"}},e.createElement(w,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>E(!0)},N[t]," ",r)),e.createElement(f,{css:{mb:"$3"}},te(T,$).map(p=>e.createElement(K,{as:"span",size:"sm",key:`${t}${r}${p}`,css:{fontWeight:600,textAlign:"center"}},p))),e.createElement(f,null,n.map((p,P)=>p.map((h,j)=>{const D=`${t}${r}${P}${j}`;if(!h)return e.createElement("div",{key:D});const{date:R,selected:b,today:v,prevMonth:U,nextMonth:_}=h;return e.createElement(Z,{isOutsideMonth:U||_,isSelected:b,isToday:v,key:D,ref:b?c:v?u:null,...G({dateObj:h}),type:"button"},R.getDate())})))))):null};S.displayName="Calendar";export{S as Calendar};
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
- declare const StyledTabsTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>, {}, {
2
+ declare const StyledTabTrigger: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>, {
3
+ theme?: "dark" | "light" | undefined;
4
+ }, {
3
5
  sm: string;
4
6
  md: string;
5
7
  lg: string;
@@ -265,8 +267,9 @@ declare const StyledTabsTrigger: import("@stitches/react/types/styled-component"
265
267
  };
266
268
  };
267
269
  }>>;
268
- interface TabsTriggerProps extends React.ComponentProps<typeof StyledTabsTrigger> {
270
+ interface TabTriggerProps extends React.ComponentProps<typeof StyledTabTrigger> {
269
271
  value: string;
272
+ disabled?: boolean;
270
273
  }
271
- export declare const TabsTrigger: React.FC<TabsTriggerProps>;
274
+ export declare const TabTrigger: React.FC<TabTriggerProps>;
272
275
  export {};
@@ -0,0 +1 @@
1
+ import{Trigger as l}from"@radix-ui/react-tabs";import{opacify as o}from"color2k";import*as n from"react";import{styled as s,theme as e}from"../../stitches.js";const c=s(l,{background:"none",border:"none",cursor:"pointer",flexShrink:0,fontFamily:"$body",p:"$4",height:"$5",userSelect:"none",transition:"0.3s",variants:{theme:{light:{'&[data-state="active"]':{color:"$primary",fontWeight:600,letterSpacing:"-0.005em",boxShadow:"inset 0 -2px 0 0 currentColor"},'&[data-state="inactive"]':{color:"$tonal500"},"&:not([data-disabled]):hover":{color:"$primary",bg:o(e.colors.primary.value,-.9)},"&:not([data-disabled]):active":{color:"$primary",bg:o(e.colors.primary.value,-.8),boxShadow:"none"},"&[data-disabled],&[data-disabled]:hover":{color:"$tonal200",cursor:"not-allowed"}},dark:{color:"white",'&[data-state="active"]':{fontWeight:600,letterSpacing:"-0.005em",boxShadow:"inset 0 -2px 0 0 currentColor"},"&:not([data-disabled]):hover":{bg:o("white",-.8)},"&:not([data-disabled]):active":{bg:o("white",-.7),boxShadow:"none"},"&[data-disabled],&[data-disabled]:hover":{color:"$tonal200",cursor:"not-allowed"}}}}}),a=({children:t,theme:r,disabled:i=!1,...d})=>n.createElement(c,{disabled:i,theme:r,...d},t);a.displayName="TabTrigger";export{a as TabTrigger};
@@ -1,9 +1,278 @@
1
1
  import * as React from 'react';
2
- import { TabsTriggerList } from './TabsTriggerList';
3
- import { TabsTrigger } from './TabsTrigger';
4
- import { TabsContent } from './TabsContent';
2
+ import { TriggerListWrapper } from './TabsTriggerList';
3
+ import { TabTrigger } from './TabTrigger';
5
4
  declare type TabsProps = React.ComponentProps<typeof StyledRoot>;
6
- declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsProps & React.RefAttributes<HTMLDivElement>>, {}, {
5
+ declare const StyledRoot: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsProps & React.RefAttributes<HTMLDivElement>>, {
6
+ theme?: "dark" | "light" | undefined;
7
+ }, {
8
+ sm: string;
9
+ md: string;
10
+ lg: string;
11
+ xl: string;
12
+ reducedMotion: string;
13
+ allowMotion: string;
14
+ hover: string;
15
+ }, import("@stitches/react/types/css-util").CSS<{
16
+ sm: string;
17
+ md: string;
18
+ lg: string;
19
+ xl: string;
20
+ reducedMotion: string;
21
+ allowMotion: string;
22
+ hover: string;
23
+ }, {
24
+ colors: {
25
+ textForeground: any;
26
+ textSubtle: any;
27
+ textPlaceholder: any;
28
+ background: any;
29
+ backgroundAccent: any;
30
+ tonal50: any;
31
+ tonal100: any;
32
+ tonal200: any;
33
+ tonal300: any;
34
+ tonal400: any;
35
+ tonal500: any;
36
+ tonal600: any;
37
+ alpha100: any;
38
+ alpha150: any;
39
+ alpha200: any;
40
+ alpha250: any;
41
+ alpha600: any;
42
+ primaryLight: any;
43
+ primary: any;
44
+ primaryMid: any;
45
+ primaryDark: any;
46
+ secondary: any;
47
+ brandRed: any;
48
+ brandRedAccent: any;
49
+ brandGreen: any;
50
+ brandGreenAccent: any;
51
+ brandPurple: any;
52
+ brandPurpleAccent: any;
53
+ brandYellow: any;
54
+ brandYellowAccent: any;
55
+ successLight: any;
56
+ success: any;
57
+ successMid: any;
58
+ successDark: any;
59
+ dangerLight: any;
60
+ danger: any;
61
+ dangerMid: any;
62
+ dangerDark: any;
63
+ warningLight: any;
64
+ warning: any;
65
+ warningMid: any;
66
+ warningDark: any;
67
+ warningText: any;
68
+ subjectEnglish: any;
69
+ subjectMaths: any;
70
+ subjectScience: any;
71
+ subjectVerbalReasoning: any;
72
+ subjectNonVerbalReasoning: any;
73
+ subjectCreativeWriting: any;
74
+ subjectExamSkills: any;
75
+ };
76
+ space: {
77
+ "0": any;
78
+ "1": any;
79
+ "2": any;
80
+ "3": any;
81
+ "4": any;
82
+ "5": any;
83
+ "6": any;
84
+ "7": any;
85
+ "8": any;
86
+ "9": any;
87
+ };
88
+ fontSizes: {
89
+ xs: any;
90
+ sm: any;
91
+ md: any;
92
+ lg: any;
93
+ xl: any;
94
+ "2xl": any;
95
+ "3xl": any;
96
+ "4xl": any;
97
+ };
98
+ fonts: {
99
+ sans: any;
100
+ mono: any;
101
+ display: any;
102
+ body: any;
103
+ };
104
+ sizes: {
105
+ "0": any;
106
+ "1": any;
107
+ "2": any;
108
+ "3": any;
109
+ "4": any;
110
+ "5": any;
111
+ "6": any;
112
+ "7": any;
113
+ "8": any;
114
+ };
115
+ radii: {
116
+ "0": any;
117
+ "1": any;
118
+ "2": any;
119
+ "3": any;
120
+ round: any;
121
+ };
122
+ shadows: {
123
+ "0": any;
124
+ "1": any;
125
+ "2": any;
126
+ "3": any;
127
+ };
128
+ }, import("@stitches/react/types/config").DefaultThemeMap, {
129
+ bg: (value: {
130
+ readonly [$$PropertyValue]: "background";
131
+ }) => {
132
+ background: {
133
+ readonly [$$PropertyValue]: "background";
134
+ };
135
+ };
136
+ inset: (value: string | number | {
137
+ readonly [$$ScaleValue]: "space";
138
+ }) => {
139
+ top: string | number | {
140
+ readonly [$$ScaleValue]: "space";
141
+ };
142
+ right: string | number | {
143
+ readonly [$$ScaleValue]: "space";
144
+ };
145
+ bottom: string | number | {
146
+ readonly [$$ScaleValue]: "space";
147
+ };
148
+ left: string | number | {
149
+ readonly [$$ScaleValue]: "space";
150
+ };
151
+ };
152
+ size: (value: string | number | {
153
+ readonly [$$ScaleValue]: "size";
154
+ }) => {
155
+ height: string | number | {
156
+ readonly [$$ScaleValue]: "size";
157
+ };
158
+ width: string | number | {
159
+ readonly [$$ScaleValue]: "size";
160
+ };
161
+ };
162
+ p: (value: string | number | {
163
+ readonly [$$ScaleValue]: "space";
164
+ }) => {
165
+ padding: string | number | {
166
+ readonly [$$ScaleValue]: "space";
167
+ };
168
+ };
169
+ pt: (value: string | number | {
170
+ readonly [$$ScaleValue]: "space";
171
+ }) => {
172
+ paddingTop: string | number | {
173
+ readonly [$$ScaleValue]: "space";
174
+ };
175
+ };
176
+ pr: (value: string | number | {
177
+ readonly [$$ScaleValue]: "space";
178
+ }) => {
179
+ paddingRight: string | number | {
180
+ readonly [$$ScaleValue]: "space";
181
+ };
182
+ };
183
+ pb: (value: string | number | {
184
+ readonly [$$ScaleValue]: "space";
185
+ }) => {
186
+ paddingBottom: string | number | {
187
+ readonly [$$ScaleValue]: "space";
188
+ };
189
+ };
190
+ pl: (value: string | number | {
191
+ readonly [$$ScaleValue]: "space";
192
+ }) => {
193
+ paddingLeft: string | number | {
194
+ readonly [$$ScaleValue]: "space";
195
+ };
196
+ };
197
+ px: (value: string | number | {
198
+ readonly [$$ScaleValue]: "space";
199
+ }) => {
200
+ paddingLeft: string | number | {
201
+ readonly [$$ScaleValue]: "space";
202
+ };
203
+ paddingRight: string | number | {
204
+ readonly [$$ScaleValue]: "space";
205
+ };
206
+ };
207
+ py: (value: string | number | {
208
+ readonly [$$ScaleValue]: "space";
209
+ }) => {
210
+ paddingTop: string | number | {
211
+ readonly [$$ScaleValue]: "space";
212
+ };
213
+ paddingBottom: string | number | {
214
+ readonly [$$ScaleValue]: "space";
215
+ };
216
+ };
217
+ m: (value: string | number | {
218
+ readonly [$$ScaleValue]: "space";
219
+ }) => {
220
+ margin: string | number | {
221
+ readonly [$$ScaleValue]: "space";
222
+ };
223
+ };
224
+ mt: (value: string | number | {
225
+ readonly [$$ScaleValue]: "space";
226
+ }) => {
227
+ marginTop: string | number | {
228
+ readonly [$$ScaleValue]: "space";
229
+ };
230
+ };
231
+ mr: (value: string | number | {
232
+ readonly [$$ScaleValue]: "space";
233
+ }) => {
234
+ marginRight: string | number | {
235
+ readonly [$$ScaleValue]: "space";
236
+ };
237
+ };
238
+ mb: (value: string | number | {
239
+ readonly [$$ScaleValue]: "space";
240
+ }) => {
241
+ marginBottom: string | number | {
242
+ readonly [$$ScaleValue]: "space";
243
+ };
244
+ };
245
+ ml: (value: string | number | {
246
+ readonly [$$ScaleValue]: "space";
247
+ }) => {
248
+ marginLeft: string | number | {
249
+ readonly [$$ScaleValue]: "space";
250
+ };
251
+ };
252
+ mx: (value: string | number | {
253
+ readonly [$$ScaleValue]: "space";
254
+ }) => {
255
+ marginLeft: string | number | {
256
+ readonly [$$ScaleValue]: "space";
257
+ };
258
+ marginRight: string | number | {
259
+ readonly [$$ScaleValue]: "space";
260
+ };
261
+ };
262
+ my: (value: string | number | {
263
+ readonly [$$ScaleValue]: "space";
264
+ }) => {
265
+ marginTop: string | number | {
266
+ readonly [$$ScaleValue]: "space";
267
+ };
268
+ marginBottom: string | number | {
269
+ readonly [$$ScaleValue]: "space";
270
+ };
271
+ };
272
+ }>>;
273
+ declare const StyledTabContent: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsContentProps & React.RefAttributes<HTMLDivElement>>, {
274
+ theme?: "dark" | "light" | undefined;
275
+ }, {
7
276
  sm: string;
8
277
  md: string;
9
278
  lg: string;
@@ -270,8 +539,8 @@ declare const StyledRoot: import("@stitches/react/types/styled-component").Style
270
539
  };
271
540
  }>>;
272
541
  export declare const Tabs: React.FC<TabsProps> & {
273
- TriggerList: typeof TabsTriggerList;
274
- Trigger: typeof TabsTrigger;
275
- Content: typeof TabsContent;
542
+ TriggerList: typeof TriggerListWrapper;
543
+ Trigger: typeof TabTrigger;
544
+ Content: typeof StyledTabContent;
276
545
  };
277
546
  export {};
@@ -1 +1 @@
1
- import{Root as i}from"@radix-ui/react-tabs";import*as e from"react";import{styled as m}from"../../stitches.js";import{TabsTriggerList as s}from"./TabsTriggerList.js";import{TabsTrigger as a}from"./TabsTrigger.js";import{TabsContent as g}from"./TabsContent.js";const T=m(i,{width:"100%"}),r=({children:t,...o})=>e.createElement(T,{...o},t);r.TriggerList=s,r.Trigger=a,r.Content=g,r.displayName="Tabs";export{r as Tabs};
1
+ import{Root as l,Content as n}from"@radix-ui/react-tabs";import*as p from"react";import{styled as e}from"../../stitches.js";import{TriggerListWrapper as o}from"./TabsTriggerList.js";import{TabTrigger as s}from"./TabTrigger.js";import{passPropsToChildren as g}from"./utils.js";const h=e(l,{display:"flex",flexDirection:"column",variants:{theme:{light:{color:"$primary"},dark:{color:"white"}}}}),i=e(n,{flexGrow:1,fontFamily:"$body",variants:{theme:{light:{color:"$textForeground"},dark:{bg:"$primaryDark",color:"white"}}}}),r=({theme:t="light",children:m,...a})=>p.createElement(h,{theme:t,...a},g(m,{theme:t},[o,i]));r.TriggerList=o,r.Trigger=s,r.Content=i,r.displayName="Tabs";export{r as Tabs};
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
- import { ColorScheme } from '../../experiments/color-scheme';
3
- declare const StyledTriggerList: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsListProps & React.RefAttributes<HTMLDivElement>>, {}, {
2
+ interface ListProps extends React.ComponentProps<typeof StyledTriggerList> {
3
+ enableTabScrolling?: boolean;
4
+ scrollPercentage?: number;
5
+ }
6
+ declare const StyledTriggerList: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-tabs").TabsListProps & React.RefAttributes<HTMLDivElement>>, {
7
+ theme?: "dark" | "light" | undefined;
8
+ appearance?: "uppercase" | undefined;
9
+ }, {
4
10
  sm: string;
5
11
  md: string;
6
12
  lg: string;
@@ -266,7 +272,5 @@ declare const StyledTriggerList: import("@stitches/react/types/styled-component"
266
272
  };
267
273
  };
268
274
  }>>;
269
- export declare const TabsTriggerList: React.FC<React.ComponentProps<typeof StyledTriggerList> & {
270
- colorScheme?: typeof ColorScheme;
271
- }>;
275
+ export declare const TriggerListWrapper: React.FC<ListProps>;
272
276
  export {};
@@ -1 +1 @@
1
- import{List as g}from"@radix-ui/react-tabs";import t from"react";import{styled as i}from"../../stitches.js";import{useWindowSize as k}from"../../utilities/hooks/useWindowSize.js";import{useScrollPosition as C}from"../../utilities/hooks/useScrollPosition.js";import{useCallbackRefState as W}from"../../utilities/hooks/useCallbackRef.js";import{ActionIcon as v}from"../action-icon/ActionIcon.js";import{Icon as s}from"../icon/Icon.js";import{ChevronLeft as w,ChevronRight as y}from"@atom-learning/icons";import{ColorScheme as E}from"../../experiments/color-scheme/ColorScheme.js";const S=i(E,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),L=i(g,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),a=i(v,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),c=({children:n,colorScheme:m={},...d})=>{const[e,f]=W(),{width:h}=k(),{left:o}=C({elRef:e,delay:100}),r=t.useMemo(()=>e?e.scrollWidth>e.clientWidth:!1,[h,e]),p=t.useMemo(()=>r?o>0:!1,[o,r]),b=t.useMemo(()=>!e||!r?!1:e.scrollWidth-o-e.clientWidth>1,[e,o,r]),l=t.useCallback(u=>{!e||e.scroll({left:e.scrollLeft+e.clientWidth*u,behavior:"smooth"})},[e]);return t.createElement(S,{base:"slate",accent:"blue",interactive:"hiContrast1",...m,...d},p&&t.createElement(a,{label:"scroll left",size:"md",css:{left:0},onClick:()=>l(-.8)},t.createElement(s,{is:w})),t.createElement(L,{ref:f},n),b&&t.createElement(a,{label:"scroll right",size:"md",css:{right:0},onClick:()=>l(.8)},t.createElement(s,{is:y})))};c.displayName="TabsTriggerList";export{c as TabsTriggerList};
1
+ import{ChevronLeft as P,ChevronRight as R}from"@atom-learning/icons";import{List as _}from"@radix-ui/react-tabs";import{opacify as y}from"color2k";import o,{useRef as F,useState as f,useCallback as J,useEffect as k}from"react";import{debounce as K}from"throttle-debounce";import{ActionIcon as M}from"../action-icon/ActionIcon.js";import{Flex as X}from"../flex/Flex.js";import{Icon as W}from"../icon/Icon.js";import{theme as j,styled as x}from"../../stitches.js";import{TabTrigger as L}from"./TabTrigger.js";import{passPropsToChildren as C}from"./utils.js";const q=y("white",-.2),G=y(j.colors.primaryDark.value,-.2),T=x(M,{position:"absolute",transition:"all 125ms",variants:{theme:{light:{bg:`${q} !important`},dark:{bg:`${G} !important`,color:"currentColor !important"}},visible:{true:{opacity:1,visibility:"visible",pointerEvents:"all"},false:{opacity:0,visibility:"hidden",pointerEvents:"none"}}}}),S=x(_,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none",variants:{theme:{light:{borderBottom:"1px solid $tonal300"},dark:{bg:"$primaryDark",borderBottom:"1px solid $tonal200"}},appearance:{uppercase:{"& button":{textTransform:"uppercase"}}}}}),H=({children:h,theme:i,appearance:d,enableTabScrolling:$,scrollPercentage:z=10,...b})=>{const s=F(null),[u,a]=f(!1),[v,c]=f(!1),[D,I]=f(),g=J(t=>{const e=s.current;if(e){const{scrollWidth:l,scrollLeft:n,offsetWidth:m}=e,E=Math.round(l*(z/100));let p=n;if(t==="right"){const r=n+E;p=r+m<=l?r:l-m}else{const r=n-E;p=r>0?r:0}e.scroll({left:p,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:r,scrollLeft:w,offsetWidth:A}=e,B=r-(w+A);w===0?(a(!1),c(!0)):B<5?(c(!1),a(!0)):(a(!0),c(!0))},500)}},[]);return k(()=>{const t=K(500,()=>{I(window.innerWidth)});return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),k(()=>{var t;const e=s.current;if(e){const{offsetWidth:l,scrollWidth:n}=e,m=n>l;(t=e.scroll)==null||t.call(e,{left:0}),a(!1),c(m)}},[D]),u||v||$?o.createElement(X,{css:{position:"relative"}},o.createElement(T,{size:"lg",label:"Scroll Left",theme:i,onClick:()=>g("left"),visible:u,css:{left:0}},o.createElement(W,{is:P})),o.createElement(S,{...b,ref:s,appearance:d,theme:i},C(h,{theme:i},[L])),o.createElement(T,{size:"lg",label:"Scroll right",theme:i,onClick:()=>g("right"),visible:v,css:{right:0}},o.createElement(W,{is:R}))):o.createElement(S,{theme:i,...b,appearance:d,ref:s},C(h,{theme:i},[L]))};export{H as TriggerListWrapper};
@@ -0,0 +1,2 @@
1
+ import { JSXElementConstructor } from 'react';
2
+ export declare const passPropsToChildren: (children: any, props: Record<string, any>, allowedChildNodeTypes?: JSXElementConstructor<any>[]) => any;
@@ -0,0 +1 @@
1
+ import n from"react";const i=(o,t,e=[])=>n.Children.map(o,l=>n.isValidElement(l)&&e.includes(l==null?void 0:l.type)?n.cloneElement(l,{...t}):l);export{i as passPropsToChildren};
@@ -1 +1 @@
1
- import t from"react";import{styled as r}from"../../stitches.js";import{useWindowScrollPosition as s}from"../../utilities/hooks/useWindowScrollPosition.js";import{Divider as d}from"../divider/Divider.js";import{Flex as m}from"../flex/Flex.js";import{TopBarActionIcon as l}from"./TopBarActionIcon.js";import{TopBarBrandLogo as e,TopBarBrand as p,TopBarBrandName as h}from"./TopBarBrand.js";const c=()=>t.createElement(d,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),g=r("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${e}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${e}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),x=r(m,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),o=({size:i="md",...a})=>{const{y:n}=s();return t.createElement(g,{hasScrolled:!!n,size:i},t.createElement(x,{...a}))};o.Brand=p,o.BrandLogo=e,o.BrandName=h,o.ActionIcon=l,o.Divider=c,o.displayName="TopBar";export{o as TopBar};
1
+ import t from"react";import{styled as r}from"../../stitches.js";import{useScrollPosition as s}from"../../utilities/hooks/useScrollPosition.js";import{Divider as m}from"../divider/Divider.js";import{Flex as d}from"../flex/Flex.js";import{TopBarActionIcon as l}from"./TopBarActionIcon.js";import{TopBarBrandLogo as e,TopBarBrand as p,TopBarBrandName as h}from"./TopBarBrand.js";const c=()=>t.createElement(m,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),g=r("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${e}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${e}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),x=r(d,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),o=({size:i="md",...a})=>{const{y:n}=s();return t.createElement(g,{hasScrolled:!!n,size:i},t.createElement(x,{...a}))};o.Brand=p,o.BrandLogo=e,o.BrandName=h,o.ActionIcon=l,o.Divider=c,o.displayName="TopBar";export{o as TopBar};