@kushagradhawan/kookie-ui 0.1.120 → 0.1.121

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 (36) hide show
  1. package/components.css +41 -3
  2. package/dist/cjs/components/card.d.ts.map +1 -1
  3. package/dist/cjs/components/card.js +1 -1
  4. package/dist/cjs/components/card.js.map +3 -3
  5. package/dist/cjs/components/card.props.d.ts +4 -0
  6. package/dist/cjs/components/card.props.d.ts.map +1 -1
  7. package/dist/cjs/components/card.props.js +1 -1
  8. package/dist/cjs/components/card.props.js.map +2 -2
  9. package/dist/cjs/components/toolbar.d.ts +5 -6
  10. package/dist/cjs/components/toolbar.d.ts.map +1 -1
  11. package/dist/cjs/components/toolbar.js +1 -1
  12. package/dist/cjs/components/toolbar.js.map +3 -3
  13. package/dist/esm/components/card.d.ts.map +1 -1
  14. package/dist/esm/components/card.js +1 -1
  15. package/dist/esm/components/card.js.map +3 -3
  16. package/dist/esm/components/card.props.d.ts +4 -0
  17. package/dist/esm/components/card.props.d.ts.map +1 -1
  18. package/dist/esm/components/card.props.js +1 -1
  19. package/dist/esm/components/card.props.js.map +2 -2
  20. package/dist/esm/components/toolbar.d.ts +5 -6
  21. package/dist/esm/components/toolbar.d.ts.map +1 -1
  22. package/dist/esm/components/toolbar.js +1 -1
  23. package/dist/esm/components/toolbar.js.map +3 -3
  24. package/package.json +1 -1
  25. package/schemas/base-button.json +1 -1
  26. package/schemas/button.json +1 -1
  27. package/schemas/icon-button.json +1 -1
  28. package/schemas/index.json +6 -6
  29. package/schemas/toggle-button.json +1 -1
  30. package/schemas/toggle-icon-button.json +1 -1
  31. package/src/components/_internal/base-card.css +14 -0
  32. package/src/components/card.props.tsx +2 -0
  33. package/src/components/card.tsx +2 -1
  34. package/src/components/toolbar.css +51 -5
  35. package/src/components/toolbar.tsx +16 -24
  36. package/styles.css +41 -3
package/components.css CHANGED
@@ -5201,6 +5201,12 @@
5201
5201
  --base-card-border-radius: min(var(--radius-9), calc(var(--radius-5) + var(--space-5)));
5202
5202
  }
5203
5203
  }
5204
+ .rt-BaseCard:where([data-inset='true']) {
5205
+ --base-card-padding-top: 0px;
5206
+ --base-card-padding-right: 0px;
5207
+ --base-card-padding-bottom: 0px;
5208
+ --base-card-padding-left: 0px;
5209
+ }
5204
5210
  .rt-BaseCard:where(.rt-variant-outline) {
5205
5211
  --card-border-width: 1px;
5206
5212
  --card-background-color: transparent;
@@ -19994,8 +20000,34 @@
19994
20000
  z-index: 1;
19995
20001
  }
19996
20002
  .rt-ToolbarInner {
20003
+ display: grid;
20004
+ grid-template-columns: 1fr auto 1fr;
20005
+ align-items: center;
19997
20006
  width: 100%;
19998
20007
  height: 100%;
20008
+ gap: var(--space-2);
20009
+ }
20010
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarInner {
20011
+ grid-template-columns: 1fr;
20012
+ grid-template-rows: 1fr auto 1fr;
20013
+ }
20014
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarLeft {
20015
+ grid-column: 1;
20016
+ grid-row: 1;
20017
+ align-self: start;
20018
+ justify-self: center;
20019
+ }
20020
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarCenter {
20021
+ grid-column: 1;
20022
+ grid-row: 2;
20023
+ align-self: center;
20024
+ justify-self: center;
20025
+ }
20026
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarRight {
20027
+ grid-column: 1;
20028
+ grid-row: 3;
20029
+ align-self: end;
20030
+ justify-self: center;
19999
20031
  }
20000
20032
  .rt-Toolbar:where([data-anchor='top']) {
20001
20033
  top: 0;
@@ -20055,14 +20087,20 @@
20055
20087
  min-width: 0;
20056
20088
  flex-shrink: 1;
20057
20089
  }
20090
+ .rt-ToolbarSection {
20091
+ min-width: 0;
20092
+ }
20058
20093
  .rt-ToolbarLeft {
20059
- justify-content: flex-start;
20094
+ grid-column: 1;
20095
+ justify-self: start;
20060
20096
  }
20061
20097
  .rt-ToolbarCenter {
20062
- justify-content: center;
20098
+ grid-column: 2;
20099
+ justify-self: center;
20063
20100
  }
20064
20101
  .rt-ToolbarRight {
20065
- justify-content: flex-end;
20102
+ grid-column: 3;
20103
+ justify-self: end;
20066
20104
  }
20067
20105
  .rt-TooltipContent {
20068
20106
  box-sizing: border-box;
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,YAAY,GAAG,eAAe,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY;CAAG;AACpG,QAAA,MAAM,IAAI,kFAkBR,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,YAAY,GAAG,eAAe,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY;CAAG;AACpG,QAAA,MAAM,IAAI,kFAmBR,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var v=Object.create;var a=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var j=(r,o)=>{for(var e in o)a(r,e,{get:o[e],enumerable:!0})},d=(r,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of D(o))!N.call(r,p)&&p!==e&&a(r,p,{get:()=>o[p],enumerable:!(t=R(o,p))||t.enumerable});return r};var n=(r,o,e)=>(e=r!=null?v(x(r)):{},d(o||!r||!r.__esModule?a(e,"default",{value:r,enumerable:!0}):e,r)),w=r=>d(a({},"__esModule",{value:!0}),r);var E={};j(E,{Card:()=>s});module.exports=w(E);var f=n(require("react")),i=n(require("classnames")),P=require("radix-ui"),c=require("./card.props.js"),l=require("../helpers/extract-props.js"),C=require("../props/margin.props.js");const s=f.forwardRef((r,o)=>{const{asChild:e,className:t,panelBackground:p,material:y,flush:u,...g}=(0,l.extractProps)(r,c.cardPropDefs,C.marginPropDefs),m=y||p,h=e?P.Slot.Root:"div";return f.createElement(h,{ref:o,...g,"data-panel-background":m,"data-material":m,"data-flush":u?"true":void 0,className:(0,i.default)("rt-reset","rt-BaseCard","rt-Card",t)})});s.displayName="Card";
1
+ "use strict";var R=Object.create;var a=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var w=(r,e)=>{for(var o in e)a(r,o,{get:e[o],enumerable:!0})},d=(r,e,o,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of x(e))!j.call(r,t)&&t!==o&&a(r,t,{get:()=>e[t],enumerable:!(p=D(e,t))||p.enumerable});return r};var n=(r,e,o)=>(o=r!=null?R(N(r)):{},d(e||!r||!r.__esModule?a(o,"default",{value:r,enumerable:!0}):o,r)),E=r=>d(a({},"__esModule",{value:!0}),r);var M={};w(M,{Card:()=>s});module.exports=E(M);var i=n(require("react")),f=n(require("classnames")),P=require("radix-ui"),c=require("./card.props.js"),l=require("../helpers/extract-props.js"),C=require("../props/margin.props.js");const s=i.forwardRef((r,e)=>{const{asChild:o,className:p,panelBackground:t,material:u,flush:y,inset:g,...h}=(0,l.extractProps)(r,c.cardPropDefs,C.marginPropDefs),m=u||t,v=o?P.Slot.Root:"div";return i.createElement(v,{ref:e,...h,"data-panel-background":m,"data-material":m,"data-flush":y?"true":void 0,"data-inset":g?"true":void 0,className:(0,f.default)("rt-reset","rt-BaseCard","rt-Card",p)})});s.displayName="Card";
2
2
  //# sourceMappingURL=card.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/card.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBAErBC,EAA6B,2BAC7BC,EAA6B,uCAC7BC,EAA+B,oCAS/B,MAAMP,EAAOE,EAAM,WAAmC,CAACM,EAAOC,IAAiB,CAC7E,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,GAAGC,CAAU,KAAI,gBAC7EP,EACA,eACA,gBACF,EACMQ,EAAoBH,GAAYD,EAChCK,EAAOP,EAAU,OAAK,KAAO,MACnC,OACER,EAAA,cAACe,EAAA,CACC,IAAKR,EACJ,GAAGM,EACJ,wBAAuBC,EACvB,gBAAeA,EACf,aAAYF,EAAQ,OAAS,OAC7B,aAAW,EAAAI,SAAW,WAAY,cAAe,UAAWP,CAAS,EACvE,CAEJ,CAAC,EACDX,EAAK,YAAc",
