@tribepad/themis 1.0.7 → 1.0.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 (102) hide show
  1. package/dist/elements/AlertDialog/index.js +1 -1
  2. package/dist/elements/AlertDialog/index.js.map +1 -1
  3. package/dist/elements/AlertDialog/index.mjs +1 -1
  4. package/dist/elements/AlertDialog/index.mjs.map +1 -1
  5. package/dist/elements/Breadcrumbs/index.js +1 -1
  6. package/dist/elements/Breadcrumbs/index.js.map +1 -1
  7. package/dist/elements/Breadcrumbs/index.mjs +1 -1
  8. package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
  9. package/dist/elements/Chart/ChartContext.d.ts.map +1 -1
  10. package/dist/elements/Chart/ChartLineSeries.d.ts.map +1 -1
  11. package/dist/elements/Chart/index.js +1 -1
  12. package/dist/elements/Chart/index.js.map +1 -1
  13. package/dist/elements/Chart/index.mjs +1 -1
  14. package/dist/elements/Chart/index.mjs.map +1 -1
  15. package/dist/elements/DatePicker/index.js +1 -1
  16. package/dist/elements/DatePicker/index.js.map +1 -1
  17. package/dist/elements/DatePicker/index.mjs +1 -1
  18. package/dist/elements/DatePicker/index.mjs.map +1 -1
  19. package/dist/elements/FileField/index.js +1 -1
  20. package/dist/elements/FileField/index.js.map +1 -1
  21. package/dist/elements/FileField/index.mjs +1 -1
  22. package/dist/elements/FileField/index.mjs.map +1 -1
  23. package/dist/elements/Modal/Modal.styles.d.ts +2 -0
  24. package/dist/elements/Modal/Modal.styles.d.ts.map +1 -1
  25. package/dist/elements/Modal/index.js +1 -1
  26. package/dist/elements/Modal/index.js.map +1 -1
  27. package/dist/elements/Modal/index.mjs +1 -1
  28. package/dist/elements/Modal/index.mjs.map +1 -1
  29. package/dist/elements/NumberField/NumberField.d.ts.map +1 -1
  30. package/dist/elements/NumberField/NumberField.types.d.ts +12 -0
  31. package/dist/elements/NumberField/NumberField.types.d.ts.map +1 -1
  32. package/dist/elements/NumberField/index.js +1 -1
  33. package/dist/elements/NumberField/index.js.map +1 -1
  34. package/dist/elements/NumberField/index.mjs +1 -1
  35. package/dist/elements/NumberField/index.mjs.map +1 -1
  36. package/dist/elements/OTPInput/OTPInput.d.ts +1 -1
  37. package/dist/elements/Resizable/index.js +1 -1
  38. package/dist/elements/Resizable/index.js.map +1 -1
  39. package/dist/elements/Resizable/index.mjs +1 -1
  40. package/dist/elements/Resizable/index.mjs.map +1 -1
  41. package/dist/elements/Switch/Switch.d.ts +11 -4
  42. package/dist/elements/Switch/Switch.d.ts.map +1 -1
  43. package/dist/elements/Switch/Switch.types.d.ts +5 -0
  44. package/dist/elements/Switch/Switch.types.d.ts.map +1 -1
  45. package/dist/elements/Switch/index.js +1 -1
  46. package/dist/elements/Switch/index.js.map +1 -1
  47. package/dist/elements/Switch/index.mjs +1 -1
  48. package/dist/elements/Switch/index.mjs.map +1 -1
  49. package/dist/elements/Tabs/Tabs.d.ts +1 -1
  50. package/dist/elements/Tabs/Tabs.d.ts.map +1 -1
  51. package/dist/elements/Tabs/Tabs.types.d.ts +1 -0
  52. package/dist/elements/Tabs/Tabs.types.d.ts.map +1 -1
  53. package/dist/elements/Tabs/index.js +1 -1
  54. package/dist/elements/Tabs/index.js.map +1 -1
  55. package/dist/elements/Tabs/index.mjs +1 -1
  56. package/dist/elements/Tabs/index.mjs.map +1 -1
  57. package/dist/elements/index.js +1 -1
  58. package/dist/elements/index.js.map +1 -1
  59. package/dist/elements/index.mjs +1 -1
  60. package/dist/elements/index.mjs.map +1 -1
  61. package/dist/hooks/index.d.ts +2 -0
  62. package/dist/hooks/index.d.ts.map +1 -0
  63. package/dist/hooks/index.js +2 -0
  64. package/dist/hooks/index.js.map +1 -0
  65. package/dist/hooks/index.mjs +2 -0
  66. package/dist/hooks/index.mjs.map +1 -0
  67. package/dist/hooks/useReducedMotion.d.ts +9 -0
  68. package/dist/hooks/useReducedMotion.d.ts.map +1 -0
  69. package/dist/index.d.ts +2 -0
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +2 -2
  72. package/dist/index.js.map +1 -1
  73. package/dist/index.mjs +2 -2
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/styles/animations.css +172 -0
  76. package/dist/styles/index.js +1 -1
  77. package/dist/styles/index.js.map +1 -1
  78. package/dist/styles/index.mjs +1 -1
  79. package/dist/styles/index.mjs.map +1 -1
  80. package/dist/styles/shared-variants.d.ts +23 -0
  81. package/dist/styles/shared-variants.d.ts.map +1 -1
  82. package/dist/tailwind-source.css +1 -0
  83. package/dist/types/animation.d.ts +24 -0
  84. package/dist/types/animation.d.ts.map +1 -0
  85. package/dist/types/index.d.ts +2 -0
  86. package/dist/types/index.d.ts.map +1 -0
  87. package/dist/types/index.js +2 -0
  88. package/dist/types/index.js.map +1 -0
  89. package/dist/types/index.mjs +2 -0
  90. package/dist/types/index.mjs.map +1 -0
  91. package/dist/utils/index.d.ts +1 -0
  92. package/dist/utils/index.d.ts.map +1 -1
  93. package/dist/utils/index.js +1 -1
  94. package/dist/utils/index.js.map +1 -1
  95. package/dist/utils/index.mjs +1 -1
  96. package/dist/utils/index.mjs.map +1 -1
  97. package/dist/utils/shouldAnimate.d.ts +12 -0
  98. package/dist/utils/shouldAnimate.d.ts.map +1 -0
  99. package/package.json +34 -2
  100. package/src/elements/NumberField/NumberField.stories.tsx +100 -0
  101. package/src/elements/Switch/Switch.stories.tsx +60 -0
  102. package/src/elements/Tabs/Tabs.stories.tsx +101 -0
