@fragments-sdk/ui 0.8.7 → 0.8.9

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 (39) hide show
  1. package/fragments.json +1 -1
  2. package/package.json +2 -2
  3. package/src/assets/fragments-logo.tsx +9 -8
  4. package/src/blocks/CommandPalette.block.ts +34 -0
  5. package/src/blocks/PaginatedTable.block.ts +36 -0
  6. package/src/blocks/SettingsDrawer.block.ts +47 -0
  7. package/src/components/Badge/index.tsx +2 -0
  8. package/src/components/Button/index.tsx +2 -0
  9. package/src/components/Card/index.tsx +2 -0
  10. package/src/components/Checkbox/index.tsx +2 -0
  11. package/src/components/Command/Command.fragment.tsx +237 -0
  12. package/src/components/Command/Command.module.scss +153 -0
  13. package/src/components/Command/Command.test.tsx +363 -0
  14. package/src/components/Command/index.tsx +502 -0
  15. package/src/components/Dialog/index.tsx +2 -0
  16. package/src/components/Drawer/Drawer.fragment.tsx +206 -0
  17. package/src/components/Drawer/Drawer.module.scss +215 -0
  18. package/src/components/Drawer/Drawer.test.tsx +227 -0
  19. package/src/components/Drawer/index.tsx +241 -0
  20. package/src/components/EmptyState/index.tsx +2 -0
  21. package/src/components/Field/index.tsx +2 -0
  22. package/src/components/Fieldset/index.tsx +2 -0
  23. package/src/components/Form/index.tsx +2 -0
  24. package/src/components/Icon/index.tsx +2 -0
  25. package/src/components/List/index.tsx +2 -0
  26. package/src/components/Menu/index.tsx +2 -0
  27. package/src/components/Pagination/Pagination.fragment.tsx +152 -0
  28. package/src/components/Pagination/Pagination.module.scss +109 -0
  29. package/src/components/Pagination/Pagination.test.tsx +171 -0
  30. package/src/components/Pagination/index.tsx +362 -0
  31. package/src/components/Popover/index.tsx +2 -0
  32. package/src/components/Progress/index.tsx +2 -0
  33. package/src/components/RadioGroup/index.tsx +2 -0
  34. package/src/components/Separator/index.tsx +2 -0
  35. package/src/components/Switch/index.ts +2 -0
  36. package/src/components/Toggle/index.tsx +2 -0
  37. package/src/components/ToggleGroup/index.tsx +2 -0
  38. package/src/components/Tooltip/index.tsx +27 -1
  39. package/src/index.ts +34 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fragments-sdk/ui",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "license": "MIT",
5
5
  "description": "Customizable UI components built on Base UI headless primitives",
6
6
  "author": "Conan McNicholl",
@@ -113,7 +113,7 @@
113
113
  "@tanstack/react-table": "^8.21.3",
114
114
  "vitest": "^2.1.8",
115
115
  "vitest-axe": "^0.1.0",
116
- "@fragments-sdk/cli": "0.7.10"
116
+ "@fragments-sdk/cli": "0.7.14"
117
117
  },