6
- "names": ["card_exports", "__export", "Card", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_card_props", "import_extract_props", "import_margin_props", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "cardProps", "effectiveMaterial", "Comp", "classNames"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBAErBC,EAA6B,2BAC7BC,EAA6B,uCAC7BC,EAA+B,oCAS/B,MAAMP,EAAOE,EAAM,WAAmC,CAACM,EAAOC,IAAiB,CAC7E,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAU,KAAI,gBACpFR,EACA,eACA,gBACF,EACMS,EAAoBJ,GAAYD,EAChCM,EAAOR,EAAU,OAAK,KAAO,MACnC,OACER,EAAA,cAACgB,EAAA,CACC,IAAKT,EACJ,GAAGO,EACJ,wBAAuBC,EACvB,gBAAeA,EACf,aAAYH,EAAQ,OAAS,OAC7B,aAAYC,EAAQ,OAAS,OAC7B,aAAW,EAAAI,SAAW,WAAY,cAAe,UAAWR,CAAS,EACvE,CAEJ,CAAC,EACDX,EAAK,YAAc",
6
+ "names": ["card_exports", "__export", "Card", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_card_props", "import_extract_props", "import_margin_props", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "effectiveMaterial", "Comp", "classNames"]
7
7
  }
@@ -26,6 +26,10 @@ declare const cardPropDefs: {
26
26
  type: "boolean";
27
27
  default: false;
28
28
  };
29
+ inset: {
30
+ type: "boolean";
31
+ default: false;
32
+ };
29
33
  asChild: {
30
34
  type: "boolean";
31
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"card.props.d.ts","sourceRoot":"","sources":["../../../src/components/card.props.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAajB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"card.props.d.ts","sourceRoot":"","sources":["../../../src/components/card.props.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAejB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var i=(s,e)=>{for(var t in e)n(s,t,{get:e[t],enumerable:!0})},d=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of f(e))!p.call(s,a)&&a!==t&&n(s,a,{get:()=>e[a],enumerable:!(o=l(e,a))||o.enumerable});return s};var c=s=>d(n({},"__esModule",{value:!0}),s);var P={};i(P,{cardPropDefs:()=>u});module.exports=c(P);var r=require("../props/as-child.prop.js");const m=["1","2","3","4","5"],v=["surface","outline","classic","ghost","soft"],y=["solid","translucent"],D=["solid","translucent"],u={...r.asChildPropDef,size:{type:"enum",className:"rt-r-size",values:m,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:v,default:"outline"},panelBackground:{type:"enum",values:y,default:void 0},material:{type:"enum",values:D,default:void 0},flush:{type:"boolean",default:!1}};
1
+ "use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var i=(s,e)=>{for(var t in e)n(s,t,{get:e[t],enumerable:!0})},d=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of f(e))!p.call(s,a)&&a!==t&&n(s,a,{get:()=>e[a],enumerable:!(o=u(e,a))||o.enumerable});return s};var c=s=>d(n({},"__esModule",{value:!0}),s);var P={};i(P,{cardPropDefs:()=>l});module.exports=c(P);var r=require("../props/as-child.prop.js");const m=["1","2","3","4","5"],y=["surface","outline","classic","ghost","soft"],v=["solid","translucent"],D=["solid","translucent"],l={...r.asChildPropDef,size:{type:"enum",className:"rt-r-size",values:m,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:y,default:"outline"},panelBackground:{type:"enum",values:v,default:void 0},material:{type:"enum",values:D,default:void 0},flush:{type:"boolean",default:!1},inset:{type:"boolean",default:!1}};
2
2
  //# sourceMappingURL=card.props.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/card.props.tsx"],
4
- "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA+B,qCAI/B,MAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCN,EAAe,CACnB,GAAG,iBACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQG,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,CAC3C",
4
+ "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA+B,qCAI/B,MAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCN,EAAe,CACnB,GAAG,iBACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQG,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,CAC3C",
6
6
  "names": ["card_props_exports", "__export", "cardPropDefs", "__toCommonJS", "import_as_child_prop", "sizes", "variants", "panelBackgrounds", "materials"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Heading } from './heading.js';
3
3
  import type { CardProps } from './card.js';
4
- import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
4
+ import type { FlexProps } from './flex.js';
5
5
  type Anchor = 'top' | 'bottom' | 'left' | 'right';
6
6
  type SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
7
7
  interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
@@ -23,11 +23,10 @@ interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
23
23
  offset?: SpaceScale;
24
24
  }
25
25
  declare const ToolbarRoot: React.ForwardRefExoticComponent<ToolbarRootProps & React.RefAttributes<HTMLDivElement>>;
26
- interface ToolbarSectionProps extends ComponentPropsWithout<'div', RemovedProps> {
27
- }
28
- declare const ToolbarLeft: React.ForwardRefExoticComponent<ToolbarSectionProps & React.RefAttributes<HTMLDivElement>>;
29
- declare const ToolbarCenter: React.ForwardRefExoticComponent<ToolbarSectionProps & React.RefAttributes<HTMLDivElement>>;
30
- declare const ToolbarRight: React.ForwardRefExoticComponent<ToolbarSectionProps & React.RefAttributes<HTMLDivElement>>;
26
+ type ToolbarSectionProps = FlexProps;
27
+ declare const ToolbarLeft: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
28
+ declare const ToolbarCenter: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
29
+ declare const ToolbarRight: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
31
30
  interface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {
32
31
  }
33
32
  declare const ToolbarTitle: React.ForwardRefExoticComponent<ToolbarTitleProps & React.RefAttributes<HTMLHeadingElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAOzF,KAAK,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MA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OF,OAAO,EACL,OAAO,EACP,WAAW,IAAI,IAAI,EACnB,WAAW,IAAI,IAAI,EACnB,aAAa,IAAI,MAAM,EACvB,YAAY,IAAI,KAAK,EACrB,YAAY,IAAI,KAAK,GACtB,CAAC;AACF,YAAY,EACV,gBAAgB,IAAI,SAAS,EAC7B,mBAAmB,IAAI,SAAS,EAChC,mBAAmB,IAAI,WAAW,EAClC,mBAAmB,IAAI,UAAU,EACjC,iBAAiB,IAAI,UAAU,GAChC,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var k=Object.create;var f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var I=(o,e)=>{for(var t in e)f(o,t,{get:e[t],enumerable:!0})},x=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $(e))!G.call(o,n)&&n!==t&&f(o,n,{get:()=>e[n],enumerable:!(r=D(e,n))||r.enumerable});return o};var v=(o,e,t)=>(t=o!=null?k(A(o)):{},x(e||!o||!o.__esModule?f(t,"default",{value:o,enumerable:!0}):t,o)),q=o=>x(f({},"__esModule",{value:!0}),o);var B={};I(B,{Center:()=>b,Left:()=>T,Right:()=>d,Root:()=>m,Title:()=>g,Toolbar:()=>i});module.exports=q(B);var a=v(require("react")),s=v(require("classnames")),N=require("./card.js"),p=require("./flex.js"),L=require("./heading.js");const m=a.forwardRef((o,e)=>{const{anchor:t="top",floating:r=!1,offset:n="2",size:y="1",variant:h="ghost",material:H,className:w,style:P,children:z,...F}=o,c=t==="top"||t==="bottom",S=a.useRef(null),j=a.useCallback(l=>{S.current=l,typeof e=="function"?e(l):e&&(e.current=l)},[e]);a.useEffect(()=>{const l=S.current;if(!l)return;const R=l.parentElement;if(!R)return;const C=()=>{let u=c?l.offsetHeight:l.offsetWidth;if(r){const M=getComputedStyle(l),O=parseFloat(M.marginTop)||0;u+=O*2}c?R.style.setProperty("--rt-toolbar-height",`${u}px`):R.style.setProperty("--rt-toolbar-width",`${u}px`)};C();const E=new ResizeObserver(C);return E.observe(l),()=>E.disconnect()},[c,r]);const W=r?{margin:`var(--space-${n})`,...P}:P;return a.createElement(N.Card,{ref:j,size:y,variant:h,material:H,"data-anchor":t,"data-floating":r||void 0,className:(0,s.default)("rt-Toolbar",w),style:W,...F},a.createElement(p.Flex,{align:"center",justify:"between",direction:c?"row":"column",gap:"2",className:"rt-ToolbarInner"},z))});m.displayName="Toolbar.Root";const T=a.forwardRef(({className:o,children:e,...t},r)=>a.createElement(p.Flex,{ref:r,align:"center",gap:"2",flexShrink:"0",className:(0,s.default)("rt-ToolbarSection","rt-ToolbarLeft",o),...t},e));T.displayName="Toolbar.Left";const b=a.forwardRef(({className:o,children:e,...t},r)=>a.createElement(p.Flex,{ref:r,align:"center",justify:"center",flexGrow:"1",minWidth:"0",className:(0,s.default)("rt-ToolbarSection","rt-ToolbarCenter",o),...t},e));b.displayName="Toolbar.Center";const d=a.forwardRef(({className:o,children:e,...t},r)=>a.createElement(p.Flex,{ref:r,align:"center",gap:"2",flexShrink:"0",className:(0,s.default)("rt-ToolbarSection","rt-ToolbarRight",o),...t},e));d.displayName="Toolbar.Right";const g=a.forwardRef(({className:o,size:e="3",weight:t="medium",truncate:r=!0,children:n,...y},h)=>a.createElement(L.Heading,{ref:h,size:e,weight:t,truncate:r,className:(0,s.default)("rt-ToolbarTitle",o),...y},n));g.displayName="Toolbar.Title";const i=m;i.Left=T,i.Center=b,i.Right=d,i.Title=g;