@@ -676,3 +676,103 @@ export const Playground: Story = {
676
676
  },
677
677
  },
678
678
  };
679
+
680
+ // =============================================================================
681
+ // Animation Stories (ADR 020)
682
+ // =============================================================================
683
+
684
+ /**
685
+ * Spring animation on stepper press (default behavior when motion.dev is installed).
686
+ * Click increment/decrement to see the value spring to its target.
687
+ */
688
+ export const AnimatedStepper: Story = {
689
+ args: {
690
+ label: 'Quantity',
691
+ defaultValue: 5,
692
+ step: 1,
693
+ minValue: 0,
694
+ maxValue: 99,
695
+ animated: true,
696
+ description: 'Click stepper buttons to see the spring animation',
697
+ },
698
+ parameters: {
699
+ docs: {
700
+ description: {
701
+ story:
702
+ 'Default animated NumberField with spring physics on stepper press. The displayed value springs from the old value to the new one. Direct keyboard input updates instantly.',
703
+ },
704
+ },
705
+ },
706
+ };
707
+
708
+ /**
709
+ * Animation disabled — value updates instantly on stepper press.
710
+ */
711
+ export const NoStepperAnimation: Story = {
712
+ args: {
713
+ label: 'Quantity',
714
+ defaultValue: 5,
715
+ step: 1,
716
+ minValue: 0,
717
+ maxValue: 99,
718
+ animated: false,
719
+ description: 'Stepper updates value instantly (no spring)',
720
+ },
721
+ parameters: {
722
+ docs: {
723
+ description: {
724
+ story:
725
+ 'NumberField with `animated={false}`. Stepper press updates the value instantly without spring animation.',
726
+ },
727
+ },
728
+ },
729
+ };
730
+
731
+ /**
732
+ * Currency formatting with spring animation.
733
+ * The animated overlay displays locale-formatted intermediate values.
734
+ */
735
+ export const AnimatedCurrency: Story = {
736
+ args: {
737
+ label: 'Price',
738
+ defaultValue: 9.99,
739
+ step: 0.5,
740
+ minValue: 0,
741
+ maxValue: 999.99,
742
+ animated: true,
743
+ formatOptions: { style: 'currency', currency: 'USD' },
744
+ description: 'Spring animation with currency formatting',
745
+ },
746
+ parameters: {
747
+ docs: {
748
+ description: {
749
+ story:
750
+ 'Currency-formatted NumberField with spring animation. The overlay formats intermediate values with the same Intl.NumberFormat options as the input.',
751
+ },
752
+ },
753
+ },
754
+ };
755
+
756
+ /**
757
+ * Custom spring configuration — softer, bouncier animation.
758
+ */
759
+ export const CustomSpringConfig: Story = {
760
+ args: {
761
+ label: 'Score',
762
+ defaultValue: 50,
763
+ step: 10,
764
+ minValue: 0,
765
+ maxValue: 100,
766
+ animated: true,
767
+ springConfig: { stiffness: 150, damping: 10 },
768
+ description: 'Low stiffness, low damping = more bounce',
769
+ },
770
+ parameters: {
771
+ docs: {
772
+ description: {
773
+ story:
774
+ 'Custom `springConfig` with lower stiffness and damping for a more pronounced bounce effect on stepper press.',
775
+ },
776
+ },
777
+ },
778
+ };
@@ -437,5 +437,65 @@ export const WithAriaLabel: Story = {
437
437
  },
