@drawnagency/primitives 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.
@@ -17,7 +17,9 @@ interface IndicatorPillProps {
17
17
  disabled?: boolean;
18
18
  /** Open the click popover above the pill — for pills in a bottom-pinned bar. */
19
19
  placement?: "bottom" | "top";
20
+ /** Which pill edge the click popover lines up with. */
21
+ align?: "start" | "end" | "auto";
20
22
  }
21
- export declare function IndicatorPill({ dots, label, hoverContent, clickContent, className, buttonClassName, ariaLabel, disabled, placement, }: IndicatorPillProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function IndicatorPill({ dots, label, hoverContent, clickContent, className, buttonClassName, ariaLabel, disabled, placement, align, }: IndicatorPillProps): import("react/jsx-runtime").JSX.Element;
22
24
  export {};
23
25
  //# sourceMappingURL=IndicatorPill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IndicatorPill.d.ts","sourceRoot":"","sources":["../../../src/components/editor/IndicatorPill.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjF,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;8DAC0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAoB,GACrB,EAAE,kBAAkB,2CAoGpB"}
1
+ {"version":3,"file":"IndicatorPill.d.ts","sourceRoot":"","sources":["../../../src/components/editor/IndicatorPill.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjF,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;8DAC0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gFAAgF;IAChF,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC7B,uDAAuD;IACvD,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAoB,EACpB,KAAK,GACN,EAAE,kBAAkB,2CAqGpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SectionBulkEditModal.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SectionBulkEditModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAajD,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAI5C,UAAU,yBAAyB;IACjC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB;sFACkF;IAClF,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/D;AAiHD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,KAAK,EACL,SAAS,EACT,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CAyK3B"}
1
+ {"version":3,"file":"SectionBulkEditModal.d.ts","sourceRoot":"","sources":["../../../src/components/editor/SectionBulkEditModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAajD,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAI5C,UAAU,yBAAyB;IACjC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB;sFACkF;IAClF,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/D;AAiHD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,KAAK,EACL,SAAS,EACT,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CA8K3B"}
@@ -72,7 +72,8 @@ function IndicatorPill({
72
72
  buttonClassName,
73
73
  ariaLabel,
74
74
  disabled,
75
- placement = "bottom"
75
+ placement = "bottom",
76
+ align
76
77
  }) {
77
78
  const [hoverOpen, setHoverOpen] = useState(false);
78
79
  const [clickOpen, setClickOpen] = useState(false);
@@ -156,6 +157,7 @@ function IndicatorPill({
156
157
  onClose: handleClickClose,
157
158
  anchorRef: buttonRef,
158
159
  placement,
160
+ align,
159
161
  className: "min-w-full max-w-xs",
160
162
  children: typeof clickContent === "function" ? clickContent(handleClickClose) : clickContent
161
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawnagency/primitives",
3
- "version": "0.1.120",
3
+ "version": "0.1.121",
4
4
  "description": "Browser-safe foundation of the Brand Portal framework: Zod schemas, section components, editor shell, hooks, pure libs, collab contract.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,6 +21,8 @@ interface IndicatorPillProps {
21
21
  disabled?: boolean;
22
22
  /** Open the click popover above the pill — for pills in a bottom-pinned bar. */
23
23
  placement?: "bottom" | "top";
24
+ /** Which pill edge the click popover lines up with. */
25
+ align?: "start" | "end" | "auto";
24
26
  }
25
27
 
26
28
  export function IndicatorPill({
@@ -33,6 +35,7 @@ export function IndicatorPill({
33
35
  ariaLabel,
34
36
  disabled,
35
37
  placement = "bottom",
38
+ align,
36
39
  }: IndicatorPillProps) {
37
40
  const [hoverOpen, setHoverOpen] = useState(false);
38
41
  const [clickOpen, setClickOpen] = useState(false);
@@ -127,6 +130,7 @@ export function IndicatorPill({
127
130
  onClose={handleClickClose}
128
131
  anchorRef={buttonRef}
129
132
  placement={placement}
133
+ align={align}
130
134
  className="min-w-full max-w-xs"
131
135
  >
132
136
  {typeof clickContent === "function" ? clickContent(handleClickClose) : clickContent}
@@ -276,8 +276,11 @@ export function SectionBulkEditModal({
276
276
  })}
277
277
  </div>
278
278
 
279
+ {/* Sticky insets count from inside the modal body's py-4, so -bottom-4 pins the
280
+ bar flush to the edge. Its popovers end-align: the body is overflow-y-auto,
281
+ which makes overflow-x auto too, and one growing rightward scrolls it sideways. */}
279
282
  {selected.length > 0 && (
280
- <div className="sticky bottom-0 -mx-6 -mb-4 mt-auto flex items-center gap-2 border-t border-base-200 bg-base px-6 py-3 text-sm shadow-[0_-4px_12px_rgba(0,0,0,0.06)]">
283
+ <div className="sticky -bottom-4 -mx-6 -mb-4 mt-auto flex items-center gap-2 border-t border-base-200 bg-base px-6 py-3 text-sm shadow-[0_-4px_12px_rgba(0,0,0,0.06)]">
281
284
  <span className="font-medium text-base-contrast">{selected.length} selected</span>
282
285
  <button
283
286
  type="button"
@@ -290,6 +293,7 @@ export function SectionBulkEditModal({
290
293
  <div className="ml-auto flex items-center gap-2">
291
294
  <IndicatorPill
292
295
  placement="top"
296
+ align="end"
293
297
  dots={statuses.map((s) => ({ className: dotColorClasses[s] }))}
294
298
  label={commonStatus ? commonStatus.charAt(0).toUpperCase() + commonStatus.slice(1) : "Mixed status"}
295
299
  ariaLabel="Status of selected sections"
@@ -307,6 +311,7 @@ export function SectionBulkEditModal({
307
311
  />
308
312
  <IndicatorPill
309
313
  placement="top"
314
+ align="end"
310
315
  dots={[...fullAudiences, ...partialAudiences].map((a) => ({ color: a.color ?? "#9ca3af" }))}
311
316
  label={partialAudiences.length > 0 ? "Mixed audiences" : audienceLabel(fullAudiences)}
312
317
  ariaLabel="Audience of selected sections"