1
+ "use strict";var $=Object.create;var f=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var q=(o,e)=>{for(var t in e)f(o,t,{get:e[t],enumerable:!0})},v=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of W(e))!I.call(o,a)&&a!==t&&f(o,a,{get:()=>e[a],enumerable:!(r=A(e,a))||r.enumerable});return o};var x=(o,e,t)=>(t=o!=null?$(k(o)):{},v(e||!o||!o.__esModule?f(t,"default",{value:o,enumerable:!0}):t,o)),B=o=>v(f({},"__esModule",{value:!0}),o);var G={};q(G,{Center:()=>y,Left:()=>b,Right:()=>d,Root:()=>m,Title:()=>g,Toolbar:()=>c});module.exports=B(G);var l=x(require("react")),p=x(require("classnames")),N=require("./card.js"),T=require("./flex.js"),L=require("./heading.js");const m=l.forwardRef((o,e)=>{const{anchor:t="top",floating:r=!1,offset:a="2",size:n="1",variant:i="ghost",material:H,className:F,style:h,children:z,...j}=o,R=t==="top"||t==="bottom",S=l.useRef(null),w=l.useCallback(s=>{S.current=s,typeof e=="function"?e(s):e&&(e.current=s)},[e]);l.useEffect(()=>{const s=S.current;if(!s)return;const u=s.parentElement;if(!u)return;const C=()=>{let P=R?s.offsetHeight:s.offsetWidth;if(r){const O=getComputedStyle(s),D=parseFloat(O.marginTop)||0;P+=D*2}R?u.style.setProperty("--rt-toolbar-height",`${P}px`):u.style.setProperty("--rt-toolbar-width",`${P}px`)};C();const E=new ResizeObserver(C);return E.observe(s),()=>E.disconnect()},[R,r]);const M=r?{margin:`var(--space-${a})`,...h}:h;return l.createElement(N.Card,{ref:w,size:n,variant:i,material:H,"data-anchor":t,"data-floating":r||void 0,className:(0,p.default)("rt-Toolbar",F),style:M,...j},l.createElement("div",{className:"rt-ToolbarInner"},z))});m.displayName="Toolbar.Root";const b=l.forwardRef(({gap:o="2",align:e="center",className:t,children:r,...a},n)=>l.createElement(T.Flex,{ref:n,align:e,gap:o,className:(0,p.default)("rt-ToolbarSection","rt-ToolbarLeft",t),...a},r));b.displayName="Toolbar.Left";const y=l.forwardRef(({gap:o="2",align:e="center",justify:t="center",className:r,children:a,...n},i)=>l.createElement(T.Flex,{ref:i,align:e,justify:t,gap:o,className:(0,p.default)("rt-ToolbarSection","rt-ToolbarCenter",r),...n},a));y.displayName="Toolbar.Center";const d=l.forwardRef(({gap:o="2",align:e="center",justify:t="end",className:r,children:a,...n},i)=>l.createElement(T.Flex,{ref:i,align:e,justify:t,gap:o,className:(0,p.default)("rt-ToolbarSection","rt-ToolbarRight",r),...n},a));d.displayName="Toolbar.Right";const g=l.forwardRef(({className:o,size:e="2",weight:t="medium",truncate:r=!0,children:a,...n},i)=>l.createElement(L.Heading,{ref:i,size:e,weight:t,truncate:r,className:(0,p.default)("rt-ToolbarTitle",o),...n},a));g.displayName="Toolbar.Title";const c=m;c.Left=b,c.Center=y,c.Right=d,c.Title=g;
2
2
  //# sourceMappingURL=toolbar.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/toolbar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Card } from './card.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\n\nimport type { CardProps } from './card.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// ============================================================================\n// Toolbar Root\n// ============================================================================\n\ntype ToolbarRootElement = React.ElementRef<'div'>;\ntype Anchor = 'top' | 'bottom' | 'left' | 'right';\ntype SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ninterface ToolbarRootProps extends Omit<CardProps, 'asChild'> {\n /**\n * Which edge to anchor to. Sets position: sticky and the appropriate edge.\n * @default \"top\"\n */\n anchor?: Anchor;\n /**\n * Floating mode adds margin from edges for a detached look with absolute positioning.\n * When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.\n * @default false\n */\n floating?: boolean;\n /**\n * Margin offset from edges when floating. Uses space scale values.\n * @default \"2\"\n */\n offset?: SpaceScale;\n}\n\nconst ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(\n (props, forwardedRef) => {\n const {\n anchor = 'top',\n floating = false,\n offset = '2',\n size = '1',\n variant = 'ghost',\n material,\n className,\n style,\n children,\n ...restProps\n } = props;\n\n const isHorizontal = anchor === 'top' || anchor === 'bottom';\n const internalRef = React.useRef<HTMLDivElement>(null);\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Expose height/width as CSS variable on parent element\n React.useEffect(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const parent = element.parentElement;\n if (!parent) return;\n\n const update = () => {\n let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;\n\n // For floating mode, include the margin in the total space\n if (floating) {\n const computedStyle = getComputedStyle(element);\n const margin = parseFloat(computedStyle.marginTop) || 0;\n dimension += margin * 2;\n }\n\n if (isHorizontal) {\n parent.style.setProperty('--rt-toolbar-height', `${dimension}px`);\n } else {\n parent.style.setProperty('--rt-toolbar-width', `${dimension}px`);\n }\n };\n\n update();\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [isHorizontal, floating]);\n\n const computedStyle = floating\n ? { margin: `var(--space-${offset})`, ...style }\n : style;\n\n return (\n <Card\n ref={mergedRef}\n size={size}\n variant={variant}\n material={material}\n data-anchor={anchor}\n data-floating={floating || undefined}\n className={classNames('rt-Toolbar', className)}\n style={computedStyle}\n {...restProps}\n >\n <Flex\n align=\"center\"\n justify=\"between\"\n direction={isHorizontal ? 'row' : 'column'}\n gap=\"2\"\n className=\"rt-ToolbarInner\"\n >\n {children}\n </Flex>\n </Card>\n );\n },\n);\nToolbarRoot.displayName = 'Toolbar.Root';\n\n// ============================================================================\n// Toolbar Left (for horizontal) / Start (alias)\n// ============================================================================\n\ntype ToolbarSectionElement = React.ElementRef<'div'>;\ninterface ToolbarSectionProps extends ComponentPropsWithout<'div', RemovedProps> {}\n\nconst ToolbarLeft = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align=\"center\"\n gap=\"2\"\n flexShrink=\"0\"\n className={classNames('rt-ToolbarSection', 'rt-ToolbarLeft', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarLeft.displayName = 'Toolbar.Left';\n\n// ============================================================================\n// Toolbar Center\n// ============================================================================\n\nconst ToolbarCenter = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align=\"center\"\n justify=\"center\"\n flexGrow=\"1\"\n minWidth=\"0\"\n className={classNames('rt-ToolbarSection', 'rt-ToolbarCenter', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarCenter.displayName = 'Toolbar.Center';\n\n// ============================================================================\n// Toolbar Right (for horizontal) / End (alias)\n// ============================================================================\n\nconst ToolbarRight = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align=\"center\"\n gap=\"2\"\n flexShrink=\"0\"\n className={classNames('rt-ToolbarSection', 'rt-ToolbarRight', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarRight.displayName = 'Toolbar.Right';\n\n// ============================================================================\n// Toolbar Title\n// ============================================================================\n\ntype ToolbarTitleElement = React.ElementRef<typeof Heading>;\ninterface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {}\n\nconst ToolbarTitle = React.forwardRef<ToolbarTitleElement, ToolbarTitleProps>(\n ({ className, size = '3', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (\n <Heading\n ref={forwardedRef}\n size={size}\n weight={weight}\n truncate={truncate}\n className={classNames('rt-ToolbarTitle', className)}\n {...props}\n >\n {children}\n </Heading>\n ),\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Left: typeof ToolbarLeft;\n Center: typeof ToolbarCenter;\n Right: typeof ToolbarRight;\n Title: typeof ToolbarTitle;\n};\n\nToolbar.Left = ToolbarLeft;\nToolbar.Center = ToolbarCenter;\nToolbar.Right = ToolbarRight;\nToolbar.Title = ToolbarTitle;\n\nexport {\n Toolbar,\n ToolbarRoot as Root,\n ToolbarLeft as Left,\n ToolbarCenter as Center,\n ToolbarRight as Right,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarRootProps as RootProps,\n ToolbarSectionProps as LeftProps,\n ToolbarSectionProps as CenterProps,\n ToolbarSectionProps as RightProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAAqB,qBACrBC,EAAqB,qBACrBC,EAAwB,wBAgCxB,MAAMR,EAAcI,EAAM,WACxB,CAACK,EAAOC,IAAiB,CACvB,KAAM,CACJ,OAAAC,EAAS,MACT,SAAAC,EAAW,GACX,OAAAC,EAAS,IACT,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAIX,EAEEY,EAAeV,IAAW,OAASA,IAAW,SAC9CW,EAAclB,EAAM,OAAuB,IAAI,EAG/CmB,EAAYnB,EAAM,YACrBoB,GAAgC,CAC9BF,EAA8D,QAAUE,EACrE,OAAOd,GAAiB,WAC1BA,EAAac,CAAI,EACRd,IACTA,EAAa,QAAUc,EAE3B,EACA,CAACd,CAAY,CACf,EAGAN,EAAM,UAAU,IAAM,CACpB,MAAMqB,EAAUH,EAAY,QAC5B,GAAI,CAACG,EAAS,OAEd,MAAMC,EAASD,EAAQ,cACvB,GAAI,CAACC,EAAQ,OAEb,MAAMC,EAAS,IAAM,CACnB,IAAI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,QAAQ,SACR,SAAS,IACT,SAAS,IACT,aAAW,EAAAsB,SAAW,oBAAqB,mBAAoBf,CAAS,EACvE,GAAGR,GAEHU,CACH,CAEJ,EACAtB,EAAc,YAAc,iBAM5B,MAAME,EAAeK,EAAM,WACzB,CAAC,CAAE,UAAAa,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IAClCN,EAAA,cAAC,QACC,IAAKM,EACL,MAAM,SACN,IAAI,IACJ,WAAW,IACX,aAAW,EAAAsB,SAAW,oBAAqB,kBAAmBf,CAAS,EACtE,GAAGR,GAEHU,CACH,CAEJ,EACApB,EAAa,YAAc,gBAS3B,MAAME,EAAeG,EAAM,WACzB,CAAC,CAAE,UAAAa,EAAW,KAAAH,EAAO,IAAK,OAAAmB,EAAS,SAAU,SAAAC,EAAW,GAAM,SAAAf,EAAU,GAAGV,CAAM,EAAGC,IAClFN,EAAA,cAAC,WACC,IAAKM,EACL,KAAMI,EACN,OAAQmB,EACR,SAAUC,EACV,aAAW,EAAAF,SAAW,kBAAmBf,CAAS,EACjD,GAAGR,GAEHU,CACH,CAEJ,EACAlB,EAAa,YAAc,gBAM3B,MAAMC,EAAUF,EAOhBE,EAAQ,KAAOJ,EACfI,EAAQ,OAASL,EACjBK,EAAQ,MAAQH,EAChBG,EAAQ,MAAQD",