118
118
  "files": [
119
119
  "src",
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { useTheme } from '../components/Theme';
3
2
 
4
3
  export interface FragmentsLogoProps {
5
4
  /** Size of the logo in pixels */
@@ -9,13 +8,11 @@ export interface FragmentsLogoProps {
9
8
  }
10
9
 
11
10
  export function FragmentsLogo({ size = 20, className }: FragmentsLogoProps) {
12
- const { resolvedMode } = useTheme();
13
-
14
11
  return (
15
12
  <svg
16
13
  width={size}
17
14
  height={size}
18
- viewBox="0 0 24 24"
15
+ viewBox="0 0 313 313"
19
16
  fill="none"
20
17
  xmlns="http://www.w3.org/2000/svg"
21
18
  className={className}
@@ -23,15 +20,19 @@ export function FragmentsLogo({ size = 20, className }: FragmentsLogoProps) {
23
20
  aria-label="Fragments"
24
21
  style={{
25
22
  display: 'block',
26
- color: resolvedMode === 'light' ? 'var(--fui-text-primary, #1a1a1a)' : 'var(--fui-text-primary, #fafafa)',
27
- transition: 'color 0.2s ease',
28
23
  }}
29
24
  >
30
25
  <path
31
- d="M12 2L14.09 8.26L20.18 8.26L15.45 12.14L17.18 18.74L12 15.06L6.82 18.74L8.55 12.14L3.82 8.26L9.91 8.26L12 2Z"
26
+ d="M0 0 C0.66 0 1.32 0 2 0 C2.44915771 1.11036621 2.89831543 2.22073242 3.36108398 3.36474609 C5.02448839 7.47624399 6.68896082 11.58730879 8.35375977 15.69824219 C9.07475556 17.4790482 9.79545992 19.25997224 10.51586914 21.04101562 C11.55018113 23.59796585 12.58553337 26.15449267 13.62109375 28.7109375 C13.94403915 29.50994476 14.26698456 30.30895203 14.59971619 31.13217163 C16.19708004 35.11169509 16.19708004 35.11169509 18 39 C19.20124512 38.51007568 20.40249023 38.02015137 21.64013672 37.51538086 C26.08360877 35.70549367 30.53113526 33.90576527 34.97998047 32.10913086 C36.90754131 31.32903603 38.8339805 30.54616387 40.75927734 29.76049805 C43.52153337 28.63384447 46.28762525 27.51713176 49.0546875 26.40234375 C49.9193161 26.047202 50.7839447 25.69206024 51.67477417 25.32615662 C52.47545319 25.00574905 53.2761322 24.68534149 54.10107422 24.35522461 C54.8072287 24.06876572 55.51338318 23.78230682 56.24093628 23.48716736 C58 23 58 23 60 24 C59.86219116 25.00367111 59.72438232 26.00734222 59.58239746 27.04142761 C58.28387817 36.50187641 56.98888338 45.96280185 55.69733429 55.42420483 C55.03323014 60.28833769 54.36788707 65.15229436 53.69970703 70.01586914 C53.05487906 74.70980656 52.41331285 79.4041793 51.77400208 84.09887123 C51.52956667 85.88956898 51.28395802 87.68010698 51.03715515 89.47047997 C50.69158107 91.97884874 50.35018922 94.48775395 50.00976562 96.99682617 C49.85547844 98.10597633 49.85547844 98.10597633 49.69807434 99.23753357 C48.93275528 104.60532842 48.93275528 104.60532842 49 110 C51.32435526 112.56551965 51.32435526 112.56551965 54.4375 114.875 C55.44683594 115.67679687 56.45617187 116.47859375 57.49609375 117.3046875 C58.66326288 118.20416355 59.83130281 119.10251027 61 120 C62.4563086 121.1320675 63.91200142 122.26492745 65.3671875 123.3984375 C68.35227531 125.71950904 71.33808056 128.03965504 74.32421875 130.359375 C89.62305789 142.24595607 89.62305789 142.24595607 96.92114258 148.0065918 C99.92433339 150.37646565 102.9407021 152.72675391 105.9765625 155.0546875 C106.62850586 155.55782471 107.28044922 156.06096191 107.95214844 156.5793457 C109.20934807 157.54906228 110.4702822 158.5139614 111.73535156 159.47338867 C113.19394094 160.6026395 114.6025991 161.79585667 116 163 C116 163.66 116 164.32 116 165 C102.8 170.28 89.6 175.56 76 181 C77.86086989 186.58260966 79.70250471 191.91987008 81.91796875 197.3359375 C82.45520863 198.66010331 82.99231431 199.98432357 83.52929688 201.30859375 C84.36354168 203.35675743 85.19946537 205.40420746 86.0378418 207.45068359 C86.8565564 209.4523021 87.66889009 211.45641719 88.48046875 213.4609375 C89.20592896 215.23670166 89.20592896 215.23670166 89.94604492 217.04833984 C91 220 91 220 91 223 C79.76335968 221.89929604 68.59134385 220.4134701 57.41796875 218.80078125 C56.0117313 218.59852473 54.60549145 218.39628486 53.19924927 218.19406128 C47.37601718 217.35531323 41.55328668 216.51328174 35.73217773 215.65991211 C32.12684379 215.13171562 28.52041037 214.61169027 24.91314125 214.09688377 C23.55197972 213.90101035 22.19125641 213.70206465 20.83101463 213.49990273 C18.94079737 213.2192088 17.04891283 212.94981285 15.15698242 212.6809082 C14.08542404 212.52483597 13.01386566 212.36876373 11.90983582 212.20796204 C8.98220432 211.99872817 6.80225306 212.14520505 4 213 C1.68432244 215.34578532 1.68432244 215.34578532 -0.4375 218.4375 C-1.3152504 219.63105922 -2.19422599 220.82371808 -3.07421875 222.015625 C-3.77877197 222.98145508 -3.77877197 222.98145508 -4.49755859 223.96679688 C-7.17825784 227.59449647 -9.97097654 231.13494187 -12.75 234.6875 C-13.95214291 236.23152175 -15.15396209 237.77579559 -16.35546875 239.3203125 C-18.75284575 242.39926526 -21.15151383 245.47720771 -23.55078125 248.5546875 C-24.13214844 249.30097412 -24.71351563 250.04726074 -25.3125 250.81616211 C-26.47197342 252.30448729 -27.63212139 253.79228722 -28.79296875 255.27954102 C-31.79430217 259.1326386 -34.7658914 263.00497591 -37.69921875 266.91015625 C-38.59338501 268.09629517 -38.59338501 268.09629517 -39.50561523 269.30639648 C-40.64732551 270.82393638 -41.78377901 272.34544898 -42.91430664 273.87133789 C-43.4221167 274.54543701 -43.92992676 275.21953613 -44.453125 275.9140625 C-45.12069824 276.8105249 -45.12069824 276.8105249 -45.80175781 277.72509766 C-46.3948877 278.35617432 -46.3948877 278.35617432 -47 279 C-47.66 279 -48.32 279 -49 279 C-50.96212054 274.28808256 -52.91913452 269.57408813 -54.87158203 264.8581543 C-55.53556926 263.25634568 -56.20091363 261.65509889 -56.86767578 260.05444336 C-57.82948138 257.74481601 -58.78628113 255.43316786 -59.7421875 253.12109375 C-60.03809784 252.41351425 -60.33400818 251.70593475 -60.6388855 250.97691345 C-62.39865479 246.70420474 -63.81133258 242.46643059 -65 238 C-66.748573 238.72703125 -66.748573 238.72703125 -68.5324707 239.46875 C-72.85205273 241.26313903 -77.17447777 243.05058761 -81.49780273 244.8359375 C-83.36968192 245.6100827 -85.24078147 246.38611585 -87.11108398 247.1640625 C-89.79729431 248.28100172 -92.48622194 249.39115363 -95.17578125 250.5 C-96.43217155 251.0249707 -96.43217155 251.0249707 -97.71394348 251.56054688 C-98.49452621 251.88087891 -99.27510895 252.20121094 -100.0793457 252.53125 C-101.10859917 252.95760742 -101.10859917 252.95760742 -102.15864563 253.39257812 C-104 254 -104 254 -107 254 C-106.38702969 244.01103699 -105.14356314 234.16554776 -103.71484375 224.26953125 C-103.49166937 222.70112209 -103.26890376 221.13265472 -103.04652405 219.56413269 C-102.46646968 215.47925444 -101.88174263 211.39506027 -101.29571533 207.31103516 C-100.35327219 200.73753842 -99.41796067 194.16302373 -98.48288155 187.58847618 C-98.1564261 185.29817168 -97.82787851 183.00817478 -97.49900818 180.71821594 C-97.29999383 179.32492706 -97.10102193 177.93163211 -96.90209961 176.53833008 C-96.72746689 175.32067459 -96.55283417 174.1030191 -96.37290955 172.84846497 C-95.95673057 170.14828216 -95.95673057 170.14828216 -96 168 C-97.73593235 166.51556315 -99.5439466 165.11537809 -101.375 163.75 C-102.57737611 162.84448409 -103.77916711 161.93819087 -104.98046875 161.03125 C-105.63063965 160.54269531 -106.28081055 160.05414063 -106.95068359 159.55078125 C-110.55827512 156.82080491 -114.12050501 154.03267419 -117.6875 151.25 C-119.2329817 150.04675783 -120.77855573 148.84363424 -122.32421875 147.640625 C-123.4851001 146.73666992 -123.4851001 146.73666992 -124.66943359 145.81445312 C-127.70053775 143.45459915 -130.73270421 141.09611399 -133.76538086 138.73828125 C-135.2473302 137.58549208 -136.7286203 136.43185492 -138.20922852 135.27734375 C-142.16907937 132.19131595 -146.14172445 129.12367845 -150.1328125 126.078125 C-150.968125 125.43746094 -151.8034375 124.79679687 -152.6640625 124.13671875 C-154.27735996 122.89985736 -155.89443035 121.66789828 -157.515625 120.44140625 C-158.23492187 119.88839844 -158.95421875 119.33539063 -159.6953125 118.765625 C-160.33484863 118.27868164 -160.97438477 117.79173828 -161.63330078 117.29003906 C-162.08431152 116.86432617 -162.53532227 116.43861328 -163 116 C-163 115.34 -163 114.68 -163 114 C-159.05338679 112.36346798 -155.10643175 110.72776378 -151.15917969 109.09277344 C-149.82087295 108.53830454 -148.48265433 107.98362292 -147.14453125 107.42871094 C-139.44878529 104.23751089 -131.74681584 101.06582921 -124 98 C-124 94.50826651 -124.12587382 93.19541524 -125.37695312 90.1652832 C-125.6772644 89.4280452 -125.97757568 88.69080719 -126.2869873 87.93122864 C-126.61509399 87.145681 -126.94320068 86.36013336 -127.28125 85.55078125 C-127.61419067 84.73755905 -127.94713135 83.92433685 -128.29016113 83.08647156 C-129.35356169 80.49240029 -130.42639476 77.90236248 -131.5 75.3125 C-132.57178084 72.71121358 -133.64161171 70.10914111 -134.70983887 67.50639343 C-135.37509077 65.8872214 -136.04276171 64.26904084 -136.7130127 62.65193176 C-139 57.10959212 -139 57.10959212 -139 56 C-128.71788454 56.57902817 -118.60937008 57.77022185 -108.42578125 59.25 C-106.88361003 59.47072616 -105.34138789 59.69109684 -103.79911804 59.91113281 C-100.59943549 60.36868553 -97.40024874 60.82951286 -94.20141602 61.29296875 C-90.10224258 61.88673347 -86.00211152 62.47355546 -81.90162373 63.0581665 C-78.73150688 63.51064134 -75.56180471 63.96596543 -72.39223289 64.42224121 C-70.87925541 64.63983761 -69.36617533 64.85672194 -67.8529911 65.07287598 C-65.74964295 65.37391995 -63.64685672 65.6786164 -61.54418945 65.984375 C-59.75220879 66.24299316 -59.75220879 66.24299316 -57.92402649 66.50683594 C-55 67 -55 67 -52 68 C-51.72704102 67.41621582 -51.45408203 66.83243164 -51.17285156 66.23095703 C-50.0222272 64.0422798 -48.7616631 62.24487911 -47.234375 60.3046875 C-46.68136719 59.59828125 -46.12835938 58.891875 -45.55859375 58.1640625 C-44.96175781 57.40867188 -44.36492187 56.65328125 -43.75 55.875 C-42.4738667 54.24746768 -41.19782762 52.61986147 -39.921875 50.9921875 C-39.26896484 50.16170898 -38.61605469 49.33123047 -37.94335938 48.47558594 C-34.94875903 44.66085635 -31.97486342 40.8301261 -29 37 C-27.84123575 35.51034672 -26.68238114 34.02076372 -25.5234375 32.53125 C-23.11007978 29.42855421 -20.69891694 26.32416745 -18.2890625 23.21875 C-15.37070965 19.45853492 -12.44663484 15.70283967 -9.51855469 11.95019531 C-8.14540014 10.18672931 -6.77902989 8.41824058 -5.4140625 6.6484375 C-4.69992188 5.73320312 -3.98578125 4.81796875 -3.25 3.875 C-2.65703125 3.10929687 -2.0640625 2.34359375 -1.453125 1.5546875 C-0.97359375 1.04164062 -0.4940625 0.52859375 0 0 Z M13 49 C11.19413716 51.33321158 9.43296372 53.68459433 7.6875 56.0625 C3.57826075 61.6053237 -0.59931715 67.07192895 -4.9375 72.4375 C-9.7348096 78.37822614 -14.41026916 84.40155529 -19.02124023 90.48803711 C-20.01602028 91.79863075 -21.02655386 93.09740383 -22.05183411 94.38427734 C-23.56007215 96.40932687 -24.86075532 98.38690506 -26.16607666 100.53651428 C-32.50851227 110.43218992 -32.50851227 110.43218992 -38.70957947 111.84541321 C-43.07120386 111.85412331 -47.27815399 111.01496689 -51.54296875 110.1796875 C-53.12126541 109.92862526 -54.70068456 109.68453049 -56.28108215 109.447052 C-60.42245668 108.80659017 -64.54294522 108.07692569 -68.66546631 107.32568359 C-72.84865266 106.57815454 -77.04430644 105.90990392 -81.24023438 105.23828125 C-85.96462751 104.48050324 -90.68635718 103.71626103 -95.39823914 102.88375854 C-96.11786835 102.75838715 -96.83749756 102.63301575 -97.57893372 102.50384521 C-99.51300169 102.16533681 -101.44584831 101.81987047 -103.37858582 101.47384644 C-107.32653394 100.95727444 -111.02360237 100.91998097 -115 101 C-112.00586783 104.13603417 -108.8301233 106.75910562 -105.375 109.375 C-104.20922102 110.26247675 -103.04388107 111.15053041 -101.87890625 112.0390625 C-101.25387207 112.51504883 -100.62883789 112.99103516 -99.98486328 113.48144531 C-96.41061604 116.21598625 -92.86262817 118.984265 -89.3125 121.75 C-87.77736558 122.94534053 -86.24220904 124.14065266 -84.70703125 125.3359375 C-83.5480835 126.23844238 -83.5480835 126.23844238 -82.36572266 127.15917969 C-79.97834147 129.01685297 -77.58906474 130.87206146 -75.19921875 132.7265625 C-74.41184326 133.33790039 -73.62446777 133.94923828 -72.81323242 134.57910156 C-71.33074833 135.73004119 -69.84787368 136.88047804 -68.36450195 138.03027344 C-67.01259063 139.08036933 -65.67170048 140.14486969 -64.34437561 141.22587585 C-62.02122983 143.06424988 -62.02122983 143.06424988 -59.35183716 144.504776 C-56.27629214 146.42977332 -54.18957724 148.09116803 -52 151 C-51.20822539 156.5848229 -52.2256255 161.79580139 -53.2109375 167.28515625 C-53.45434694 168.87046394 -53.6927638 170.45654548 -53.92642212 172.0433197 C-54.55294455 176.21011173 -55.24342604 180.36371913 -55.94897461 184.51776123 C-56.6547281 188.73337445 -57.30498287 192.95744302 -57.95703125 197.18164062 C-58.69126794 201.93605834 -59.42983688 206.68890457 -60.21884155 211.43458557 C-60.33772736 212.15930054 -60.45661316 212.8840155 -60.57910156 213.63069153 C-60.89993407 215.58064497 -61.22628548 217.52968816 -61.55307007 219.47865295 C-62.00330443 223.02603548 -62.07892585 226.42830985 -62 230 C-58.08850736 226.2381273 -54.67181931 222.25774191 -51.3125 218 C-50.52431885 217.00770386 -50.52431885 217.00770386 -49.72021484 215.99536133 C-45.66465027 210.87593154 -41.67284933 205.70969026 -37.703125 200.5234375 C-34.44666615 196.27126324 -31.1616472 192.04136001 -27.875 187.8125 C-27.276875 187.04188232 -26.67875 186.27126465 -26.0625 185.47729492 C-22.19790491 180.50814811 -18.27807161 175.59449634 -14.2578125 170.75 C-12.80545465 169.08851681 -12.80545465 169.08851681 -13 167 C-12.11795898 167.16798096 -11.23591797 167.33596191 -10.32714844 167.5090332 C2.98243851 169.97884782 16.37888309 171.80824495 29.78808594 173.64428711 C33.12038971 174.10117495 36.45201813 174.5624606 39.78336716 175.02622509 C42.99575424 175.47256854 46.20884378 175.91378982 49.421875 176.35546875 C50.61141785 176.52104782 51.80096069 176.68662689 53.02655029 176.85722351 C54.13250549 177.00770645 55.23846069 177.15818939 56.37792969 177.31323242 C57.82990753 177.51283821 57.82990753 177.51283821 59.31121826 177.71647644 C61.89792132 177.98923612 64.40133049 178.0519136 67 178 C59.69602778 170.52647128 51.4038789 164.26608595 43.11035156 157.93603516 C38.94091798 154.74628459 34.8377003 151.4811169 30.75 148.1875 C24.37118189 143.05045656 17.89283728 138.05311746 11.37011719 133.1003418 C10.68336914 132.57867432 9.99662109 132.05700684 9.2890625 131.51953125 C8.67756348 131.05651611 8.06606445 130.59350098 7.43603516 130.11645508 C6 129 6 129 5 128 C5.20652009 118.98059 6.58687607 109.99001362 7.84765625 101.0703125 C8.11681266 99.12281203 8.3859637 97.1753108 8.65479946 95.22776604 C9.21536806 91.17558016 9.78257514 87.12431884 10.34979248 83.07305908 C10.82077088 79.70834133 11.28998533 76.343403 11.7542572 72.97775269 C12.10057403 70.46961577 12.45093992 67.96203362 12.80592346 65.45510864 C13.56859579 59.9212011 14.22353382 54.58783628 14 49 C13.67 49 13.34 49 13 49 Z M-63 230 C-62 232 -62 232 -62 232 Z"
32
27
  fill="currentColor"
33
- opacity="0.9"
28
+ transform="translate(180,17)"
34
29
  />
35
30
  </svg>
36
31
  );
37
32
  }
33
+
34
+ /**
35
+ * Raw SVG string of the Fragments logo for use in non-React contexts
36
+ * (e.g. viewer <img> tags, favicons). Fill is `currentColor` by default.
37
+ */
38
+ export const fragmentsLogoSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="313" height="313" viewBox="0 0 313 313" fill="none"><path d="M0 0 C0.66 0 1.32 0 2 0 C2.44915771 1.11036621 2.89831543 2.22073242 3.36108398 3.36474609 C5.02448839 7.47624399 6.68896082 11.58730879 8.35375977 15.69824219 C9.07475556 17.4790482 9.79545992 19.25997224 10.51586914 21.04101562 C11.55018113 23.59796585 12.58553337 26.15449267 13.62109375 28.7109375 C13.94403915 29.50994476 14.26698456 30.30895203 14.59971619 31.13217163 C16.19708004 35.11169509 16.19708004 35.11169509 18 39 C19.20124512 38.51007568 20.40249023 38.02015137 21.64013672 37.51538086 C26.08360877 35.70549367 30.53113526 33.90576527 34.97998047 32.10913086 C36.90754131 31.32903603 38.8339805 30.54616387 40.75927734 29.76049805 C43.52153337 28.63384447 46.28762525 27.51713176 49.0546875 26.40234375 C49.9193161 26.047202 50.7839447 25.69206024 51.67477417 25.32615662 C52.47545319 25.00574905 53.2761322 24.68534149 54.10107422 24.35522461 C54.8072287 24.06876572 55.51338318 23.78230682 56.24093628 23.48716736 C58 23 58 23 60 24 C59.86219116 25.00367111 59.72438232 26.00734222 59.58239746 27.04142761 C58.28387817 36.50187641 56.98888338 45.96280185 55.69733429 55.42420483 C55.03323014 60.28833769 54.36788707 65.15229436 53.69970703 70.01586914 C53.05487906 74.70980656 52.41331285 79.4041793 51.77400208 84.09887123 C51.52956667 85.88956898 51.28395802 87.68010698 51.03715515 89.47047997 C50.69158107 91.97884874 50.35018922 94.48775395 50.00976562 96.99682617 C49.85547844 98.10597633 49.85547844 98.10597633 49.69807434 99.23753357 C48.93275528 104.60532842 48.93275528 104.60532842 49 110 C51.32435526 112.56551965 51.32435526 112.56551965 54.4375 114.875 C55.44683594 115.67679687 56.45617187 116.47859375 57.49609375 117.3046875 C58.66326288 118.20416355 59.83130281 119.10251027 61 120 C62.4563086 121.1320675 63.91200142 122.26492745 65.3671875 123.3984375 C68.35227531 125.71950904 71.33808056 128.03965504 74.32421875 130.359375 C89.62305789 142.24595607 89.62305789 142.24595607 96.92114258 148.0065918 C99.92433339 150.37646565 102.9407021 152.72675391 105.9765625 155.0546875 C106.62850586 155.55782471 107.28044922 156.06096191 107.95214844 156.5793457 C109.20934807 157.54906228 110.4702822 158.5139614 111.73535156 159.47338867 C113.19394094 160.6026395 114.6025991 161.79585667 116 163 C116 163.66 116 164.32 116 165 C102.8 170.28 89.6 175.56 76 181 C77.86086989 186.58260966 79.70250471 191.91987008 81.91796875 197.3359375 C82.45520863 198.66010331 82.99231431 199.98432357 83.52929688 201.30859375 C84.36354168 203.35675743 85.19946537 205.40420746 86.0378418 207.45068359 C86.8565564 209.4523021 87.66889009 211.45641719 88.48046875 213.4609375 C89.20592896 215.23670166 89.20592896 215.23670166 89.94604492 217.04833984 C91 220 91 220 91 223 C79.76335968 221.89929604 68.59134385 220.4134701 57.41796875 218.80078125 C56.0117313 218.59852473 54.60549145 218.39628486 53.19924927 218.19406128 C47.37601718 217.35531323 41.55328668 216.51328174 35.73217773 215.65991211 C32.12684379 215.13171562 28.52041037 214.61169027 24.91314125 214.09688377 C23.55197972 213.90101035 22.19125641 213.70206465 20.83101463 213.49990273 C18.94079737 213.2192088 17.04891283 212.94981285 15.15698242 212.6809082 C14.08542404 212.52483597 13.01386566 212.36876373 11.90983582 212.20796204 C8.98220432 211.99872817 6.80225306 212.14520505 4 213 C1.68432244 215.34578532 1.68432244 215.34578532 -0.4375 218.4375 C-1.3152504 219.63105922 -2.19422599 220.82371808 -3.07421875 222.015625 C-3.77877197 222.98145508 -3.77877197 222.98145508 -4.49755859 223.96679688 C-7.17825784 227.59449647 -9.97097654 231.13494187 -12.75 234.6875 C-13.95214291 236.23152175 -15.15396209 237.77579559 -16.35546875 239.3203125 C-18.75284575 242.39926526 -21.15151383 245.47720771 -23.55078125 248.5546875 C-24.13214844 249.30097412 -24.71351563 250.04726074 -25.3125 250.81616211 C-26.47197342 252.30448729 -27.63212139 253.79228722 -28.79296875 255.27954102 C-31.79430217 259.1326386 -34.7658914 263.00497591 -37.69921875 266.91015625 C-38.59338501 268.09629517 -38.59338501 268.09629517 -39.50561523 269.30639648 C-40.64732551 270.82393638 -41.78377901 272.34544898 -42.91430664 273.87133789 C-43.4221167 274.54543701 -43.92992676 275.21953613 -44.453125 275.9140625 C-45.12069824 276.8105249 -45.12069824 276.8105249 -45.80175781 277.72509766 C-46.3948877 278.35617432 -46.3948877 278.35617432 -47 279 C-47.66 279 -48.32 279 -49 279 C-50.96212054 274.28808256 -52.91913452 269.57408813 -54.87158203 264.8581543 C-55.53556926 263.25634568 -56.20091363 261.65509889 -56.86767578 260.05444336 C-57.82948138 257.74481601 -58.78628113 255.43316786 -59.7421875 253.12109375 C-60.03809784 252.41351425 -60.33400818 251.70593475 -60.6388855 250.97691345 C-62.39865479 246.70420474 -63.81133258 242.46643059 -65 238 C-66.748573 238.72703125 -66.748573 238.72703125 -68.5324707 239.46875 C-72.85205273 241.26313903 -77.17447777 243.05058761 -81.49780273 244.8359375 C-83.36968192 245.6100827 -85.24078147 246.38611585 -87.11108398 247.1640625 C-89.79729431 248.28100172 -92.48622194 249.39115363 -95.17578125 250.5 C-96.43217155 251.0249707 -96.43217155 251.0249707 -97.71394348 251.56054688 C-98.49452621 251.88087891 -99.27510895 252.20121094 -100.0793457 252.53125 C-101.10859917 252.95760742 -101.10859917 252.95760742 -102.15864563 253.39257812 C-104 254 -104 254 -107 254 C-106.38702969 244.01103699 -105.14356314 234.16554776 -103.71484375 224.26953125 C-103.49166937 222.70112209 -103.26890376 221.13265472 -103.04652405 219.56413269 C-102.46646968 215.47925444 -101.88174263 211.39506027 -101.29571533 207.31103516 C-100.35327219 200.73753842 -99.41796067 194.16302373 -98.48288155 187.58847618 C-98.1564261 185.29817168 -97.82787851 183.00817478 -97.49900818 180.71821594 C-97.29999383 179.32492706 -97.10102193 177.93163211 -96.90209961 176.53833008 C-96.72746689 175.32067459 -96.55283417 174.1030191 -96.37290955 172.84846497 C-95.95673057 170.14828216 -95.95673057 170.14828216 -96 168 C-97.73593235 166.51556315 -99.5439466 165.11537809 -101.375 163.75 C-102.57737611 162.84448409 -103.77916711 161.93819087 -104.98046875 161.03125 C-105.63063965 160.54269531 -106.28081055 160.05414063 -106.95068359 159.55078125 C-110.55827512 156.82080491 -114.12050501 154.03267419 -117.6875 151.25 C-119.2329817 150.04675783 -120.77855573 148.84363424 -122.32421875 147.640625 C-123.4851001 146.73666992 -123.4851001 146.73666992 -124.66943359 145.81445312 C-127.70053775 143.45459915 -130.73270421 141.09611399 -133.76538086 138.73828125 C-135.2473302 137.58549208 -136.7286203 136.43185492 -138.20922852 135.27734375 C-142.16907937 132.19131595 -146.14172445 129.12367845 -150.1328125 126.078125 C-150.968125 125.43746094 -151.8034375 124.79679687 -152.6640625 124.13671875 C-154.27735996 122.89985736 -155.89443035 121.66789828 -157.515625 120.44140625 C-158.23492187 119.88839844 -158.95421875 119.33539063 -159.6953125 118.765625 C-160.33484863 118.27868164 -160.97438477 117.79173828 -161.63330078 117.29003906 C-162.08431152 116.86432617 -162.53532227 116.43861328 -163 116 C-163 115.34 -163 114.68 -163 114 C-159.05338679 112.36346798 -155.10643175 110.72776378 -151.15917969 109.09277344 C-149.82087295 108.53830454 -148.48265433 107.98362292 -147.14453125 107.42871094 C-139.44878529 104.23751089 -131.74681584 101.06582921 -124 98 C-124 94.50826651 -124.12587382 93.19541524 -125.37695312 90.1652832 C-125.6772644 89.4280452 -125.97757568 88.69080719 -126.2869873 87.93122864 C-126.61509399 87.145681 -126.94320068 86.36013336 -127.28125 85.55078125 C-127.61419067 84.73755905 -127.94713135 83.92433685 -128.29016113 83.08647156 C-129.35356169 80.49240029 -130.42639476 77.90236248 -131.5 75.3125 C-132.57178084 72.71121358 -133.64161171 70.10914111 -134.70983887 67.50639343 C-135.37509077 65.8872214 -136.04276171 64.26904084 -136.7130127 62.65193176 C-139 57.10959212 -139 57.10959212 -139 56 C-128.71788454 56.57902817 -118.60937008 57.77022185 -108.42578125 59.25 C-106.88361003 59.47072616 -105.34138789 59.69109684 -103.79911804 59.91113281 C-100.59943549 60.36868553 -97.40024874 60.82951286 -94.20141602 61.29296875 C-90.10224258 61.88673347 -86.00211152 62.47355546 -81.90162373 63.0581665 C-78.73150688 63.51064134 -75.56180471 63.96596543 -72.39223289 64.42224121 C-70.87925541 64.63983761 -69.36617533 64.85672194 -67.8529911 65.07287598 C-65.74964295 65.37391995 -63.64685672 65.6786164 -61.54418945 65.984375 C-59.75220879 66.24299316 -59.75220879 66.24299316 -57.92402649 66.50683594 C-55 67 -55 67 -52 68 C-51.72704102 67.41621582 -51.45408203 66.83243164 -51.17285156 66.23095703 C-50.0222272 64.0422798 -48.7616631 62.24487911 -47.234375 60.3046875 C-46.68136719 59.59828125 -46.12835938 58.891875 -45.55859375 58.1640625 C-44.96175781 57.40867188 -44.36492187 56.65328125 -43.75 55.875 C-42.4738667 54.24746768 -41.19782762 52.61986147 -39.921875 50.9921875 C-39.26896484 50.16170898 -38.61605469 49.33123047 -37.94335938 48.47558594 C-34.94875903 44.66085635 -31.97486342 40.8301261 -29 37 C-27.84123575 35.51034672 -26.68238114 34.02076372 -25.5234375 32.53125 C-23.11007978 29.42855421 -20.69891694 26.32416745 -18.2890625 23.21875 C-15.37070965 19.45853492 -12.44663484 15.70283967 -9.51855469 11.95019531 C-8.14540014 10.18672931 -6.77902989 8.41824058 -5.4140625 6.6484375 C-4.69992188 5.73320312 -3.98578125 4.81796875 -3.25 3.875 C-2.65703125 3.10929687 -2.0640625 2.34359375 -1.453125 1.5546875 C-0.97359375 1.04164062 -0.4940625 0.52859375 0 0 Z M13 49 C11.19413716 51.33321158 9.43296372 53.68459433 7.6875 56.0625 C3.57826075 61.6053237 -0.59931715 67.07192895 -4.9375 72.4375 C-9.7348096 78.37822614 -14.41026916 84.40155529 -19.02124023 90.48803711 C-20.01602028 91.79863075 -21.02655386 93.09740383 -22.05183411 94.38427734 C-23.56007215 96.40932687 -24.86075532 98.38690506 -26.16607666 100.53651428 C-32.50851227 110.43218992 -32.50851227 110.43218992 -38.70957947 111.84541321 C-43.07120386 111.85412331 -47.27815399 111.01496689 -51.54296875 110.1796875 C-53.12126541 109.92862526 -54.70068456 109.68453049 -56.28108215 109.447052 C-60.42245668 108.80659017 -64.54294522 108.07692569 -68.66546631 107.32568359 C-72.84865266 106.57815454 -77.04430644 105.90990392 -81.24023438 105.23828125 C-85.96462751 104.48050324 -90.68635718 103.71626103 -95.39823914 102.88375854 C-96.11786835 102.75838715 -96.83749756 102.63301575 -97.57893372 102.50384521 C-99.51300169 102.16533681 -101.44584831 101.81987047 -103.37858582 101.47384644 C-107.32653394 100.95727444 -111.02360237 100.91998097 -115 101 C-112.00586783 104.13603417 -108.8301233 106.75910562 -105.375 109.375 C-104.20922102 110.26247675 -103.04388107 111.15053041 -101.87890625 112.0390625 C-101.25387207 112.51504883 -100.62883789 112.99103516 -99.98486328 113.48144531 C-96.41061604 116.21598625 -92.86262817 118.984265 -89.3125 121.75 C-87.77736558 122.94534053 -86.24220904 124.14065266 -84.70703125 125.3359375 C-83.5480835 126.23844238 -83.5480835 126.23844238 -82.36572266 127.15917969 C-79.97834147 129.01685297 -77.58906474 130.87206146 -75.19921875 132.7265625 C-74.41184326 133.33790039 -73.62446777 133.94923828 -72.81323242 134.57910156 C-71.33074833 135.73004119 -69.84787368 136.88047804 -68.36450195 138.03027344 C-67.01259063 139.08036933 -65.67170048 140.14486969 -64.34437561 141.22587585 C-62.02122983 143.06424988 -62.02122983 143.06424988 -59.35183716 144.504776 C-56.27629214 146.42977332 -54.18957724 148.09116803 -52 151 C-51.20822539 156.5848229 -52.2256255 161.79580139 -53.2109375 167.28515625 C-53.45434694 168.87046394 -53.6927638 170.45654548 -53.92642212 172.0433197 C-54.55294455 176.21011173 -55.24342604 180.36371913 -55.94897461 184.51776123 C-56.6547281 188.73337445 -57.30498287 192.95744302 -57.95703125 197.18164062 C-58.69126794 201.93605834 -59.42983688 206.68890457 -60.21884155 211.43458557 C-60.33772736 212.15930054 -60.45661316 212.8840155 -60.57910156 213.63069153 C-60.89993407 215.58064497 -61.22628548 217.52968816 -61.55307007 219.47865295 C-62.00330443 223.02603548 -62.07892585 226.42830985 -62 230 C-58.08850736 226.2381273 -54.67181931 222.25774191 -51.3125 218 C-50.52431885 217.00770386 -50.52431885 217.00770386 -49.72021484 215.99536133 C-45.66465027 210.87593154 -41.67284933 205.70969026 -37.703125 200.5234375 C-34.44666615 196.27126324 -31.1616472 192.04136001 -27.875 187.8125 C-27.276875 187.04188232 -26.67875 186.27126465 -26.0625 185.47729492 C-22.19790491 180.50814811 -18.27807161 175.59449634 -14.2578125 170.75 C-12.80545465 169.08851681 -12.80545465 169.08851681 -13 167 C-12.11795898 167.16798096 -11.23591797 167.33596191 -10.32714844 167.5090332 C2.98243851 169.97884782 16.37888309 171.80824495 29.78808594 173.64428711 C33.12038971 174.10117495 36.45201813 174.5624606 39.78336716 175.02622509 C42.99575424 175.47256854 46.20884378 175.91378982 49.421875 176.35546875 C50.61141785 176.52104782 51.80096069 176.68662689 53.02655029 176.85722351 C54.13250549 177.00770645 55.23846069 177.15818939 56.37792969 177.31323242 C57.82990753 177.51283821 57.82990753 177.51283821 59.31121826 177.71647644 C61.89792132 177.98923612 64.40133049 178.0519136 67 178 C59.69602778 170.52647128 51.4038789 164.26608595 43.11035156 157.93603516 C38.94091798 154.74628459 34.8377003 151.4811169 30.75 148.1875 C24.37118189 143.05045656 17.89283728 138.05311746 11.37011719 133.1003418 C10.68336914 132.57867432 9.99662109 132.05700684 9.2890625 131.51953125 C8.67756348 131.05651611 8.06606445 130.59350098 7.43603516 130.11645508 C6 129 6 129 5 128 C5.20652009 118.98059 6.58687607 109.99001362 7.84765625 101.0703125 C8.11681266 99.12281203 8.3859637 97.1753108 8.65479946 95.22776604 C9.21536806 91.17558016 9.78257514 87.12431884 10.34979248 83.07305908 C10.82077088 79.70834133 11.28998533 76.343403 11.7542572 72.97775269 C12.10057403 70.46961577 12.45093992 67.96203362 12.80592346 65.45510864 C13.56859579 59.9212011 14.22353382 54.58783628 14 49 C13.67 49 13.34 49 13 49 Z M-63 230 C-62 232 -62 232 -62 232 Z" fill="currentColor" transform="translate(180,17)"/></svg>`;
@@ -0,0 +1,34 @@
1
+ import { defineBlock } from '@fragments-sdk/cli/core';
2
+
3
+ export default defineBlock({
4
+ name: 'Command Palette',
5
+ description: 'Modal command palette for quick actions, composed with Dialog and Command',
6
+ category: 'navigation',
7
+ components: ['Dialog', 'Command'],
8
+ tags: ['command', 'palette', 'search', 'spotlight', 'quick-actions'],
9
+ code: `
10
+ <Dialog>
11
+ <Dialog.Trigger asChild>
12
+ <Button variant="secondary">Open Command Palette</Button>
13
+ </Dialog.Trigger>
14
+ <Dialog.Content size="sm">
15
+ <Command>
16
+ <Command.Input placeholder="Search commands..." />
17
+ <Command.List>
18
+ <Command.Group heading="Actions">
19
+ <Command.Item onItemSelect={() => console.log('new')}>New File</Command.Item>
20
+ <Command.Item onItemSelect={() => console.log('open')}>Open Recent</Command.Item>
21
+ <Command.Item onItemSelect={() => console.log('save')}>Save All</Command.Item>
22
+ </Command.Group>
23
+ <Command.Separator />
24
+ <Command.Group heading="Settings">
25
+ <Command.Item onItemSelect={() => console.log('prefs')}>Preferences</Command.Item>
26
+ <Command.Item onItemSelect={() => console.log('keys')}>Keyboard Shortcuts</Command.Item>
27
+ </Command.Group>
28
+ <Command.Empty>No results found.</Command.Empty>
29
+ </Command.List>
30
+ </Command>
31
+ </Dialog.Content>
32
+ </Dialog>
33
+ `.trim(),
34
+ });
@@ -0,0 +1,36 @@
1
+ import { defineBlock } from '@fragments-sdk/cli/core';
2
+
3
+ export default defineBlock({
4
+ name: 'Paginated Table',
5
+ description: 'Data table with pagination controls at the bottom',
6
+ category: 'dashboard',
7
+ components: ['Card', 'Table', 'Pagination'],
8
+ tags: ['table', 'pagination', 'data', 'dashboard', 'list'],
9
+ code: `
10
+ const columns = [
11
+ { accessorKey: 'name', header: 'Name' },
12
+ { accessorKey: 'email', header: 'Email' },
13
+ { accessorKey: 'status', header: 'Status' },
14
+ ];
15
+
16
+ const data = [
17
+ { name: 'John Doe', email: 'john@example.com', status: 'Active' },
18
+ { name: 'Jane Smith', email: 'jane@example.com', status: 'Pending' },
19
+ { name: 'Bob Wilson', email: 'bob@example.com', status: 'Active' },
20
+ ];
21
+
22
+ <Card>
23
+ <Card.Header>
24
+ <Card.Title>Users</Card.Title>
25
+ </Card.Header>
26
+ <Table data={data} columns={columns} />
27
+ <Card.Footer>
28
+ <Pagination totalPages={10} defaultPage={1}>
29
+ <Pagination.Previous />
30
+ <Pagination.Items />
31
+ <Pagination.Next />
32
+ </Pagination>
33
+ </Card.Footer>
34
+ </Card>
35
+ `.trim(),
36
+ });
@@ -0,0 +1,47 @@
1
+ import { defineBlock } from '@fragments-sdk/cli/core';
2
+
3
+ export default defineBlock({
4
+ name: 'Settings Drawer',
5
+ description: 'Side panel for editing settings with form fields and save/cancel actions',
6
+ category: 'settings',
7
+ components: ['Drawer', 'Form', 'Field', 'Button', 'Switch'],
8
+ tags: ['drawer', 'settings', 'form', 'panel', 'editor'],
9
+ code: `
10
+ <Drawer>
11
+ <Drawer.Trigger asChild>
12
+ <Button variant="secondary">Settings</Button>
13
+ </Drawer.Trigger>
14
+ <Drawer.Content size="md">
15
+ <Drawer.Close />
16
+ <Drawer.Header>
17
+ <Drawer.Title>Settings</Drawer.Title>
18
+ <Drawer.Description>Manage your preferences.</Drawer.Description>
19
+ </Drawer.Header>
20
+ <Drawer.Body>
21
+ <Form>
22
+ <Stack gap="md">
23
+ <Field>
24
+ <Field.Label>Display Name</Field.Label>
25
+ <Field.Control>
26
+ <Input placeholder="Enter name" />
27
+ </Field.Control>
28
+ </Field>
29
+ <Field>
30
+ <Field.Label>Email Notifications</Field.Label>
31
+ <Field.Control>
32
+ <Switch defaultChecked />
33
+ </Field.Control>
34
+ </Field>
35
+ </Stack>
36
+ </Form>
37
+ </Drawer.Body>
38
+ <Drawer.Footer>
39
+ <Drawer.Close asChild>
40
+ <Button variant="secondary">Cancel</Button>
41
+ </Drawer.Close>
42
+ <Button variant="primary">Save Changes</Button>
43
+ </Drawer.Footer>
44
+ </Drawer.Content>
45
+ </Drawer>
46
+ `.trim(),
47
+ });
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { Button as BaseButton } from '@base-ui/react/button';
3
5
  import styles from './Badge.module.scss';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { Button as BaseButton } from '@base-ui/react/button';
3
5
  import styles from './Button.module.scss';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import styles from './Card.module.scss';
3
5
  // Import globals to ensure CSS variables are defined
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
3
5
  import styles from './Checkbox.module.scss';
@@ -0,0 +1,237 @@
1
+ import React from 'react';
2
+ import { defineFragment } from '@fragments-sdk/cli/core';
3
+ import { Command } from '.';
4
+ import { Dialog } from '../Dialog';
5
+ import { Button } from '../Button';
6
+
7
+ export default defineFragment({
8
+ component: Command,
9
+
10
+ meta: {
11
+ name: 'Command',
12
+ description: 'A searchable command palette for quick actions. Combines an input with a filterable, keyboard-navigable list of actions.',
13
+ category: 'navigation',
14
+ status: 'stable',
15
+ tags: ['command', 'palette', 'search', 'spotlight', 'quick-actions', 'cmdk'],
16
+ since: '0.8.2',
17
+ },
18
+
19
+ usage: {
20
+ when: [
21
+ 'Quick-access command palettes (Ctrl+K)',
22
+ 'Searchable action menus',
23
+ 'Inline command lists with filtering',
24
+ 'Application-wide search interfaces',
25
+ ],
26
+ whenNot: [
27
+ 'Simple dropdown menus (use Menu)',
28
+ 'Form field selection (use Select or Combobox)',
29
+ 'Static navigation (use Sidebar or Tabs)',
30
+ 'Search with complex result types (build custom)',
31
+ ],
32
+ guidelines: [
33
+ 'Compose inside Dialog for modal command palette usage',
34
+ 'Use Command.Group to organize items by category',
35
+ 'Provide Command.Empty for no-results feedback',
36
+ 'Use keywords prop for items that should match on aliases',
37
+ 'Keep item labels short and action-oriented',
38
+ ],
39
+ accessibility: [
40
+ 'Uses combobox + listbox ARIA pattern',
41
+ 'Keyboard navigation with ArrowUp/ArrowDown, Enter to select',
42
+ 'Home/End jump to first/last item',
43
+ 'aria-activedescendant tracks focused item',
44
+ ],
45
+ },
46
+
47
+ props: {
48
+ children: {
49
+ type: 'node',
50
+ description: 'Command.Input, Command.List, and other sub-components',
51
+ required: true,
52
+ },
53
+ search: {
54
+ type: 'string',
55
+ description: 'Controlled search value',
56
+ },
57
+ defaultSearch: {
58
+ type: 'string',
59
+ description: 'Default search value (uncontrolled)',
60
+ default: "''",
61
+ },
62
+ onSearchChange: {
63
+ type: 'function',
64
+ description: 'Called when search input changes',
65
+ },
66
+ filter: {
67
+ type: 'function',
68
+ description: 'Custom filter function. Return 0 to hide, >0 to show.',
69
+ },
70
+ loop: {
71
+ type: 'boolean',
72
+ description: 'Whether to loop keyboard navigation',
73
+ default: 'true',
74
+ },
75
+ },
76
+
77
+ relations: [
78
+ { component: 'Dialog', relationship: 'sibling', note: 'Compose inside Dialog for modal command palette' },
79
+ { component: 'Listbox', relationship: 'sibling', note: 'Command uses Listbox-like keyboard navigation internally' },
80
+ { component: 'Combobox', relationship: 'alternative', note: 'Use Combobox for form field selection with search' },
81
+ ],
82
+
83
+ contract: {
84
+ propsSummary: [
85
+ 'search: string - controlled search value',
86
+ 'onSearchChange: (search) => void - search change handler',
87
+ 'filter: (value, search, keywords?) => number - custom filter',
88
+ 'loop: boolean - loop keyboard navigation (default: true)',
89
+ 'Command.Item value: string - filter match value',
90
+ 'Command.Item keywords: string[] - extra filter terms',
91
+ 'Command.Item onItemSelect: () => void - selection handler',
92
+ ],
93
+ subComponents: [
94
+ {
95
+ name: 'Command.Input',
96
+ props: ['placeholder: string', 'className: string'],
97
+ },
98
+ {
99
+ name: 'Command.List',
100
+ props: ['children: ReactNode'],
101
+ },
102
+ {
103
+ name: 'Command.Item',
104
+ props: [
105
+ 'value: string - filter value',
106
+ 'keywords: string[] - extra keywords',
107
+ 'disabled: boolean',
108
+ 'onItemSelect: () => void',
109
+ ],
110
+ },
111
+ {
112
+ name: 'Command.Group',
113
+ props: ['heading: string - group label', 'children: ReactNode'],
114
+ },
115
+ {
116
+ name: 'Command.Empty',
117
+ props: ['children: ReactNode - empty state message'],
118
+ },
119
+ {
120
+ name: 'Command.Separator',
121
+ props: [],
122
+ },
123
+ ],
124
+ scenarioTags: [
125
+ 'navigation.command',
126
+ 'search.palette',
127
+ 'action.quick',
128
+ ],
129
+ a11yRules: ['A11Y_COMBOBOX_ROLE', 'A11Y_LISTBOX_ROLE', 'A11Y_ACTIVE_DESCENDANT'],
130
+ },
131
+
132
+ ai: {
133
+ compositionPattern: 'compound',
134
+ subComponents: ['Input', 'List', 'Item', 'Group', 'Empty', 'Separator'],
135
+ requiredChildren: ['Input', 'List'],
136
+ commonPatterns: [
137
+ '<Dialog><Dialog.Trigger><Button>Open Palette</Button></Dialog.Trigger><Dialog.Content size="sm"><Command><Command.Input placeholder="Search..." /><Command.List><Command.Group heading="Actions"><Command.Item onItemSelect={() => {}}>Action 1</Command.Item></Command.Group><Command.Empty>No results.</Command.Empty></Command.List></Command></Dialog.Content></Dialog>',
138
+ ],
139
+ },
140
+
141
+ variants: [
142
+ {
143
+ name: 'Default',
144
+ description: 'Inline command list with search',
145
+ render: () => (
146
+ <div style={{ maxWidth: '400px', width: '100%' }}>
147
+ <Command>
148
+ <Command.Input placeholder="Type a command..." />
149
+ <Command.List>
150
+ <Command.Item onItemSelect={() => {}}>Open File</Command.Item>
151
+ <Command.Item onItemSelect={() => {}}>Save Document</Command.Item>
152
+ <Command.Item onItemSelect={() => {}}>Print</Command.Item>
153
+ <Command.Empty>No results found.</Command.Empty>
154
+ </Command.List>
155
+ </Command>
156
+ </div>
157
+ ),
158
+ },
159
+ {
160
+ name: 'Dialog Command Palette',
161
+ description: 'Command palette inside a Dialog',
162
+ render: () => (
163
+ <Dialog>
164
+ <Dialog.Trigger asChild>
165
+ <Button variant="secondary">Open Command Palette</Button>
166
+ </Dialog.Trigger>
167
+ <Dialog.Content size="sm">
168
+ <Command>
169
+ <Command.Input placeholder="Search commands..." />
170
+ <Command.List>
171
+ <Command.Group heading="Actions">
172
+ <Command.Item onItemSelect={() => {}}>New File</Command.Item>
173
+ <Command.Item onItemSelect={() => {}}>Open Recent</Command.Item>
174
+ </Command.Group>
175
+ <Command.Separator />
176
+ <Command.Group heading="Settings">
177
+ <Command.Item onItemSelect={() => {}}>Preferences</Command.Item>
178
+ <Command.Item onItemSelect={() => {}}>Keyboard Shortcuts</Command.Item>
179
+ </Command.Group>
180
+ <Command.Empty>No results found.</Command.Empty>
181
+ </Command.List>
182
+ </Command>
183
+ </Dialog.Content>
184
+ </Dialog>
185
+ ),
186
+ },
187
+ {
188
+ name: 'With Groups',
189
+ description: 'Organized by category groups',
190
+ render: () => (
191
+ <div style={{ maxWidth: '400px', width: '100%' }}>
192
+ <Command>
193
+ <Command.Input placeholder="Search..." />
194
+ <Command.List>
195
+ <Command.Group heading="Suggestions">
196
+ <Command.Item onItemSelect={() => {}}>Calendar</Command.Item>
197
+ <Command.Item onItemSelect={() => {}}>Calculator</Command.Item>
198
+ </Command.Group>
199
+ <Command.Separator />
200
+ <Command.Group heading="Settings">
201
+ <Command.Item onItemSelect={() => {}}>Profile</Command.Item>
202
+ <Command.Item onItemSelect={() => {}}>Billing</Command.Item>
203
+ <Command.Item disabled onItemSelect={() => {}}>
204
+ Team (coming soon)
205
+ </Command.Item>
206
+ </Command.Group>
207
+ <Command.Empty>No results found.</Command.Empty>
208
+ </Command.List>
209
+ </Command>
210
+ </div>
211
+ ),
212
+ },
213
+ {
214
+ name: 'With Icons',
215
+ description: 'Items with leading icons',
216
+ render: () => (
217
+ <div style={{ maxWidth: '400px', width: '100%' }}>
218
+ <Command>
219
+ <Command.Input placeholder="What do you need?" />
220
+ <Command.List>
221
+ <Command.Item onItemSelect={() => {}}>
222
+ <span style={{ marginRight: '0.5rem', fontSize: '1rem' }}>+</span> New Document
223
+ </Command.Item>
224
+ <Command.Item onItemSelect={() => {}}>
225
+ <span style={{ marginRight: '0.5rem', fontSize: '1rem' }}>{'>'}</span> Open Folder
226
+ </Command.Item>
227
+ <Command.Item onItemSelect={() => {}}>
228
+ <span style={{ marginRight: '0.5rem', fontSize: '1rem' }}>?</span> Search
229
+ </Command.Item>
230
+ <Command.Empty>No results found.</Command.Empty>
231
+ </Command.List>
232
+ </Command>
233
+ </div>
234
+ ),
235
+ },
236
+ ],
237
+ });
@@ -0,0 +1,153 @@
1
+ @use '../../tokens/variables' as *;
2
+ @use '../../tokens/mixins' as *;
3
+
4
+ // ============================================
5
+ // Command container
6
+ // ============================================
7
+
8
+ .command {
9
+ @include surface-elevated;
10
+
11
+ display: flex;
12
+ flex-direction: column;
13
+ overflow: hidden;
14
+ box-shadow: var(--fui-shadow-md);
15
+ }
16
+
17
+ // ============================================
18
+ // Input area
19
+ // ============================================
20
+
21
+ .inputWrapper {
22
+ display: flex;
23
+ align-items: center;
24
+ gap: var(--fui-space-2, 0.5rem);
25
+ padding: var(--fui-padding-item-sm, 0.5rem) var(--fui-padding-container-md, 1rem);
26
+ border-bottom: 1px solid var(--fui-border);
27
+
28
+ svg {
29
+ flex-shrink: 0;
30
+ width: 1rem;
31
+ height: 1rem;
32
+ color: var(--fui-text-secondary);
33
+ }
34
+ }
35
+
36
+ .input {
37
+ @include text-base;
38
+
39
+ width: 100%;
40
+ border: none;
41
+ background: transparent;
42
+ outline: none;
43
+ font-size: var(--fui-font-size-sm, 0.875rem);
44
+ color: var(--fui-text-primary);
45
+ padding: var(--fui-space-1, 0.25rem) 0;
46
+
47
+ &::placeholder {
48
+ color: var(--fui-text-tertiary);
49
+ }
50
+ }
51
+
52
+ // ============================================
53
+ // List area
54
+ // ============================================
55
+
56
+ .list {
57
+ overflow-y: auto;
58
+ max-height: 300px;
59
+ padding: var(--fui-padding-item-xs, 0.25rem);
60
+ }
61
+
62
+ // ============================================
63
+ // Item
64
+ // ============================================
65
+
66
+ .item {
67
+ @include button-reset;
68
+ @include text-base;
69
+
70
+ display: flex;
71
+ align-items: center;
72
+ gap: var(--fui-space-2, 0.5rem);
73
+ width: 100%;
74
+ padding: var(--fui-padding-item-xs, 0.25rem) var(--fui-padding-item-md, 0.75rem);
75
+ border-radius: var(--fui-radius-sm, 0.25rem);
76
+ cursor: pointer;
77
+ text-align: left;
78
+ color: var(--fui-text-primary);
79
+ background: transparent;
80
+ border: none;
81
+ font-size: var(--fui-font-size-sm, 0.875rem);
82
+ transition: background-color 0.1s ease;
83
+
84
+ &:hover {
85
+ background-color: var(--fui-bg-hover);
86
+ }
87
+ }
88
+
89
+ .itemActive {
90
+ background-color: var(--fui-bg-hover);
91
+ }
92
+
93
+ .itemDisabled {
94
+ color: var(--fui-text-tertiary);
95
+ cursor: not-allowed;
96
+
97
+ &:hover {
98
+ background-color: transparent;
99
+ }
100
+ }
101
+
102
+ // ============================================
103
+ // Group
104
+ // ============================================
105
+
106
+ .group {
107
+ &:not(:first-child) {
108
+ margin-top: var(--fui-space-1, 0.25rem);
109
+ }
110
+ }
111
+
112
+ .groupHeading {
113
+ padding: var(--fui-padding-item-xs, 0.25rem) var(--fui-padding-item-md, 0.75rem);
114
+ font-size: var(--fui-font-size-xs, 0.75rem);
115
+ font-weight: var(--fui-font-weight-medium, 500);
116
+ color: var(--fui-text-tertiary);
117
+ }
118
+
119
+ // ============================================
120
+ // Empty state
121
+ // ============================================
122
+
123
+ .empty {
124
+ padding: var(--fui-padding-item-md, 0.75rem);
125
+ font-size: var(--fui-font-size-sm, 0.875rem);
126
+ color: var(--fui-text-secondary);
127
+ text-align: center;
128
+ }
129
+
130
+ // ============================================
131
+ // Separator
132
+ // ============================================
133
+
134
+ .separator {
135
+ height: 1px;
136
+ margin: var(--fui-space-1, 0.25rem) 0;
137
+ background-color: var(--fui-border);
138
+ }
139
+
140
+ // ============================================
141
+ // Accessibility: High Contrast Mode
142
+ // ============================================
143
+
144
+ @media (prefers-contrast: more) {
145
+ .command {
146
+ border-width: 2px;
147
+ }
148
+
149
+ .itemActive {
150
+ outline: 2px solid var(--fui-color-accent);
151
+ outline-offset: -2px;
152
+ }
153
+ }