438
438
  };
439
439
 
440
+ // =============================================================================
441
+ // Animation Stories (ADR 020)
442
+ // =============================================================================
443
+
444
+ /**
445
+ * Spring bounce animation on toggle (default behavior when motion.dev is installed).
446
+ * The thumb overshoots slightly before settling, giving a natural feel.
447
+ */
448
+ export const Animated: Story = {
449
+ args: {
450
+ label: 'Spring animation',
451
+ description: 'Toggle to see the bounce effect',
452
+ animated: true,
453
+ },
454
+ parameters: {
455
+ docs: {
456
+ description: {
457
+ story: 'Default animated switch with spring physics via motion.dev. The thumb bounces when toggled.',
458
+ },
459
+ },
460
+ },
461
+ };
462
+
463
+ /**
464
+ * Animation explicitly disabled — thumb slides instantly via CSS.
465
+ */
466
+ export const NoAnimation: Story = {
467
+ args: {
468
+ label: 'No animation',
469
+ description: 'Instant toggle with no spring',
470
+ animated: false,
471
+ },
472
+ parameters: {
473
+ docs: {
474
+ description: {
475
+ story: 'Switch with `animated={false}`. The thumb translates instantly using CSS, with no spring bounce.',
476
+ },
477
+ },
478
+ },
479
+ };
480
+
481
+ /**
482
+ * Custom spring configuration for a slower, bouncier feel.
483
+ */
484
+ export const CustomSpring: Story = {
485
+ args: {
486
+ label: 'Custom spring',
487
+ description: 'Low stiffness, low damping = more bounce',
488
+ animated: true,
489
+ springConfig: { stiffness: 200, damping: 12 },
490
+ },
491
+ parameters: {
492
+ docs: {
493
+ description: {
494
+ story: 'Custom `springConfig` with lower stiffness and damping for a softer, bouncier toggle.',
495
+ },
496
+ },
497
+ },
498
+ };
499
+
440
500
  // Import React for controlled example
441
501
  import { useState } from 'react';
@@ -932,3 +932,104 @@ export const Controlled: Story = {
932
932
  );