6
- "names": ["toolbar_exports", "__export", "ToolbarCenter", "ToolbarLeft", "ToolbarRight", "ToolbarRoot", "ToolbarTitle", "Toolbar", "__toCommonJS", "React", "import_classnames", "import_card", "import_flex", "import_heading", "props", "forwardedRef", "anchor", "floating", "offset", "size", "variant", "material", "className", "style", "children", "restProps", "isHorizontal", "internalRef", "mergedRef", "node", "element", "parent", "update", "dimension", "computedStyle", "margin", "resizeObserver", "classNames", "weight", "truncate"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Card } from './card.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\n\nimport type { CardProps } from './card.js';\nimport type { FlexProps } from './flex.js';\n\n// ============================================================================\n// Toolbar Root\n// ============================================================================\n\ntype ToolbarRootElement = React.ElementRef<'div'>;\ntype Anchor = 'top' | 'bottom' | 'left' | 'right';\ntype SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ninterface ToolbarRootProps extends Omit<CardProps, 'asChild'> {\n /**\n * Which edge to anchor to. Sets position: sticky and the appropriate edge.\n * @default \"top\"\n */\n anchor?: Anchor;\n /**\n * Floating mode adds margin from edges for a detached look with absolute positioning.\n * When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.\n * @default false\n */\n floating?: boolean;\n /**\n * Margin offset from edges when floating. Uses space scale values.\n * @default \"2\"\n */\n offset?: SpaceScale;\n}\n\nconst ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(\n (props, forwardedRef) => {\n const {\n anchor = 'top',\n floating = false,\n offset = '2',\n size = '1',\n variant = 'ghost',\n material,\n className,\n style,\n children,\n ...restProps\n } = props;\n\n const isHorizontal = anchor === 'top' || anchor === 'bottom';\n const internalRef = React.useRef<HTMLDivElement>(null);\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Expose height/width as CSS variable on parent element\n React.useEffect(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const parent = element.parentElement;\n if (!parent) return;\n\n const update = () => {\n let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;\n\n // For floating mode, include the margin in the total space\n if (floating) {\n const computedStyle = getComputedStyle(element);\n const margin = parseFloat(computedStyle.marginTop) || 0;\n dimension += margin * 2;\n }\n\n if (isHorizontal) {\n parent.style.setProperty('--rt-toolbar-height', `${dimension}px`);\n } else {\n parent.style.setProperty('--rt-toolbar-width', `${dimension}px`);\n }\n };\n\n update();\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [isHorizontal, floating]);\n\n const computedStyle = floating\n ? { margin: `var(--space-${offset})`, ...style }\n : style;\n\n return (\n <Card\n ref={mergedRef}\n size={size}\n variant={variant}\n material={material}\n data-anchor={anchor}\n data-floating={floating || undefined}\n className={classNames('rt-Toolbar', className)}\n style={computedStyle}\n {...restProps}\n >\n <div className=\"rt-ToolbarInner\">\n {children}\n </div>\n </Card>\n );\n },\n);\nToolbarRoot.displayName = 'Toolbar.Root';\n\n// ============================================================================\n// Toolbar Left (for horizontal) / Start (alias)\n// ============================================================================\n\ntype ToolbarSectionElement = React.ElementRef<'div'>;\ntype ToolbarSectionProps = FlexProps;\n\nconst ToolbarLeft = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ gap = '2', align = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n gap={gap}\n className={classNames('rt-ToolbarSection', 'rt-ToolbarLeft', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarLeft.displayName = 'Toolbar.Left';\n\n// ============================================================================\n// Toolbar Center\n// ============================================================================\n\nconst ToolbarCenter = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-ToolbarSection', 'rt-ToolbarCenter', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarCenter.displayName = 'Toolbar.Center';\n\n// ============================================================================\n// Toolbar Right (for horizontal) / End (alias)\n// ============================================================================\n\nconst ToolbarRight = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'end', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-ToolbarSection', 'rt-ToolbarRight', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarRight.displayName = 'Toolbar.Right';\n\n// ============================================================================\n// Toolbar Title\n// ============================================================================\n\ntype ToolbarTitleElement = React.ElementRef<typeof Heading>;\ninterface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {}\n\nconst ToolbarTitle = React.forwardRef<ToolbarTitleElement, ToolbarTitleProps>(\n ({ className, size = '2', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (\n <Heading\n ref={forwardedRef}\n size={size}\n weight={weight}\n truncate={truncate}\n className={classNames('rt-ToolbarTitle', className)}\n {...props}\n >\n {children}\n </Heading>\n ),\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Left: typeof ToolbarLeft;\n Center: typeof ToolbarCenter;\n Right: typeof ToolbarRight;\n Title: typeof ToolbarTitle;\n};\n\nToolbar.Left = ToolbarLeft;\nToolbar.Center = ToolbarCenter;\nToolbar.Right = ToolbarRight;\nToolbar.Title = ToolbarTitle;\n\nexport {\n Toolbar,\n ToolbarRoot as Root,\n ToolbarLeft as Left,\n ToolbarCenter as Center,\n ToolbarRight as Right,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarRootProps as RootProps,\n ToolbarSectionProps as LeftProps,\n ToolbarSectionProps as CenterProps,\n ToolbarSectionProps as RightProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,SAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAAqB,qBACrBC,EAAqB,qBACrBC,EAAwB,wBAgCxB,MAAMR,EAAcI,EAAM,WACxB,CAACK,EAAOC,IAAiB,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AAMI,EACN,OAAQsB,EACR,SAAUC,EACV,aAAW,EAAAL,SAAW,kBAAmBf,CAAS,EACjD,GAAGR,GAEHU,CACH,CAEJ,EACAlB,EAAa,YAAc,gBAM3B,MAAMC,EAAUF,EAOhBE,EAAQ,KAAOJ,EACfI,EAAQ,OAASL,EACjBK,EAAQ,MAAQH,EAChBG,EAAQ,MAAQD",
6
+ "names": ["toolbar_exports", "__export", "ToolbarCenter", "ToolbarLeft", "ToolbarRight", "ToolbarRoot", "ToolbarTitle", "Toolbar", "__toCommonJS", "React", "import_classnames", "import_card", "import_flex", "import_heading", "props", "forwardedRef", "anchor", "floating", "offset", "size", "variant", "material", "className", "style", "children", "restProps", "isHorizontal", "internalRef", "mergedRef", "node", "element", "parent", "update", "dimension", "computedStyle", "margin", "resizeObserver", "classNames", "gap", "align", "justify", "weight", "truncate"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,YAAY,GAAG,eAAe,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY;CAAG;AACpG,QAAA,MAAM,IAAI,kFAkBR,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,YAAY,GAAG,eAAe,CAAC,OAAO,YAAY,CAAC,CAAC;AACzD,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,YAAY;CAAG;AACpG,QAAA,MAAM,IAAI,kFAmBR,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import*as o from"react";import P from"classnames";import{Slot as c}from"radix-ui";import{cardPropDefs as l}from"./card.props.js";import{extractProps as C}from"../helpers/extract-props.js";import{marginPropDefs as y}from"../props/margin.props.js";const e=o.forwardRef((p,t)=>{const{asChild:a,className:s,panelBackground:m,material:d,flush:n,...f}=C(p,l,y),r=d||m,i=a?c.Root:"div";return o.createElement(i,{ref:t,...f,"data-panel-background":r,"data-material":r,"data-flush":n?"true":void 0,className:P("rt-reset","rt-BaseCard","rt-Card",s)})});e.displayName="Card";export{e as Card};
1
+ import*as e from"react";import c from"classnames";import{Slot as l}from"radix-ui";import{cardPropDefs as C}from"./card.props.js";import{extractProps as u}from"../helpers/extract-props.js";import{marginPropDefs as y}from"../props/margin.props.js";const o=e.forwardRef((t,p)=>{const{asChild:a,className:s,panelBackground:m,material:d,flush:n,inset:i,...f}=u(t,C,y),r=d||m,P=a?l.Root:"div";return e.createElement(P,{ref:p,...f,"data-panel-background":r,"data-material":r,"data-flush":n?"true":void 0,"data-inset":i?"true":void 0,className:c("rt-reset","rt-BaseCard","rt-Card",s)})});o.displayName="Card";export{o as Card};
2
2
  //# sourceMappingURL=card.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/card.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
5
- "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,WAErB,OAAS,gBAAAC,MAAoB,kBAC7B,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,kBAAAC,MAAsB,2BAS/B,MAAMC,EAAON,EAAM,WAAmC,CAACO,EAAOC,IAAiB,CAC7E,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,GAAGC,CAAU,EAAIV,EAC7EG,EACAJ,EACAE,CACF,EACMU,EAAoBH,GAAYD,EAChCK,EAAOP,EAAUP,EAAK,KAAO,MACnC,OACEF,EAAA,cAACgB,EAAA,CACC,IAAKR,EACJ,GAAGM,EACJ,wBAAuBC,EACvB,gBAAeA,EACf,aAAYF,EAAQ,OAAS,OAC7B,UAAWZ,EAAW,WAAY,cAAe,UAAWS,CAAS,EACvE,CAEJ,CAAC,EACDJ,EAAK,YAAc",
6
- "names": ["React", "classNames", "Slot", "cardPropDefs", "extractProps", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "cardProps", "effectiveMaterial", "Comp"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n"],
5
+ "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,WAErB,OAAS,gBAAAC,MAAoB,kBAC7B,OAAS,gBAAAC,MAAoB,8BAC7B,OAAS,kBAAAC,MAAsB,2BAS/B,MAAMC,EAAON,EAAM,WAAmC,CAACO,EAAOC,IAAiB,CAC7E,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAU,EAAIX,EACpFG,EACAJ,EACAE,CACF,EACMW,EAAoBJ,GAAYD,EAChCM,EAAOR,EAAUP,EAAK,KAAO,MACnC,OACEF,EAAA,cAACiB,EAAA,CACC,IAAKT,EACJ,GAAGO,EACJ,wBAAuBC,EACvB,gBAAeA,EACf,aAAYH,EAAQ,OAAS,OAC7B,aAAYC,EAAQ,OAAS,OAC7B,UAAWb,EAAW,WAAY,cAAe,UAAWS,CAAS,EACvE,CAEJ,CAAC,EACDJ,EAAK,YAAc",
6
+ "names": ["React", "classNames", "Slot", "cardPropDefs", "extractProps", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "effectiveMaterial", "Comp"]
7
7
  }
@@ -26,6 +26,10 @@ declare const cardPropDefs: {
26
26
  type: "boolean";
27
27
  default: false;
28
28
  };
29
+ inset: {
30
+ type: "boolean";
31
+ default: false;
32
+ };
29
33
  asChild: {
30
34
  type: "boolean";
31
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"card.props.d.ts","sourceRoot":"","sources":["../../../src/components/card.props.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAajB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"card.props.d.ts","sourceRoot":"","sources":["../../../src/components/card.props.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAejB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{asChildPropDef as e}from"../props/as-child.prop.js";const s=["1","2","3","4","5"],a=["surface","outline","classic","ghost","soft"],t=["solid","translucent"],n=["solid","translucent"],o={...e,size:{type:"enum",className:"rt-r-size",values:s,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:a,default:"outline"},panelBackground:{type:"enum",values:t,default:void 0},material:{type:"enum",values:n,default:void 0},flush:{type:"boolean",default:!1}};export{o as cardPropDefs};
1
+ import{asChildPropDef as e}from"../props/as-child.prop.js";const s=["1","2","3","4","5"],a=["surface","outline","classic","ghost","soft"],t=["solid","translucent"],n=["solid","translucent"],o={...e,size:{type:"enum",className:"rt-r-size",values:s,default:"1",responsive:!0},variant:{type:"enum",className:"rt-variant",values:a,default:"outline"},panelBackground:{type:"enum",values:t,default:void 0},material:{type:"enum",values:n,default:void 0},flush:{type:"boolean",default:!1},inset:{type:"boolean",default:!1}};export{o as cardPropDefs};
2
2
  //# sourceMappingURL=card.props.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/card.props.tsx"],
4
- "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n"],
5
- "mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAI/B,MAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGL,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQC,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,CAC3C",
4
+ "sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n"],
5
+ "mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAI/B,MAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGL,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQC,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,CAC3C",
6
6
  "names": ["asChildPropDef", "sizes", "variants", "panelBackgrounds", "materials", "cardPropDefs"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Heading } from './heading.js';
3
3
  import type { CardProps } from './card.js';
4
- import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
4
+ import type { FlexProps } from './flex.js';
5
5
  type Anchor = 'top' | 'bottom' | 'left' | 'right';
6
6
  type SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
7
7
  interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
@@ -23,11 +23,10 @@ interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
23
23
  offset?: SpaceScale;
24
24
  }
