@discourser/design-system 0.6.0 → 0.7.0

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/README.md CHANGED
@@ -651,11 +651,13 @@ This design system uses [figma-token-sync](https://github.com/yourusername/figma
651
651
 
652
652
  **⚠️ IMPORTANT: We use Changesets for version management. Never manually edit the version in `package.json`.**
653
653
 
654
+ **📋 Branching Strategy**: We use a Git Flow-inspired strategy. See [BRANCHING_STRATEGY.md](./BRANCHING_STRATEGY.md) for complete details.
655
+
654
656
  #### For Team Members (Write Access)
655
657
 
656
- 1. **Create a feature branch from `main`:**
658
+ 1. **Create a feature branch from `dev`:**
657
659
  ```bash
658
- git checkout main
660
+ git checkout dev
659
661
  git pull
660
662
  git checkout -b feature/my-feature # or fix/bug-name, docs/readme-update
661
663
  ```
@@ -685,12 +687,14 @@ This design system uses [figma-token-sync](https://github.com/yourusername/figma
685
687
  git push -u origin feature/my-feature
686
688
  ```
687
689
 
688
- 5. **Open a Pull Request to `main`:**
690
+ 5. **Open a Pull Request to `dev`:**
689
691
  - CI will run automatically (lint, test, typecheck, build)
690
692
  - Address any CI failures
691
693
  - Wait for review (if required)
692
694
 
693
- 6. **After your PR is merged:**
695
+ 6. **After your PR is merged to `dev`:**
696
+ - Changes accumulate in `dev` branch
697
+ - Periodically, maintainers merge `dev` → `main` for releases
694
698
  - Changesets bot creates/updates a "Version Packages" PR automatically
695
699
  - When "Version Packages" PR is merged → package publishes to npm automatically via OIDC
696
700
 
@@ -702,13 +706,33 @@ This design system uses [figma-token-sync](https://github.com/yourusername/figma
702
706
  git clone https://github.com/YOUR_USERNAME/Discourser-Design-System.git
703
707
  ```
704
708
 
705
- 3. **Follow steps 1-5 above** (feature branch, changeset, commit)
706
- 4. **Open a Pull Request** from your fork to our `main` branch
709
+ 3. **Follow steps 1-5 above** (feature branch from `dev`, changeset, commit)
710
+ 4. **Open a Pull Request** from your fork to our `dev` branch
707
711
  5. **Wait for maintainer review** - we'll review and merge if approved
708
712
 
713
+ ### Branching Strategy
714
+
715
+ We use a Git Flow-inspired branching strategy:
716
+
717
+ - **`main`** - Production releases only. Only accepts PRs from `dev`.
718
+ - **`dev`** - Integration branch. All feature development branches from here.
719
+ - **`feature/*`** - New features (branch from `dev`, PR to `dev`)
720
+ - **`fix/*`** - Bug fixes (branch from `dev`, PR to `dev`)
721
+ - **`docs/*`** - Documentation (branch from `dev`, PR to `dev`)
722
+
723
+ **Key Rules:**
724
+ - ✅ Create feature branches from `dev`
725
+ - ✅ Open PRs to `dev` (not `main`)
726
+ - ✅ Only `dev` can merge to `main` (for releases)
727
+ - ❌ Don't create feature branches from `main`
728
+ - ❌ Don't open PRs directly to `main` from feature branches
729
+
730
+ See [BRANCHING_STRATEGY.md](./BRANCHING_STRATEGY.md) for complete documentation.
731
+
709
732
  ### Branch Protection
710
733
 
711
- - ✅ `main` is protected - all changes require Pull Requests
734
+ - ✅ `main` is protected - only accepts PRs from `dev`
735
+ - ✅ `dev` is protected - all changes require Pull Requests
712
736
  - ✅ CI must pass before merging (lint, test, typecheck, build)
713
737
  - ✅ Only maintainers can merge to `main`
714
738
  - ✅ Releases only happen from `main` via automated workflow
@@ -717,22 +741,28 @@ This design system uses [figma-token-sync](https://github.com/yourusername/figma
717
741
 
718
742
  **You don't manually publish!** Our CI/CD handles it:
719
743
 
720
- 1. **Changesets accumulate** - Multiple PRs can add changesets
721
- 2. **"Version Packages" PR** - Created automatically when changesets exist
722
- 3. **Review changelog** - Check the auto-generated CHANGELOG.md
723
- 4. **Merge "Version Packages" PR** - Triggers automatic npm publish via OIDC
724
- 5. **Published!** - Package is live on npm with provenance
744
+ 1. **Changesets accumulate in `dev`** - Multiple PRs can add changesets
745
+ 2. **Merge `dev` to `main`** - Create PR from `dev` to `main` when ready to release
746
+ 3. **"Version Packages" PR** - Created automatically when changesets exist on `main`
747
+ 4. **Review changelog** - Check the auto-generated CHANGELOG.md
748
+ 5. **Merge "Version Packages" PR** - Triggers automatic npm publish via OIDC
749
+ 6. **Published!** - Package is live on npm with provenance
725
750
 
726
751
  ### What NOT to Do
727
752
 
728
753
  ❌ Don't manually edit version in `package.json` - use `pnpm changeset`
729
- ❌ Don't push directly to `main` - use Pull Requests
754
+ ❌ Don't push directly to `main` or `dev` - use Pull Requests
755
+ ❌ Don't create feature branches from `main` - use `dev`
756
+ ❌ Don't open PRs to `main` from feature branches - go to `dev` first
730
757
  ❌ Don't merge without CI passing - wait for checks
731
758
  ❌ Don't skip changesets - required for tracking changes
732
759
  ❌ Don't manually run `npm publish` - CI handles it
733
760
 
734
761
  ### Questions?
735
762
 
763
+ - See [BRANCHING_STRATEGY.md](./BRANCHING_STRATEGY.md) for complete branching workflow
764
+ - See [docs/BRANCHING_QUICK_REFERENCE.md](./docs/BRANCHING_QUICK_REFERENCE.md) for quick reference
765
+ - See [docs/BRANCH_PROTECTION_SETUP.md](./docs/BRANCH_PROTECTION_SETUP.md) for maintainer setup guide
736
766
  - See [`.claude/skills/npm-oidc-publishing/SKILL.md`](.claude/skills/npm-oidc-publishing/SKILL.md) for OIDC setup details
737
767
  - See [.github/README.md](.github/README.md) for CI/CD workflow documentation
738
768
  - Ask in Discussions or open an Issue
package/dist/index.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  var factory = require('@ark-ui/react/factory');
4
4
  var utils = require('@ark-ui/react/utils');
5
5
  var react$1 = require('react');
6
+ var css = require('@discourser/design-system/styled-system/css');
6
7
  var jsx = require('@discourser/design-system/styled-system/jsx');
7
8
  var recipes = require('@discourser/design-system/styled-system/recipes');
8
9
  var react = require('@ark-ui/react');
@@ -71,28 +72,53 @@ var Loader = react$1.forwardRef(function Loader2(props, ref) {
71
72
  return /* @__PURE__ */ jsxRuntime.jsx(Span, { ref, display: "contents", ...rest, children });
72
73
  });
73
74
  var BaseButton = jsx.styled(factory.ark.button, recipes.button);
74
- var Button = react$1.forwardRef(function Button2(props, ref) {
75
- const propsContext = useButtonPropsContext();
76
- const buttonProps = react$1.useMemo(
77
- () => utils.mergeProps(propsContext, props),
78
- [propsContext, props]
79
- );
80
- const { loading, loadingText, children, spinner: spinner2, spinnerPlacement, ...rest } = buttonProps;
81
- return /* @__PURE__ */ jsxRuntime.jsx(
82
- BaseButton,
83
- {
84
- type: "button",
85
- ref,
86
- ...rest,
87
- "data-loading": loading ? "" : void 0,
88
- disabled: loading || rest.disabled,
89
- children: !props.asChild && loading ? /* @__PURE__ */ jsxRuntime.jsx(Loader, { spinner: spinner2, text: loadingText, spinnerPlacement, children }) : children
90
- }
91
- );
92
- });
75
+ var Button = react$1.forwardRef(
76
+ function Button2(props, ref) {
77
+ const propsContext = useButtonPropsContext();
78
+ const buttonProps = react$1.useMemo(
79
+ () => utils.mergeProps(propsContext, props),
80
+ [propsContext, props]
81
+ );
82
+ const {
83
+ loading,
84
+ loadingText,
85
+ children,
86
+ spinner: spinner2,
87
+ spinnerPlacement,
88
+ colorPalette = "primary",
89
+ className,
90
+ ...rest
91
+ } = buttonProps;
92
+ const colorPaletteClass = `color-palette_${colorPalette}`;
93
+ const mergedClassName = css.cx(colorPaletteClass, className);
94
+ return /* @__PURE__ */ jsxRuntime.jsx(
95
+ BaseButton,
96
+ {
97
+ type: "button",
98
+ ref,
99
+ ...rest,
100
+ className: mergedClassName,
101
+ "data-loading": loading ? "" : void 0,
102
+ disabled: loading || rest.disabled,
103
+ children: !props.asChild && loading ? /* @__PURE__ */ jsxRuntime.jsx(
104
+ Loader,
105
+ {
106
+ spinner: spinner2,
107
+ text: loadingText,
108
+ spinnerPlacement,
109
+ children
110
+ }
111
+ ) : children
112
+ }
113
+ );
114
+ }
115
+ );
93
116
  var ButtonGroup = react$1.forwardRef(
94
117
  function ButtonGroup2(props, ref) {
95
- const [variantProps, otherProps] = react$1.useMemo(() => recipes.button.splitVariantProps(props), [props]);
118
+ const [variantProps, otherProps] = react$1.useMemo(
119
+ () => recipes.button.splitVariantProps(props),
120
+ [props]
121
+ );
96
122
  return /* @__PURE__ */ jsxRuntime.jsx(ButtonPropsProvider, { value: variantProps, children: /* @__PURE__ */ jsxRuntime.jsx(Group, { ref, ...otherProps }) });
97
123
  }
98
124
  );
@@ -128,7 +154,15 @@ var InputGroup2 = Object.assign(InputGroupRoot, {
128
154
  });
129
155
  var Textarea = jsx.styled(field.Field.Textarea, recipes.textarea);
130
156
  var Heading = jsx.styled("h2", recipes.heading);
131
- var Badge = jsx.styled(factory.ark.div, recipes.badge);
157
+ var BaseBadge = jsx.styled(factory.ark.div, recipes.badge);
158
+ var Badge = react$1.forwardRef(
159
+ function Badge2(props, ref) {
160
+ const { colorPalette = "primary", className, ...rest } = props;
161
+ const colorPaletteClass = css.css({ colorPalette });
162
+ const mergedClassName = css.cx(colorPaletteClass, className);
163
+ return /* @__PURE__ */ jsxRuntime.jsx(BaseBadge, { ref, ...rest, className: mergedClassName });
164
+ }
165
+ );
132
166
 
133
167
  // src/components/CloseButton.tsx
134
168
  var CloseButton_exports = {};
@@ -759,11 +793,6 @@ var Tooltip = react$1.forwardRef(function Tooltip2(props, ref) {
759
793
  ] });
760
794
  });
761
795
 
762
- // src/components/index.ts
763
- var Button3 = Object.assign(Button, {
764
- Group: ButtonGroup
765
- });
766
-
767
796
  // node_modules/.pnpm/@pandacss+dev@1.8.0_hono@4.11.3_jsdom@27.4.0_typescript@5.9.3/node_modules/@pandacss/dev/dist/index.mjs
768
797
  function defineRecipe(config) {
769
798
  return config;
@@ -1848,7 +1877,8 @@ exports.AbsoluteCenter = AbsoluteCenter_exports;
1848
1877
  exports.Accordion = Accordion_exports;
1849
1878
  exports.Avatar = Avatar_exports;
1850
1879
  exports.Badge = Badge;
1851
- exports.Button = Button3;
1880
+ exports.Button = Button;
1881
+ exports.ButtonGroup = ButtonGroup;
1852
1882
  exports.Card = Card_exports;
1853
1883
  exports.Checkbox = Checkbox_exports;
1854
1884
  exports.CloseButton = CloseButton_exports;