933
933
  },
934
934
  };
935
+
936
+ // =============================================================================
937
+ // Animation Stories (ADR 020)
938
+ // =============================================================================
939
+
940
+ /**
941
+ * Animated sliding indicator (default behavior when motion.dev is installed).
942
+ * Click between tabs to see the underline smoothly slide to the selected tab.
943
+ */
944
+ export const AnimatedIndicator: Story = {
945
+ render: () => (
946
+ <Tabs defaultSelectedKey="tab1" animated>
947
+ <TabList aria-label="Animated indicator demo">
948
+ <Tab id="tab1">Account</Tab>
949
+ <Tab id="tab2">Notifications</Tab>
950
+ <Tab id="tab3">Security</Tab>
951
+ </TabList>
952
+ <TabPanel id="tab1">
953
+ <div className="p-4">Click other tabs to see the indicator slide.</div>
954
+ </TabPanel>
955
+ <TabPanel id="tab2">
956
+ <div className="p-4">Notification preferences.</div>
957
+ </TabPanel>
958
+ <TabPanel id="tab3">
959
+ <div className="p-4">Security settings.</div>
960
+ </TabPanel>
961
+ </Tabs>
962
+ ),
963
+ parameters: {
964
+ docs: {
965
+ description: {
966
+ story:
967
+ 'Default animated tabs with a sliding underline indicator via motion.dev `layoutId`. The indicator smoothly transitions between tabs on selection.',
968
+ },
969
+ },
970
+ },
971
+ };
972
+
973
+ /**
974
+ * Animation disabled — indicator jumps instantly between tabs.
975
+ */
976
+ export const NoIndicatorAnimation: Story = {
977
+ render: () => (
978
+ <Tabs defaultSelectedKey="tab1" animated={false}>
979
+ <TabList aria-label="No animation demo">
980
+ <Tab id="tab1">Account</Tab>
981
+ <Tab id="tab2">Notifications</Tab>
982
+ <Tab id="tab3">Security</Tab>
983
+ </TabList>
984
+ <TabPanel id="tab1">
985
+ <div className="p-4">Indicator jumps instantly (no slide).</div>
986
+ </TabPanel>
987
+ <TabPanel id="tab2">
988
+ <div className="p-4">Notification preferences.</div>
989
+ </TabPanel>
990
+ <TabPanel id="tab3">
991
+ <div className="p-4">Security settings.</div>
992
+ </TabPanel>
993
+ </Tabs>
994
+ ),
995
+ parameters: {
996
+ docs: {
997
+ description: {
998
+ story:
999
+ 'Tabs with `animated={false}`. The indicator appears instantly on the selected tab without sliding.',
1000
+ },
1001
+ },
1002
+ },
1003
+ };
1004
+
1005
+ /**
1006
+ * Vertical orientation with animated indicator sliding up and down.
1007
+ */
1008
+ export const VerticalAnimated: Story = {
1009
+ render: () => (
1010
+ <Tabs defaultSelectedKey="tab1" orientation="vertical" animated>
1011
+ <TabList aria-label="Vertical animated demo">
1012
+ <Tab id="tab1">Profile</Tab>
1013
+ <Tab id="tab2">Settings</Tab>
1014
+ <Tab id="tab3">Billing</Tab>
1015
+ </TabList>
1016
+ <TabPanel id="tab1">
1017
+ <div className="p-4">Vertical tabs with sliding indicator.</div>
1018
+ </TabPanel>
1019
+ <TabPanel id="tab2">
1020
+ <div className="p-4">Settings panel.</div>
1021
+ </TabPanel>
1022
+ <TabPanel id="tab3">
1023
+ <div className="p-4">Billing information.</div>
1024
+ </TabPanel>
1025
+ </Tabs>
1026
+ ),
1027
+ parameters: {
1028
+ docs: {
1029
+ description: {
1030
+ story:
1031
+ 'Vertical orientation with animated indicator. The indicator slides vertically between tabs using the same `layoutId` approach.',
1032
+ },
1033
+ },
1034
+ },
1035
+ };