@kushagradhawan/kookie-ui 0.1.119 → 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.
- package/components.css +43 -7
- package/dist/cjs/components/card.d.ts.map +1 -1
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +3 -3
- package/dist/cjs/components/card.props.d.ts +4 -0
- package/dist/cjs/components/card.props.d.ts.map +1 -1
- package/dist/cjs/components/card.props.js +1 -1
- package/dist/cjs/components/card.props.js.map +2 -2
- package/dist/cjs/components/toolbar.d.ts +7 -8
- package/dist/cjs/components/toolbar.d.ts.map +1 -1
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +3 -3
- package/dist/esm/components/card.d.ts.map +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/card.js.map +3 -3
- package/dist/esm/components/card.props.d.ts +4 -0
- package/dist/esm/components/card.props.d.ts.map +1 -1
- package/dist/esm/components/card.props.js +1 -1
- package/dist/esm/components/card.props.js.map +2 -2
- package/dist/esm/components/toolbar.d.ts +7 -8
- package/dist/esm/components/toolbar.d.ts.map +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/toolbar.js.map +3 -3
- package/package.json +1 -1
- package/schemas/base-button.json +1 -1
- package/schemas/button.json +1 -1
- package/schemas/icon-button.json +1 -1
- package/schemas/index.json +6 -6
- package/schemas/toggle-button.json +1 -1
- package/schemas/toggle-icon-button.json +1 -1
- package/src/components/_internal/base-card.css +14 -0
- package/src/components/card.props.tsx +2 -0
- package/src/components/card.tsx +2 -1
- package/src/components/toolbar.css +60 -18
- package/src/components/toolbar.tsx +25 -34
- package/styles.css +43 -7
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;
|
|
@@ -19990,12 +19996,38 @@
|
|
|
19990
19996
|
outline-color: var(--accent-9);
|
|
19991
19997
|
}
|
|
19992
19998
|
.rt-Toolbar {
|
|
19993
|
-
position:
|
|
19999
|
+
position: absolute;
|
|
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;
|
|
@@ -20019,6 +20051,7 @@
|
|
|
20019
20051
|
}
|
|
20020
20052
|
.rt-Toolbar:where(:not([data-floating])) {
|
|
20021
20053
|
--base-card-border-radius: 0;
|
|
20054
|
+
border-radius: 0;
|
|
20022
20055
|
}
|
|
20023
20056
|
.rt-Toolbar:where([data-anchor='top']:not([data-floating]))::after {
|
|
20024
20057
|
box-shadow: inset 0 -1px 0 0 var(--gray-6);
|
|
@@ -20050,21 +20083,24 @@
|
|
|
20050
20083
|
.rt-Toolbar:where(.rt-variant-soft:not([data-floating]))::after {
|
|
20051
20084
|
box-shadow: none;
|
|
20052
20085
|
}
|
|
20053
|
-
.rt-Toolbar:where([data-floating]) {
|
|
20054
|
-
position: absolute;
|
|
20055
|
-
}
|
|
20056
20086
|
.rt-ToolbarTitle {
|
|
20057
20087
|
min-width: 0;
|
|
20058
20088
|
flex-shrink: 1;
|
|
20059
20089
|
}
|
|
20090
|
+
.rt-ToolbarSection {
|
|
20091
|
+
min-width: 0;
|
|
20092
|
+
}
|
|
20060
20093
|
.rt-ToolbarLeft {
|
|
20061
|
-
|
|
20094
|
+
grid-column: 1;
|
|
20095
|
+
justify-self: start;
|
|
20062
20096
|
}
|
|
20063
20097
|
.rt-ToolbarCenter {
|
|
20064
|
-
|
|
20098
|
+
grid-column: 2;
|
|
20099
|
+
justify-self: center;
|
|
20065
20100
|
}
|
|
20066
20101
|
.rt-ToolbarRight {
|
|
20067
|
-
|
|
20102
|
+
grid-column: 3;
|
|
20103
|
+
justify-self: end;
|
|
20068
20104
|
}
|
|
20069
20105
|
.rt-TooltipContent {
|
|
20070
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,
|
|
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
|
|
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,
|
|
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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.props.d.ts","sourceRoot":"","sources":["../../../src/components/card.props.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,YAAY
|
|
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
|
|
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 {
|
|
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'> {
|
|
@@ -11,8 +11,8 @@ interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
|
|
|
11
11
|
*/
|
|
12
12
|
anchor?: Anchor;
|
|
13
13
|
/**
|
|
14
|
-
* Floating
|
|
15
|
-
* When
|
|
14
|
+
* Floating mode adds margin from edges for a detached look with absolute positioning.
|
|
15
|
+
* When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.
|
|
16
16
|
* @default false
|
|
17
17
|
*/
|
|
18
18
|
floating?: boolean;
|
|
@@ -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
|
-
|
|
27
|
-
|
|
28
|
-
declare const
|
|
29
|
-
declare const
|
|
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,
|
|
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,SAAS,EAAE,MAAM,WAAW,CAAC;AAO3C,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;IAC3D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,QAAA,MAAM,WAAW,yFAsFhB,CAAC;AAQF,KAAK,mBAAmB,GAAG,SAAS,CAAC;AAErC,QAAA,MAAM,WAAW,kFAYhB,CAAC;AAOF,QAAA,MAAM,aAAa,kFAalB,CAAC;AAOF,QAAA,MAAM,YAAY,kFAajB,CAAC;AAQF,UAAU,iBAAkB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,OAAO,CAAC;CAAG;AAErF,QAAA,MAAM,YAAY,8FAajB,CAAC;AAOF,QAAA,MAAM,OAAO,EAAkB,OAAO,WAAW,GAAG;IAClD,IAAI,EAAE,OAAO,WAAW,CAAC;IACzB,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC;IAC3B,KAAK,EAAE,OAAO,YAAY,CAAC;CAC5B,CAAC;AAOF,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
|
|
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 {
|
|
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,
|
|
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", "
|
|
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": "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",
|
|
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,
|
|
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
|
|
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,
|
|
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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.props.d.ts","sourceRoot":"","sources":["../../../src/components/card.props.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,YAAY
|
|
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 {
|
|
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'> {
|
|
@@ -11,8 +11,8 @@ interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
|
|
|
11
11
|
*/
|
|
12
12
|
anchor?: Anchor;
|
|
13
13
|
/**
|
|
14
|
-
* Floating
|
|
15
|
-
* When
|
|
14
|
+
* Floating mode adds margin from edges for a detached look with absolute positioning.
|
|
15
|
+
* When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.
|
|
16
16
|
* @default false
|
|
17
17
|
*/
|
|
18
18
|
floating?: boolean;
|
|
@@ -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
|
-
|
|
27
|
-
|
|
28
|
-
declare const
|
|
29
|
-
declare const
|
|
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,
|
|
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,SAAS,EAAE,MAAM,WAAW,CAAC;AAO3C,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;IAC3D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,QAAA,MAAM,WAAW,yFAsFhB,CAAC;AAQF,KAAK,mBAAmB,GAAG,SAAS,CAAC;AAErC,QAAA,MAAM,WAAW,kFAYhB,CAAC;AAOF,QAAA,MAAM,aAAa,kFAalB,CAAC;AAOF,QAAA,MAAM,YAAY,kFAajB,CAAC;AAQF,UAAU,iBAAkB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,OAAO,CAAC;CAAG;AAErF,QAAA,MAAM,YAAY,8FAajB,CAAC;AAOF,QAAA,MAAM,OAAO,EAAkB,OAAO,WAAW,GAAG;IAClD,IAAI,EAAE,OAAO,WAAW,CAAC;IACzB,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC;IAC3B,KAAK,EAAE,OAAO,YAAY,CAAC;CAC5B,CAAC;AAOF,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
|
-
import*as e from"react";import
|
|
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 {
|
|
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,
|
|
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", "
|
|
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,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,EAAgB,iBAAiBJ,CAAO,EACxCK,EAAS,WAAWD,EAAc,SAAS,GAAK,EACtDD,GAAaE,EAAS,CACxB,CAEIT,EACFK,EAAO,MAAM,YAAY,sBAAuB,GAAGE,CAAS,IAAI,EAEhEF,EAAO,MAAM,YAAY,qBAAsB,GAAGE,CAAS,IAAI,CAEnE,EAEAD,EAAO,EAEP,MAAMI,EAAiB,IAAI,eAAeJ,CAAM,EAChD,OAAAI,EAAe,QAAQN,CAAO,EAEvB,IAAMM,EAAe,WAAW,CACzC,EAAG,CAACV,EAAcT,CAAQ,CAAC,EAE3B,MAAMiB,EAAgBjB,EAClB,CAAE,OAAQ,eAAeC,CAAM,IAAK,GAAGK,CAAM,EAC7CA,EAEJ,OACEf,EAAA,cAACE,EAAA,CACC,IAAKkB,EACL,KAAMT,EACN,QAASC,EACT,SAAUC,EACV,cAAaL,EACb,gBAAeC,GAAY,OAC3B,UAAWR,EAAW,aAAca,CAAS,EAC7C,MAAOY,EACN,GAAGT,GAEJjB,EAAA,cAAC,OAAI,UAAU,mBACZgB,CACH,CACF,CAEJ,CACF,EACAX,EAAY,YAAc,eAS1B,MAAMwB,EAAc7B,EAAM,WACxB,CAAC,CAAE,IAAA8B,EAAM,IAAK,MAAAC,EAAQ,SAAU,UAAAjB,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IAC/DP,EAAA,cAACG,EAAA,CACC,IAAKI,EACL,MAAOwB,EACP,IAAKD,EACL,UAAW7B,EAAW,oBAAqB,iBAAkBa,CAAS,EACrE,GAAGR,GAEHU,CACH,CAEJ,EACAa,EAAY,YAAc,eAM1B,MAAMG,EAAgBhC,EAAM,WAC1B,CAAC,CAAE,IAAA8B,EAAM,IAAK,MAAAC,EAAQ,SAAU,QAAAE,EAAU,SAAU,UAAAnB,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IACnFP,EAAA,cAACG,EAAA,CACC,IAAKI,EACL,MAAOwB,EACP,QAASE,EACT,IAAKH,EACL,UAAW7B,EAAW,oBAAqB,mBAAoBa,CAAS,EACvE,GAAGR,GAEHU,CACH,CAEJ,EACAgB,EAAc,YAAc,iBAM5B,MAAME,EAAelC,EAAM,WACzB,CAAC,CAAE,IAAA8B,EAAM,IAAK,MAAAC,EAAQ,SAAU,QAAAE,EAAU,MAAO,UAAAnB,EAAW,SAAAE,EAAU,GAAGV,CAAM,EAAGC,IAChFP,EAAA,cAACG,EAAA,CACC,IAAKI,EACL,MAAOwB,EACP,QAASE,EACT,IAAKH,EACL,UAAW7B,EAAW,oBAAqB,kBAAmBa,CAAS,EACtE,GAAGR,GAEHU,CACH,CAEJ,EACAkB,EAAa,YAAc,gBAS3B,MAAMC,EAAenC,EAAM,WACzB,CAAC,CAAE,UAAAc,EAAW,KAAAH,EAAO,IAAK,OAAAyB,EAAS,SAAU,SAAAC,EAAW,GAAM,SAAArB,EAAU,GAAGV,CAAM,EAAGC,IAClFP,EAAA,cAACI,EAAA,CACC,IAAKG,EACL,KAAMI,EACN,OAAQyB,EACR,SAAUC,EACV,UAAWpC,EAAW,kBAAmBa,CAAS,EACjD,GAAGR,GAEHU,CACH,CAEJ,EACAmB,EAAa,YAAc,gBAM3B,MAAMG,EAAUjC,EAOhBiC,EAAQ,KAAOT,EACfS,EAAQ,OAASN,EACjBM,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", "gap", "align", "ToolbarCenter", "justify", "ToolbarRight", "ToolbarTitle", "weight", "truncate", "Toolbar"]
|
|
7
7
|
}
|
package/package.json
CHANGED
package/schemas/base-button.json
CHANGED
|
@@ -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-
|
|
282
|
+
"generatedAt": "2026-01-09T12:06:24.248Z",
|
|
283
283
|
"source": "Zod schema"
|
|
284
284
|
}
|
package/schemas/button.json
CHANGED
|
@@ -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-
|
|
533
|
+
"generatedAt": "2026-01-09T12:06:24.254Z",
|
|
534
534
|
"source": "Zod schema"
|
|
535
535
|
}
|
package/schemas/icon-button.json
CHANGED
|
@@ -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-
|
|
316
|
+
"generatedAt": "2026-01-09T12:06:24.255Z",
|
|
317
317
|
"source": "Zod schema"
|
|
318
318
|
}
|
package/schemas/index.json
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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 };
|
package/src/components/card.tsx
CHANGED
|
@@ -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,16 +1,43 @@
|
|
|
1
|
+
/* stylelint-disable selector-max-specificity */
|
|
1
2
|
/* Toolbar Component */
|
|
2
3
|
|
|
3
4
|
.rt-Toolbar {
|
|
4
|
-
position:
|
|
5
|
+
position: absolute;
|
|
5
6
|
z-index: 1;
|
|
6
7
|
|
|
7
8
|
/* --rt-toolbar-height and --rt-toolbar-width are set on parent element via JS */
|
|
9
|
+
/* Use pt/pb/pl/pr="var(--rt-toolbar-height)" on content to avoid overlap */
|
|
8
10
|
}
|
|
9
11
|
|
|
12
|
+
/* Grid layout for true centering */
|
|
10
13
|
.rt-ToolbarInner {
|
|
11
|
-
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: 1fr auto 1fr;
|
|
16
|
+
align-items: center;
|
|
12
17
|
width: 100%;
|
|
13
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;
|
|
14
41
|
}
|
|
15
42
|
|
|
16
43
|
/* * * * * * * * * * * * * * * * * * * */
|
|
@@ -45,17 +72,18 @@
|
|
|
45
72
|
|
|
46
73
|
/* * * * * * * * * * * * * * * * * * * */
|
|
47
74
|
/* */
|
|
48
|
-
/*
|
|
49
|
-
/*
|
|
75
|
+
/* Inset mode (default) */
|
|
76
|
+
/* Edge-to-edge positioning */
|
|
50
77
|
/* */
|
|
51
78
|
/* * * * * * * * * * * * * * * * * * * */
|
|
52
79
|
|
|
53
|
-
/* Remove border-radius in
|
|
80
|
+
/* Remove border-radius in inset mode */
|
|
54
81
|
.rt-Toolbar:where(:not([data-floating])) {
|
|
55
82
|
--base-card-border-radius: 0;
|
|
83
|
+
border-radius: 0;
|
|
56
84
|
}
|
|
57
85
|
|
|
58
|
-
/* Override Card's
|
|
86
|
+
/* Override Card's box-shadow to only show exposed edge */
|
|
59
87
|
/* Top anchor: only show bottom border */
|
|
60
88
|
.rt-Toolbar:where([data-anchor='top']:not([data-floating])) {
|
|
61
89
|
&::after {
|
|
@@ -117,14 +145,8 @@
|
|
|
117
145
|
/* */
|
|
118
146
|
/* * * * * * * * * * * * * * * * * * * */
|
|
119
147
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
position: absolute;
|
|
123
|
-
|
|
124
|
-
/* Margin controlled via offset prop */
|
|
125
|
-
|
|
126
|
-
/* Inherit Card's border-radius (don't override) */
|
|
127
|
-
}
|
|
148
|
+
/* Floating mode: margin controlled via offset prop in JS */
|
|
149
|
+
/* Inherits Card's border-radius (not overridden like inset mode) */
|
|
128
150
|
|
|
129
151
|
/* * * * * * * * * * * * * * * * * * * */
|
|
130
152
|
/* */
|
|
@@ -145,17 +167,37 @@
|
|
|
145
167
|
/* * * * * * * * * * * * * * * * * * * */
|
|
146
168
|
|
|
147
169
|
.rt-ToolbarSection {
|
|
148
|
-
|
|
170
|
+
min-width: 0;
|
|
149
171
|
}
|
|
150
172
|
|
|
151
173
|
.rt-ToolbarLeft {
|
|
152
|
-
|
|
174
|
+
grid-column: 1;
|
|
175
|
+
justify-self: start;
|
|
153
176
|
}
|
|
154
177
|
|
|
155
178
|
.rt-ToolbarCenter {
|
|
156
|
-
|
|
179
|
+
grid-column: 2;
|
|
180
|
+
justify-self: center;
|
|
157
181
|
}
|
|
158
182
|
|
|
183
|
+
/* Ensure Right always stays in the right column */
|
|
159
184
|
.rt-ToolbarRight {
|
|
160
|
-
|
|
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;
|
|
161
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 {
|
|
9
|
+
import type { FlexProps } from './flex.js';
|
|
10
10
|
|
|
11
11
|
// ============================================================================
|
|
12
12
|
// Toolbar Root
|
|
@@ -23,8 +23,8 @@ interface ToolbarRootProps extends Omit<CardProps, 'asChild'> {
|
|
|
23
23
|
*/
|
|
24
24
|
anchor?: Anchor;
|
|
25
25
|
/**
|
|
26
|
-
* Floating
|
|
27
|
-
* When
|
|
26
|
+
* Floating mode adds margin from edges for a detached look with absolute positioning.
|
|
27
|
+
* When false (default), uses inset mode with negative margins to go edge-to-edge inside Cards.
|
|
28
28
|
* @default false
|
|
29
29
|
*/
|
|
30
30
|
floating?: boolean;
|
|
@@ -66,8 +66,7 @@ const ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(
|
|
|
66
66
|
[forwardedRef],
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
-
//
|
|
70
|
-
// so that sibling elements can access it
|
|
69
|
+
// Expose height/width as CSS variable on parent element
|
|
71
70
|
React.useEffect(() => {
|
|
72
71
|
const element = internalRef.current;
|
|
73
72
|
if (!element) return;
|
|
@@ -75,10 +74,10 @@ const ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(
|
|
|
75
74
|
const parent = element.parentElement;
|
|
76
75
|
if (!parent) return;
|
|
77
76
|
|
|
78
|
-
const
|
|
77
|
+
const update = () => {
|
|
79
78
|
let dimension = isHorizontal ? element.offsetHeight : element.offsetWidth;
|
|
80
79
|
|
|
81
|
-
// For floating
|
|
80
|
+
// For floating mode, include the margin in the total space
|
|
82
81
|
if (floating) {
|
|
83
82
|
const computedStyle = getComputedStyle(element);
|
|
84
83
|
const margin = parseFloat(computedStyle.marginTop) || 0;
|
|
@@ -92,15 +91,15 @@ const ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(
|
|
|
92
91
|
}
|
|
93
92
|
};
|
|
94
93
|
|
|
95
|
-
|
|
94
|
+
update();
|
|
96
95
|
|
|
97
|
-
const resizeObserver = new ResizeObserver(
|
|
96
|
+
const resizeObserver = new ResizeObserver(update);
|
|
98
97
|
resizeObserver.observe(element);
|
|
99
98
|
|
|
100
99
|
return () => resizeObserver.disconnect();
|
|
101
100
|
}, [isHorizontal, floating]);
|
|
102
101
|
|
|
103
|
-
const
|
|
102
|
+
const computedStyle = floating
|
|
104
103
|
? { margin: `var(--space-${offset})`, ...style }
|
|
105
104
|
: style;
|
|
106
105
|
|
|
@@ -113,18 +112,12 @@ const ToolbarRoot = React.forwardRef<ToolbarRootElement, ToolbarRootProps>(
|
|
|
113
112
|
data-anchor={anchor}
|
|
114
113
|
data-floating={floating || undefined}
|
|
115
114
|
className={classNames('rt-Toolbar', className)}
|
|
116
|
-
style={
|
|
115
|
+
style={computedStyle}
|
|
117
116
|
{...restProps}
|
|
118
117
|
>
|
|
119
|
-
<
|
|
120
|
-
align="center"
|
|
121
|
-
justify="between"
|
|
122
|
-
direction={isHorizontal ? 'row' : 'column'}
|
|
123
|
-
gap="2"
|
|
124
|
-
className="rt-ToolbarInner"
|
|
125
|
-
>
|
|
118
|
+
<div className="rt-ToolbarInner">
|
|
126
119
|
{children}
|
|
127
|
-
</
|
|
120
|
+
</div>
|
|
128
121
|
</Card>
|
|
129
122
|
);
|
|
130
123
|
},
|
|
@@ -136,15 +129,14 @@ ToolbarRoot.displayName = 'Toolbar.Root';
|
|
|
136
129
|
// ============================================================================
|
|
137
130
|
|
|
138
131
|
type ToolbarSectionElement = React.ElementRef<'div'>;
|
|
139
|
-
|
|
132
|
+
type ToolbarSectionProps = FlexProps;
|
|
140
133
|
|
|
141
134
|
const ToolbarLeft = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(
|
|
142
|
-
({ className, children, ...props }, forwardedRef) => (
|
|
135
|
+
({ gap = '2', align = 'center', className, children, ...props }, forwardedRef) => (
|
|
143
136
|
<Flex
|
|
144
137
|
ref={forwardedRef}
|
|
145
|
-
align=
|
|
146
|
-
gap=
|
|
147
|
-
flexShrink="0"
|
|
138
|
+
align={align}
|
|
139
|
+
gap={gap}
|
|
148
140
|
className={classNames('rt-ToolbarSection', 'rt-ToolbarLeft', className)}
|
|
149
141
|
{...props}
|
|
150
142
|
>
|
|
@@ -159,13 +151,12 @@ ToolbarLeft.displayName = 'Toolbar.Left';
|
|
|
159
151
|
// ============================================================================
|
|
160
152
|
|
|
161
153
|
const ToolbarCenter = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(
|
|
162
|
-
({ className, children, ...props }, forwardedRef) => (
|
|
154
|
+
({ gap = '2', align = 'center', justify = 'center', className, children, ...props }, forwardedRef) => (
|
|
163
155
|
<Flex
|
|
164
156
|
ref={forwardedRef}
|
|
165
|
-
align=
|
|
166
|
-
justify=
|
|
167
|
-
|
|
168
|
-
minWidth="0"
|
|
157
|
+
align={align}
|
|
158
|
+
justify={justify}
|
|
159
|
+
gap={gap}
|
|
169
160
|
className={classNames('rt-ToolbarSection', 'rt-ToolbarCenter', className)}
|
|
170
161
|
{...props}
|
|
171
162
|
>
|
|
@@ -180,12 +171,12 @@ ToolbarCenter.displayName = 'Toolbar.Center';
|
|
|
180
171
|
// ============================================================================
|
|
181
172
|
|
|
182
173
|
const ToolbarRight = React.forwardRef<ToolbarSectionElement, ToolbarSectionProps>(
|
|
183
|
-
({ className, children, ...props }, forwardedRef) => (
|
|
174
|
+
({ gap = '2', align = 'center', justify = 'end', className, children, ...props }, forwardedRef) => (
|
|
184
175
|
<Flex
|
|
185
176
|
ref={forwardedRef}
|
|
186
|
-
align=
|
|
187
|
-
|
|
188
|
-
|
|
177
|
+
align={align}
|
|
178
|
+
justify={justify}
|
|
179
|
+
gap={gap}
|
|
189
180
|
className={classNames('rt-ToolbarSection', 'rt-ToolbarRight', className)}
|
|
190
181
|
{...props}
|
|
191
182
|
>
|
|
@@ -203,7 +194,7 @@ type ToolbarTitleElement = React.ElementRef<typeof Heading>;
|
|
|
203
194
|
interface ToolbarTitleProps extends React.ComponentPropsWithoutRef<typeof Heading> {}
|
|
204
195
|
|
|
205
196
|
const ToolbarTitle = React.forwardRef<ToolbarTitleElement, ToolbarTitleProps>(
|
|
206
|
-
({ className, size = '
|
|
197
|
+
({ className, size = '2', weight = 'medium', truncate = true, children, ...props }, forwardedRef) => (
|
|
207
198
|
<Heading
|
|
208
199
|
ref={forwardedRef}
|
|
209
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;
|
|
@@ -25022,12 +25028,38 @@
|
|
|
25022
25028
|
outline-color: var(--accent-9);
|
|
25023
25029
|
}
|
|
25024
25030
|
.rt-Toolbar{
|
|
25025
|
-
position:
|
|
25031
|
+
position: absolute;
|
|
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;
|
|
@@ -25051,6 +25083,7 @@
|
|
|
25051
25083
|
}
|
|
25052
25084
|
.rt-Toolbar:where(:not([data-floating])){
|
|
25053
25085
|
--base-card-border-radius: 0;
|
|
25086
|
+
border-radius: 0;
|
|
25054
25087
|
}
|
|
25055
25088
|
.rt-Toolbar:where([data-anchor='top']:not([data-floating]))::after{
|
|
25056
25089
|
box-shadow: inset 0 -1px 0 0 var(--gray-6);
|
|
@@ -25082,21 +25115,24 @@
|
|
|
25082
25115
|
.rt-Toolbar:where(.rt-variant-soft:not([data-floating]))::after{
|
|
25083
25116
|
box-shadow: none;
|
|
25084
25117
|
}
|
|
25085
|
-
.rt-Toolbar:where([data-floating]){
|
|
25086
|
-
position: absolute;
|
|
25087
|
-
}
|
|
25088
25118
|
.rt-ToolbarTitle{
|
|
25089
25119
|
min-width: 0;
|
|
25090
25120
|
flex-shrink: 1;
|
|
25091
25121
|
}
|
|
25122
|
+
.rt-ToolbarSection{
|
|
25123
|
+
min-width: 0;
|
|
25124
|
+
}
|
|
25092
25125
|
.rt-ToolbarLeft{
|
|
25093
|
-
|
|
25126
|
+
grid-column: 1;
|
|
25127
|
+
justify-self: start;
|
|
25094
25128
|
}
|
|
25095
25129
|
.rt-ToolbarCenter{
|
|
25096
|
-
|
|
25130
|
+
grid-column: 2;
|
|
25131
|
+
justify-self: center;
|
|
25097
25132
|
}
|
|
25098
25133
|
.rt-ToolbarRight{
|
|
25099
|
-
|
|
25134
|
+
grid-column: 3;
|
|
25135
|
+
justify-self: end;
|
|
25100
25136
|
}
|
|
25101
25137
|
.rt-TooltipContent{
|
|
25102
25138
|
box-sizing: border-box;
|