25
25
  declare const ToolbarRoot: React.ForwardRefExoticComponent<ToolbarRootProps & React.RefAttributes<HTMLDivElement>>;
26
- interface ToolbarSectionProps extends ComponentPropsWithout<'div', RemovedProps> {
27
- }
28
- declare const ToolbarLeft: React.ForwardRefExoticComponent<ToolbarSectionProps & React.RefAttributes<HTMLDivElement>>;
29
- declare const ToolbarCenter: React.ForwardRefExoticComponent<ToolbarSectionProps & React.RefAttributes<HTMLDivElement>>;
30
- declare const ToolbarRight: React.ForwardRefExoticComponent<ToolbarSectionProps & React.RefAttributes<HTMLDivElement>>;
26
+ type ToolbarSectionProps = FlexProps;
27
+ declare const ToolbarLeft: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
28
+ declare const ToolbarCenter: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
29
+ declare const ToolbarRight: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLDivElement>>;
31
30
  interface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {
32
31
  }
33
32
  declare const ToolbarTitle: React.ForwardRefExoticComponent<ToolbarTitleProps & React.RefAttributes<HTMLHeadingElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/components/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAOzF,KAAK,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAClD,KAAK,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtE,UAAU,gBAAiB,SAAQ,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;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C,mBAAmB,IAAI,WAAW,EAClC,mBAAmB,IAAI,UAAU,EACjC,iBAAiB,IAAI,UAAU,GAChC,CAAC"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import n from"classnames";import{Card as F}from"./card.js";import{Flex as p}from"./flex.js";import{Heading as j}from"./heading.js";const d=e.forwardRef((l,o)=>{const{anchor:r="top",floating:t=!1,offset:c="2",size:f="1",variant:m="ghost",material:E,className:x,style:u,children:v,...N}=l,i=r==="top"||r==="bottom",P=e.useRef(null),L=e.useCallback(a=>{P.current=a,typeof o=="function"?o(a):o&&(o.current=a)},[o]);e.useEffect(()=>{const a=P.current;if(!a)return;const T=a.parentElement;if(!T)return;const S=()=>{let b=i?a.offsetHeight:a.offsetWidth;if(t){const w=getComputedStyle(a),z=parseFloat(w.marginTop)||0;b+=z*2}i?T.style.setProperty("--rt-toolbar-height",`${b}px`):T.style.setProperty("--rt-toolbar-width",`${b}px`)};S();const C=new ResizeObserver(S);return C.observe(a),()=>C.disconnect()},[i,t]);const H=t?{margin:`var(--space-${c})`,...u}:u;return e.createElement(F,{ref:L,size:f,variant:m,material:E,"data-anchor":r,"data-floating":t||void 0,className:n("rt-Toolbar",x),style:H,...N},e.createElement(p,{align:"center",justify:"between",direction:i?"row":"column",gap:"2",className:"rt-ToolbarInner"},v))});d.displayName="Toolbar.Root";const g=e.forwardRef(({className:l,children:o,...r},t)=>e.createElement(p,{ref:t,align:"center",gap:"2",flexShrink:"0",className:n("rt-ToolbarSection","rt-ToolbarLeft",l),...r},o));g.displayName="Toolbar.Left";const y=e.forwardRef(({className:l,children:o,...r},t)=>e.createElement(p,{ref:t,align:"center",justify:"center",flexGrow:"1",minWidth:"0",className:n("rt-ToolbarSection","rt-ToolbarCenter",l),...r},o));y.displayName="Toolbar.Center";const h=e.forwardRef(({className:l,children:o,...r},t)=>e.createElement(p,{ref:t,align:"center",gap:"2",flexShrink:"0",className:n("rt-ToolbarSection","rt-ToolbarRight",l),...r},o));h.displayName="Toolbar.Right";const R=e.forwardRef(({className:l,size:o="3",weight:r="medium",truncate:t=!0,children:c,...f},m)=>e.createElement(j,{ref:m,size:o,weight:r,truncate:t,className:n("rt-ToolbarTitle",l),...f},c));R.displayName="Toolbar.Title";const s=d;s.Left=g,s.Center=y,s.Right=h,s.Title=R;export{y as Center,g as Left,h as Right,d as Root,R as Title,s as Toolbar};
1
+ import*as e from"react";import p from"classnames";import{Card as j}from"./card.js";import{Flex as b}from"./flex.js";import{Heading as w}from"./heading.js";const y=e.forwardRef((l,o)=>{const{anchor:r="top",floating:t=!1,offset:s="2",size:n="1",variant:i="ghost",material:E,className:v,style:P,children:x,...N}=l,f=r==="top"||r==="bottom",h=e.useRef(null),L=e.useCallback(a=>{h.current=a,typeof o=="function"?o(a):o&&(o.current=a)},[o]);e.useEffect(()=>{const a=h.current;if(!a)return;const T=a.parentElement;if(!T)return;const S=()=>{let m=f?a.offsetHeight:a.offsetWidth;if(t){const F=getComputedStyle(a),z=parseFloat(F.marginTop)||0;m+=z*2}f?T.style.setProperty("--rt-toolbar-height",`${m}px`):T.style.setProperty("--rt-toolbar-width",`${m}px`)};S();const C=new ResizeObserver(S);return C.observe(a),()=>C.disconnect()},[f,t]);const H=t?{margin:`var(--space-${s})`,...P}:P;return e.createElement(j,{ref:L,size:n,variant:i,material:E,"data-anchor":r,"data-floating":t||void 0,className:p("rt-Toolbar",v),style:H,...N},e.createElement("div",{className:"rt-ToolbarInner"},x))});y.displayName="Toolbar.Root";const d=e.forwardRef(({gap:l="2",align:o="center",className:r,children:t,...s},n)=>e.createElement(b,{ref:n,align:o,gap:l,className:p("rt-ToolbarSection","rt-ToolbarLeft",r),...s},t));d.displayName="Toolbar.Left";const g=e.forwardRef(({gap:l="2",align:o="center",justify:r="center",className:t,children:s,...n},i)=>e.createElement(b,{ref:i,align:o,justify:r,gap:l,className:p("rt-ToolbarSection","rt-ToolbarCenter",t),...n},s));g.displayName="Toolbar.Center";const R=e.forwardRef(({gap:l="2",align:o="center",justify:r="end",className:t,children:s,...n},i)=>e.createElement(b,{ref:i,align:o,justify:r,gap:l,className:p("rt-ToolbarSection","rt-ToolbarRight",t),...n},s));R.displayName="Toolbar.Right";const u=e.forwardRef(({className:l,size:o="2",weight:r="medium",truncate:t=!0,children:s,...n},i)=>e.createElement(w,{ref:i,size:o,weight:r,truncate:t,className:p("rt-ToolbarTitle",l),...n},s));u.displayName="Toolbar.Title";const c=y;c.Left=d,c.Center=g,c.Right=R,c.Title=u;export{g as Center,d as Left,R as Right,y as Root,u as Title,c as Toolbar};
2
2
  //# sourceMappingURL=toolbar.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/toolbar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Card } from './card.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\n\nimport type { CardProps } from './card.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// ============================================================================\n// Toolbar Root\n// ============================================================================\n\ntype ToolbarRootElement = React.ElementRef<'div'>;\ntype Anchor = 'top' | 'bottom' | 'left' | 'right';\ntype SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ninterface ToolbarRootProps extends Omit<CardProps, 'asChild'> {\n /**\n * Which edge to anchor to. Sets position: sticky and the appropriate edge.\n * @default \"top\"\n */\n anchor?: Anchor;\n /**\n * Floating mode adds margin from edges for a detached look with absolute positioning.\n * When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.\n * @default false\n */\n floating?: boolean;\n /**\n * Margin offset from edges when floating. Uses space scale values.\n * @default \"2\"\n */\n offset?: SpaceScale;\n}\n\nconst ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(\n (props, forwardedRef) => {\n const {\n anchor = 'top',\n floating = false,\n offset = '2',\n size = '1',\n variant = 'ghost',\n material,\n className,\n style,\n children,\n ...restProps\n } = props;\n\n const isHorizontal = anchor === 'top' || anchor === 'bottom';\n const internalRef = React.useRef<HTMLDivElement>(null);\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Expose height/width as CSS variable on parent element\n React.useEffect(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const parent = element.parentElement;\n if (!parent) return;\n\n const update = () => {\n let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;\n\n // For floating mode, include the margin in the total space\n if (floating) {\n const computedStyle = getComputedStyle(element);\n const margin = parseFloat(computedStyle.marginTop) || 0;\n dimension += margin * 2;\n }\n\n if (isHorizontal) {\n parent.style.setProperty('--rt-toolbar-height', `${dimension}px`);\n } else {\n parent.style.setProperty('--rt-toolbar-width', `${dimension}px`);\n }\n };\n\n update();\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [isHorizontal, floating]);\n\n const computedStyle = floating\n ? { margin: `var(--space-${offset})`, ...style }\n : style;\n\n return (\n <Card\n ref={mergedRef}\n size={size}\n variant={variant}\n material={material}\n data-anchor={anchor}\n data-floating={floating || undefined}\n className={classNames('rt-Toolbar', className)}\n style={computedStyle}\n {...restProps}\n >\n <Flex\n align=\"center\"\n justify=\"between\"\n direction={isHorizontal ? 'row' : 'column'}\n gap=\"2\"\n className=\"rt-ToolbarInner\"\n >\n {children}\n </Flex>\n </Card>\n );\n },\n);\nToolbarRoot.displayName = 'Toolbar.Root';\n\n// ============================================================================\n// Toolbar Left (for horizontal) / Start (alias)\n// ============================================================================\n\ntype ToolbarSectionElement = React.ElementRef<'div'>;\ninterface ToolbarSectionProps extends ComponentPropsWithout<'div', RemovedProps> {}\n\nconst ToolbarLeft = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align=\"center\"\n gap=\"2\"\n flexShrink=\"0\"\n className={classNames('rt-ToolbarSection', 'rt-ToolbarLeft', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarLeft.displayName = 'Toolbar.Left';\n\n// ============================================================================\n// Toolbar Center\n// ============================================================================\n\nconst ToolbarCenter = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align=\"center\"\n justify=\"center\"\n flexGrow=\"1\"\n minWidth=\"0\"\n className={classNames('rt-ToolbarSection', 'rt-ToolbarCenter', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarCenter.displayName = 'Toolbar.Center';\n\n// ============================================================================\n// Toolbar Right (for horizontal) / End (alias)\n// ============================================================================\n\nconst ToolbarRight = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align=\"center\"\n gap=\"2\"\n flexShrink=\"0\"\n className={classNames('rt-ToolbarSection', 'rt-ToolbarRight', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarRight.displayName = 'Toolbar.Right';\n\n// ============================================================================\n// Toolbar Title\n// ============================================================================\n\ntype ToolbarTitleElement = React.ElementRef<typeof Heading>;\ninterface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {}\n\nconst ToolbarTitle = React.forwardRef<ToolbarTitleElement, ToolbarTitleProps>(\n ({ className, size = '3', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (\n <Heading\n ref={forwardedRef}\n size={size}\n weight={weight}\n truncate={truncate}\n className={classNames('rt-ToolbarTitle', className)}\n {...props}\n >\n {children}\n </Heading>\n ),\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Left: typeof ToolbarLeft;\n Center: typeof ToolbarCenter;\n Right: typeof ToolbarRight;\n Title: typeof ToolbarTitle;\n};\n\nToolbar.Left = ToolbarLeft;\nToolbar.Center = ToolbarCenter;\nToolbar.Right = ToolbarRight;\nToolbar.Title = ToolbarTitle;\n\nexport {\n Toolbar,\n ToolbarRoot as Root,\n ToolbarLeft as Left,\n ToolbarCenter as Center,\n ToolbarRight as Right,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarRootProps as RootProps,\n ToolbarSectionProps as LeftProps,\n ToolbarSectionProps as CenterProps,\n ToolbarSectionProps as RightProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
5
- "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,QAAAC,MAAY,YACrB,OAAS,QAAAC,MAAY,YACrB,OAAS,WAAAC,MAAe,eAgCxB,MAAMC,EAAcL,EAAM,WACxB,CAACM,EAAOC,IAAiB,CACvB,KAAM,CACJ,OAAAC,EAAS,MACT,SAAAC,EAAW,GACX,OAAAC,EAAS,IACT,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAIX,EAEEY,EAAeV,IAAW,OAASA,IAAW,SAC9CW,EAAcnB,EAAM,OAAuB,IAAI,EAG/CoB,EAAYpB,EAAM,YACrBqB,GAAgC,CAC9BF,EAA8D,QAAUE,EACrE,OAAOd,GAAiB,WAC1BA,EAAac,CAAI,EACRd,IACTA,EAAa,QAAUc,EAE3B,EACA,CAACd,CAAY,CACf,EAGAP,EAAM,UAAU,IAAM,CACpB,MAAMsB,EAAUH,EAAY,QAC5B,GAAI,CAACG,EAAS,OAEd,MAAMC,EAASD,EAAQ,cACvB,GAAI,CAACC,EAAQ,OAEb,MAAMC,EAAS,IAAM,CACnB,IAAIC,EAAYP,EAAeI,EAAQ,aAAeA,EAAQ,YAG9D,GAAIb,EAAU,CACZ,MAAMiB,E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,CAAS,EACvE,GAAGR,GAEHU,CACH,CAEJ,EACAc,EAAc,YAAc,iBAM5B,MAAMC,EAAe/B,EAAM,WACzB,CAAC,CAAE,UAAAc,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IAClCP,EAAA,cAACG,EAAA,CACC,IAAKI,EACL,MAAM,SACN,IAAI,IACJ,WAAW,IACX,UAAWN,EAAW,oBAAqB,kBAAmBa,CAAS,EACtE,GAAGR,GAEHU,CACH,CAEJ,EACAe,EAAa,YAAc,gBAS3B,MAAMC,EAAehC,EAAM,WACzB,CAAC,CAAE,UAAAc,EAAW,KAAAH,EAAO,IAAK,OAAAsB,EAAS,SAAU,SAAAC,EAAW,GAAM,SAAAlB,EAAU,GAAGV,CAAM,EAAGC,IAClFP,EAAA,cAACI,EAAA,CACC,IAAKG,EACL,KAAMI,EACN,OAAQsB,EACR,SAAUC,EACV,UAAWjC,EAAW,kBAAmBa,CAAS,EACjD,GAAGR,GAEHU,CACH,CAEJ,EACAgB,EAAa,YAAc,gBAM3B,MAAMG,EAAU9B,EAOhB8B,EAAQ,KAAON,EACfM,EAAQ,OAASL,EACjBK,EAAQ,MAAQJ,EAChBI,EAAQ,MAAQH",
6
- "names": ["React", "classNames", "Card", "Flex", "Heading", "ToolbarRoot", "props", "forwardedRef", "anchor", "floating", "offset", "size", "variant", "material", "className", "style", "children", "restProps", "isHorizontal", "internalRef", "mergedRef", "node", "element", "parent", "update", "dimension", "computedStyle", "margin", "resizeObserver", "ToolbarLeft", "ToolbarCenter", "ToolbarRight", "ToolbarTitle", "weight", "truncate", "Toolbar"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { Card } from './card.js';\nimport { Flex } from './flex.js';\nimport { Heading } from './heading.js';\n\nimport type { CardProps } from './card.js';\nimport type { FlexProps } from './flex.js';\n\n// ============================================================================\n// Toolbar Root\n// ============================================================================\n\ntype ToolbarRootElement = React.ElementRef<'div'>;\ntype Anchor = 'top' | 'bottom' | 'left' | 'right';\ntype SpaceScale = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ninterface ToolbarRootProps extends Omit<CardProps, 'asChild'> {\n /**\n * Which edge to anchor to. Sets position: sticky and the appropriate edge.\n * @default \"top\"\n */\n anchor?: Anchor;\n /**\n * Floating mode adds margin from edges for a detached look with absolute positioning.\n * When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.\n * @default false\n */\n floating?: boolean;\n /**\n * Margin offset from edges when floating. Uses space scale values.\n * @default \"2\"\n */\n offset?: SpaceScale;\n}\n\nconst ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(\n (props, forwardedRef) => {\n const {\n anchor = 'top',\n floating = false,\n offset = '2',\n size = '1',\n variant = 'ghost',\n material,\n className,\n style,\n children,\n ...restProps\n } = props;\n\n const isHorizontal = anchor === 'top' || anchor === 'bottom';\n const internalRef = React.useRef<HTMLDivElement>(null);\n\n // Merge refs\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n (internalRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Expose height/width as CSS variable on parent element\n React.useEffect(() => {\n const element = internalRef.current;\n if (!element) return;\n\n const parent = element.parentElement;\n if (!parent) return;\n\n const update = () => {\n let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;\n\n // For floating mode, include the margin in the total space\n if (floating) {\n const computedStyle = getComputedStyle(element);\n const margin = parseFloat(computedStyle.marginTop) || 0;\n dimension += margin * 2;\n }\n\n if (isHorizontal) {\n parent.style.setProperty('--rt-toolbar-height', `${dimension}px`);\n } else {\n parent.style.setProperty('--rt-toolbar-width', `${dimension}px`);\n }\n };\n\n update();\n\n const resizeObserver = new ResizeObserver(update);\n resizeObserver.observe(element);\n\n return () => resizeObserver.disconnect();\n }, [isHorizontal, floating]);\n\n const computedStyle = floating\n ? { margin: `var(--space-${offset})`, ...style }\n : style;\n\n return (\n <Card\n ref={mergedRef}\n size={size}\n variant={variant}\n material={material}\n data-anchor={anchor}\n data-floating={floating || undefined}\n className={classNames('rt-Toolbar', className)}\n style={computedStyle}\n {...restProps}\n >\n <div className=\"rt-ToolbarInner\">\n {children}\n </div>\n </Card>\n );\n },\n);\nToolbarRoot.displayName = 'Toolbar.Root';\n\n// ============================================================================\n// Toolbar Left (for horizontal) / Start (alias)\n// ============================================================================\n\ntype ToolbarSectionElement = React.ElementRef<'div'>;\ntype ToolbarSectionProps = FlexProps;\n\nconst ToolbarLeft = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ gap = '2', align = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n gap={gap}\n className={classNames('rt-ToolbarSection', 'rt-ToolbarLeft', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarLeft.displayName = 'Toolbar.Left';\n\n// ============================================================================\n// Toolbar Center\n// ============================================================================\n\nconst ToolbarCenter = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'center', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-ToolbarSection', 'rt-ToolbarCenter', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarCenter.displayName = 'Toolbar.Center';\n\n// ============================================================================\n// Toolbar Right (for horizontal) / End (alias)\n// ============================================================================\n\nconst ToolbarRight = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(\n ({ gap = '2', align = 'center', justify = 'end', className, children, ...props }, forwardedRef) => (\n <Flex\n ref={forwardedRef}\n align={align}\n justify={justify}\n gap={gap}\n className={classNames('rt-ToolbarSection', 'rt-ToolbarRight', className)}\n {...props}\n >\n {children}\n </Flex>\n ),\n);\nToolbarRight.displayName = 'Toolbar.Right';\n\n// ============================================================================\n// Toolbar Title\n// ============================================================================\n\ntype ToolbarTitleElement = React.ElementRef<typeof Heading>;\ninterface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {}\n\nconst ToolbarTitle = React.forwardRef<ToolbarTitleElement, ToolbarTitleProps>(\n ({ className, size = '2', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (\n <Heading\n ref={forwardedRef}\n size={size}\n weight={weight}\n truncate={truncate}\n className={classNames('rt-ToolbarTitle', className)}\n {...props}\n >\n {children}\n </Heading>\n ),\n);\nToolbarTitle.displayName = 'Toolbar.Title';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nconst Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Left: typeof ToolbarLeft;\n Center: typeof ToolbarCenter;\n Right: typeof ToolbarRight;\n Title: typeof ToolbarTitle;\n};\n\nToolbar.Left = ToolbarLeft;\nToolbar.Center = ToolbarCenter;\nToolbar.Right = ToolbarRight;\nToolbar.Title = ToolbarTitle;\n\nexport {\n Toolbar,\n ToolbarRoot as Root,\n ToolbarLeft as Left,\n ToolbarCenter as Center,\n ToolbarRight as Right,\n ToolbarTitle as Title,\n};\nexport type {\n ToolbarRootProps as RootProps,\n ToolbarSectionProps as LeftProps,\n ToolbarSectionProps as CenterProps,\n ToolbarSectionProps as RightProps,\n ToolbarTitleProps as TitleProps,\n};\n"],
5
+ "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,QAAAC,MAAY,YACrB,OAAS,QAAAC,MAAY,YACrB,OAAS,WAAAC,MAAe,eAgCxB,MAAMC,EAAcL,EAAM,WACxB,CAACM,EAAOC,IAAiB,CACvB,KAAM,CACJ,OAAAC,EAAS,MACT,SAAAC,EAAW,GACX,OAAAC,EAAS,IACT,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAIX,EAEEY,EAAeV,IAAW,OAASA,IAAW,SA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,MAAQJ,EAChBI,EAAQ,MAAQH",
6
+ "names": ["React", "classNames", "Card", "Flex", "Heading", "ToolbarRoot", "props", "forwardedRef", "anchor", "floating", "offset", "size", "variant", "material", "className", "style", "children", "restProps", "isHorizontal", "internalRef", "mergedRef", "node", "element", "parent", "update", "dimension", "computedStyle", "margin", "resizeObserver", "ToolbarLeft", "gap", "align", "ToolbarCenter", "justify", "ToolbarRight", "ToolbarTitle", "weight", "truncate", "Toolbar"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kushagradhawan/kookie-ui",
3
- "version": "0.1.120",
3
+ "version": "0.1.121",
4
4
  "description": "A modern React component library with beautiful design tokens, flexible theming, and comprehensive documentation",
5
5
  "keywords": [
6
6
  "react",
@@ -279,6 +279,6 @@
279
279
  "title": "Base-button Component Props",
280
280
  "description": "Props schema for the base-button component in Kookie UI",
281
281
  "version": "1.0.0",
282
- "generatedAt": "2026-01-09T07:08:13.212Z",
282
+ "generatedAt": "2026-01-09T12:06:24.248Z",
283
283
  "source": "Zod schema"
284
284
  }
@@ -530,6 +530,6 @@
530
530
  "title": "Button Component Props",
531
531
  "description": "Props schema for the button component in Kookie UI",
532
532
  "version": "1.0.0",
533
- "generatedAt": "2026-01-09T07:08:13.218Z",
533
+ "generatedAt": "2026-01-09T12:06:24.254Z",
534
534
  "source": "Zod schema"
535
535
  }
@@ -313,6 +313,6 @@
313
313
  "title": "Icon-button Component Props",
314
314
  "description": "Props schema for the icon-button component in Kookie UI",
315
315
  "version": "1.0.0",
316
- "generatedAt": "2026-01-09T07:08:13.219Z",
316
+ "generatedAt": "2026-01-09T12:06:24.255Z",
317
317
  "source": "Zod schema"
318
318
  }
@@ -3,7 +3,7 @@
3
3
  "title": "Kookie UI Button Components",
4
4
  "description": "Complete JSON Schema collection for all button components in Kookie UI",
5
5
  "version": "1.0.0",
6
- "generatedAt": "2026-01-09T07:08:13.222Z",
6
+ "generatedAt": "2026-01-09T12:06:24.258Z",
7
7
  "source": "Zod schemas",
8
8
  "components": {
9
9
  "base-button": {
@@ -287,7 +287,7 @@
287
287
  "title": "Base-button Component Props",
288
288
  "description": "Props schema for the base-button component in Kookie UI",
289
289
  "version": "1.0.0",
290
- "generatedAt": "2026-01-09T07:08:13.212Z",
290
+ "generatedAt": "2026-01-09T12:06:24.248Z",
291
291
  "source": "Zod schema"
292
292
  },
293
293
  "button": {
@@ -822,7 +822,7 @@
822
822
  "title": "Button Component Props",
823
823
  "description": "Props schema for the button component in Kookie UI",
824
824
  "version": "1.0.0",
825
- "generatedAt": "2026-01-09T07:08:13.218Z",
825
+ "generatedAt": "2026-01-09T12:06:24.254Z",
826
826
  "source": "Zod schema"
827
827
  },
828
828
  "icon-button": {
@@ -1140,7 +1140,7 @@
1140
1140
  "title": "Icon-button Component Props",
1141
1141
  "description": "Props schema for the icon-button component in Kookie UI",
1142
1142
  "version": "1.0.0",
1143
- "generatedAt": "2026-01-09T07:08:13.219Z",
1143
+ "generatedAt": "2026-01-09T12:06:24.255Z",
1144
1144
  "source": "Zod schema"
1145
1145
  },
1146
1146
  "toggle-button": {
@@ -1683,7 +1683,7 @@
1683
1683
  "title": "Toggle-button Component Props",
1684
1684
  "description": "Props schema for the toggle-button component in Kookie UI",
1685
1685
  "version": "1.0.0",
1686
- "generatedAt": "2026-01-09T07:08:13.221Z",
1686
+ "generatedAt": "2026-01-09T12:06:24.257Z",
1687
1687
  "source": "Zod schema"
1688
1688
  },
1689
1689
  "toggle-icon-button": {
@@ -2009,7 +2009,7 @@
2009
2009
  "title": "Toggle-icon-button Component Props",
2010
2010
  "description": "Props schema for the toggle-icon-button component in Kookie UI",
2011
2011
  "version": "1.0.0",
2012
- "generatedAt": "2026-01-09T07:08:13.222Z",
2012
+ "generatedAt": "2026-01-09T12:06:24.258Z",
2013
2013
  "source": "Zod schema"
2014
2014
  }
2015
2015
  }
@@ -538,6 +538,6 @@
538
538
  "title": "Toggle-button Component Props",
539
539
  "description": "Props schema for the toggle-button component in Kookie UI",
540
540
  "version": "1.0.0",
541
- "generatedAt": "2026-01-09T07:08:13.221Z",
541
+ "generatedAt": "2026-01-09T12:06:24.257Z",
542
542
  "source": "Zod schema"
543
543
  }
@@ -321,6 +321,6 @@
321
321
  "title": "Toggle-icon-button Component Props",
322
322
  "description": "Props schema for the toggle-icon-button component in Kookie UI",
323
323
  "version": "1.0.0",
324
- "generatedAt": "2026-01-09T07:08:13.222Z",
324
+ "generatedAt": "2026-01-09T12:06:24.258Z",
325
325
  "source": "Zod schema"
326
326
  }
@@ -132,6 +132,20 @@
132
132
  }
133
133
  }
134
134
 
135
+ /* * * * * * * * * * * * * * * * * * * */
136
+ /* */
137
+ /* Inset */
138
+ /* Resets padding to 0, keeps radius */
139
+ /* */
140
+ /* * * * * * * * * * * * * * * * * * * */
141
+
142
+ .rt-BaseCard:where([data-inset='true']) {
143
+ --base-card-padding-top: 0px;
144
+ --base-card-padding-right: 0px;
145
+ --base-card-padding-bottom: 0px;
146
+ --base-card-padding-left: 0px;
147
+ }
148
+
135
149
  /* * * * * * * * * * * * * * * * * * * */
136
150
  /* */
137
151
  /* Variants / Outline */
@@ -14,12 +14,14 @@ const cardPropDefs = {
14
14
  panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },
15
15
  material: { type: 'enum', values: materials, default: undefined },
16
16
  flush: { type: 'boolean', default: false },
17
+ inset: { type: 'boolean', default: false },
17
18
  } satisfies {
18
19
  size: PropDef<(typeof sizes)[number]>;
19
20
  variant: PropDef<(typeof variants)[number]>;
20
21
  panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;
21
22
  material: PropDef<(typeof materials)[number] | undefined>;
22
23
  flush: PropDef<boolean>;
24
+ inset: PropDef<boolean>;
23
25
  };
24
26
 
25
27
  export { cardPropDefs };
@@ -14,7 +14,7 @@ type CardElement = React.ElementRef<'div'>;
14
14
  type CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;
15
15
  interface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}
16
16
  const Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {
17
- const { asChild, className, panelBackground, material, flush, ...cardProps } = extractProps(
17
+ const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(
18
18
  props,
19
19
  cardPropDefs,
20
20
  marginPropDefs,
@@ -28,6 +28,7 @@ const Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {
28
28
  data-panel-background={effectiveMaterial}
29
29
  data-material={effectiveMaterial}
30
30
  data-flush={flush ? 'true' : undefined}
31
+ data-inset={inset ? 'true' : undefined}
31
32
  className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}
32
33
  />
33
34
  );
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable selector-max-specificity */
1
2
  /* Toolbar Component */
2
3
 
3
4
  .rt-Toolbar {
@@ -8,10 +9,35 @@
8
9
  /* Use pt/pb/pl/pr="var(--rt-toolbar-height)" on content to avoid overlap */
9
10
  }
10
11
 
12
+ /* Grid layout for true centering */
11
13
  .rt-ToolbarInner {
12
- /* Ensure inner flex container takes full space */
14
+ display: grid;
15
+ grid-template-columns: 1fr auto 1fr;
16
+ align-items: center;
13
17
  width: 100%;
14
18
  height: 100%;
19
+ gap: var(--space-2);
20
+ }
21
+
22
+ /* Vertical toolbars use row-based grid */
23
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarInner {
24
+ grid-template-columns: 1fr;
25
+ grid-template-rows: 1fr auto 1fr;
26
+ }
27
+
28
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarLeft {
29
+ grid-column: 1;
30
+ grid-row: 1;
31
+ }
32
+
33
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarCenter {
34
+ grid-column: 1;
35
+ grid-row: 2;
36
+ }
37
+
38
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarRight {
39
+ grid-column: 1;
40
+ grid-row: 3;
15
41
  }
16
42
 
17
43
  /* * * * * * * * * * * * * * * * * * * */
@@ -141,17 +167,37 @@
141
167
  /* * * * * * * * * * * * * * * * * * * */
142
168
 
143
169
  .rt-ToolbarSection {
144
- /* Base section styles */
170
+ min-width: 0;
145
171
  }
146
172
 
147
173
  .rt-ToolbarLeft {
148
- justify-content: flex-start;
174
+ grid-column: 1;
175
+ justify-self: start;
149
176
  }
150
177
 
151
178
  .rt-ToolbarCenter {
152
- justify-content: center;
179
+ grid-column: 2;
180
+ justify-self: center;
153
181
  }
154
182
 
183
+ /* Ensure Right always stays in the right column */
155
184
  .rt-ToolbarRight {
156
- justify-content: flex-end;
185
+ grid-column: 3;
186
+ justify-self: end;
187
+ }
188
+
189
+ /* Vertical toolbar section alignment */
190
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarLeft {
191
+ align-self: start;
192
+ justify-self: center;
193
+ }
194
+
195
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarCenter {
196
+ align-self: center;
197
+ justify-self: center;
198
+ }
199
+
200
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarRight {
201
+ align-self: end;
202
+ justify-self: center;
157
203
  }
@@ -6,7 +6,7 @@ import { Flex } from './flex.js';
6
6
  import { Heading } from './heading.js';
7
7
 
8
8
  import type { CardProps } from './card.js';
9
- import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
9
+ import type { FlexProps } from './flex.js';
10
10
 
11
11
  // ============================================================================
12
12
  // Toolbar Root
@@ -115,15 +115,9 @@ const ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(
115
115
  style={computedStyle}
116
116
  {...restProps}
117
117
  >
118
- <Flex
119
- align="center"
120
- justify="between"
121
- direction={isHorizontal ? 'row' : 'column'}
122
- gap="2"
123
- className="rt-ToolbarInner"
124
- >
118
+ <div className="rt-ToolbarInner">
125
119
  {children}
126
- </Flex>
120
+ </div>
127
121
  </Card>
128
122
  );
129
123
  },
@@ -135,15 +129,14 @@ ToolbarRoot.displayName = 'Toolbar.Root';
135
129
  // ============================================================================
136
130
 
137
131
  type ToolbarSectionElement = React.ElementRef<'div'>;
138
- interface ToolbarSectionProps extends ComponentPropsWithout<'div', RemovedProps> {}
132
+ type ToolbarSectionProps = FlexProps;
139
133
 
140
134
  const ToolbarLeft = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(
141
- ({ className, children, ...props }, forwardedRef) => (
135
+ ({ gap = '2', align = 'center', className, children, ...props }, forwardedRef) => (
142
136
  <Flex
143
137
  ref={forwardedRef}
144
- align="center"
145
- gap="2"
146
- flexShrink="0"
138
+ align={align}
139
+ gap={gap}
147
140
  className={classNames('rt-ToolbarSection', 'rt-ToolbarLeft', className)}
148
141
  {...props}
149
142
  >
@@ -158,13 +151,12 @@ ToolbarLeft.displayName = 'Toolbar.Left';
158
151
  // ============================================================================
159
152
 
160
153
  const ToolbarCenter = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(
161
- ({ className, children, ...props }, forwardedRef) => (
154
+ ({ gap = '2', align = 'center', justify = 'center', className, children, ...props }, forwardedRef) => (
162
155
  <Flex
163
156
  ref={forwardedRef}
164
- align="center"
165
- justify="center"
166
- flexGrow="1"
167
- minWidth="0"
157
+ align={align}
158
+ justify={justify}
159
+ gap={gap}
168
160
  className={classNames('rt-ToolbarSection', 'rt-ToolbarCenter', className)}
169
161
  {...props}
170
162
  >
@@ -179,12 +171,12 @@ ToolbarCenter.displayName = 'Toolbar.Center';
179
171
  // ============================================================================
180
172
 
181
173
  const ToolbarRight = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(
182
- ({ className, children, ...props }, forwardedRef) => (
174
+ ({ gap = '2', align = 'center', justify = 'end', className, children, ...props }, forwardedRef) => (
183
175
  <Flex
184
176
  ref={forwardedRef}
185
- align="center"
186
- gap="2"
187
- flexShrink="0"
177
+ align={align}
178
+ justify={justify}
179
+ gap={gap}
188
180
  className={classNames('rt-ToolbarSection', 'rt-ToolbarRight', className)}
189
181
  {...props}
190
182
  >
@@ -202,7 +194,7 @@ type ToolbarTitleElement = React.ElementRef<typeof Heading>;
202
194
  interface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {}
203
195
 
204
196
  const ToolbarTitle = React.forwardRef<ToolbarTitleElement, ToolbarTitleProps>(
205
- ({ className, size = '3', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (
197
+ ({ className, size = '2', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (
206
198
  <Heading
207
199
  ref={forwardedRef}
208
200
  size={size}
package/styles.css CHANGED
@@ -10233,6 +10233,12 @@
10233
10233
  --base-card-border-radius: min(var(--radius-9), calc(var(--radius-5) + var(--space-5)));
10234
10234
  }
10235
10235
  }
10236
+ .rt-BaseCard:where([data-inset='true']){
10237
+ --base-card-padding-top: 0px;
10238
+ --base-card-padding-right: 0px;
10239
+ --base-card-padding-bottom: 0px;
10240
+ --base-card-padding-left: 0px;
10241
+ }
10236
10242
  .rt-BaseCard:where(.rt-variant-outline){
10237
10243
  --card-border-width: 1px;
10238
10244
  --card-background-color: transparent;
@@ -25026,8 +25032,34 @@
25026
25032
  z-index: 1;
25027
25033
  }
25028
25034
  .rt-ToolbarInner{
25035
+ display: grid;
25036
+ grid-template-columns: 1fr auto 1fr;
25037
+ align-items: center;
25029
25038
  width: 100%;
25030
25039
  height: 100%;
25040
+ gap: var(--space-2);
25041
+ }
25042
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarInner{
25043
+ grid-template-columns: 1fr;
25044
+ grid-template-rows: 1fr auto 1fr;
25045
+ }
25046
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarLeft{
25047
+ grid-column: 1;
25048
+ grid-row: 1;
25049
+ align-self: start;
25050
+ justify-self: center;
25051
+ }
25052
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarCenter{
25053
+ grid-column: 1;
25054
+ grid-row: 2;
25055
+ align-self: center;
25056
+ justify-self: center;
25057
+ }
25058
+ .rt-Toolbar:where([data-anchor='left'], [data-anchor='right']) .rt-ToolbarRight{
25059
+ grid-column: 1;
25060
+ grid-row: 3;
25061
+ align-self: end;
25062
+ justify-self: center;
25031
25063
  }
25032
25064
  .rt-Toolbar:where([data-anchor='top']){
25033
25065
  top: 0;
@@ -25087,14 +25119,20 @@
25087
25119
  min-width: 0;
25088
25120
  flex-shrink: 1;
25089
25121
  }
25122
+ .rt-ToolbarSection{
25123
+ min-width: 0;
25124
+ }
25090
25125
  .rt-ToolbarLeft{
25091
- justify-content: flex-start;
25126
+ grid-column: 1;
25127
+ justify-self: start;
25092
25128
  }
25093
25129
  .rt-ToolbarCenter{
25094
- justify-content: center;
25130
+ grid-column: 2;
25131
+ justify-self: center;
25095
25132
  }
25096
25133
  .rt-ToolbarRight{
25097
- justify-content: flex-end;
25134
+ grid-column: 3;
25135
+ justify-self: end;
25098
25136
  }
25099
25137
  .rt-TooltipContent{
25100
25138
  box-sizing: border-box;