@sb1/ffe-datepicker

13.1.0 • Public • Published

@sb1/ffe-datepicker

This package contains styles for the ffe-datepicker.

Install

npm install --save @sb1/ffe-datepicker

Usage

Full documentation on datepicker usage is available at https://design.sparebank1.no/komponenter/skjemaelementer/#datepicker.

The styles for this package can be used in 3 different ways depending on what you want. For All styles or Only date input you will need the @sb1/ffe-form package in your project.

All styles

You need styles for both the dateinput field and the calendar.

@import 'node_modules/@sb1/ffe-datepicker/less/datepicker.less';
@import 'node_modules/@sb1/ffe-form/less/form.less';

Importing compiled CSS

If your project does not use Less, you can import the compiled styling:

@import '~@sb1/ffe-datepicker/css/datepicker.css';

Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)

<div class="ffe-datepicker">
    <!-- see dateinput section below -->
    <!-- see calendar section below -->
</div>

Only date input styles

@import 'node_modules/@sb1/ffe-datepicker/less/dateinput.less';
@import 'node_modules/@sb1/ffe-form/less/form.less';

Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)

<div class="ffe-dateinput">
    <input class="ffe-dateinput__field ffe-input-field" type="text" />
    <svg class="ffe-dateinput__icon">
        <path ... />
    </svg>
</div>

Only the calendar styles

@import 'node_modules/@sb1/ffe-datepicker/less/calendar.less';

Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)

<div class="ffe-calendar ffe-calendar--datepicker">
    <div class="ffe-calendar__header">
        <div class="ffe-calendar__header-inner-wrapper">
            <button class="ffe-calendar__month-nav ffe-calendar__previous">
                <svg class="ffe-calendar__icon-prev">
                    <path ... />
                </svg>
            </button>
            <header class="ffe-calendar__title">
                <div id="ffe-calendar-499__month-label">
                    <span class="ffe-calendar__month">Juni</span>
                    <span class="ffe-calendar__year">2016</span>
                </div>
            </header>
            <button class="ffe-calendar__month-nav ffe-calendar__next">
                <svg class="ffe-calendar__icon-next">
                    <path ... />
                </svg>
            </button>
        </div>
    </div>
    <table class="ffe-calendar__grid">
        <thead>
            <tr>
                <th class="ffe-calendar__weekday">
                    <span>Man</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Tir</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Ons</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Tor</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Fre</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Lør</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Søn</span>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">1</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">2</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">3</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">4</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">5</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">6</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">7</span>
                </td>
            </tr>
            <tr>
                ... More td
            </tr>
            <tr>
                ... More td
            </tr>
            <tr>
                ... More td
            </tr>
            <tr>
                ... More td
            </tr>
        </tbody>
    </table>
</div>

Theming with CSS custom properties

In order to support theming of components, this package contains styling that depends on a set of custom properties, defined in less/theme.less. These properties in turn depend on a base theme defined in ffe-core.

If your project uses the ffe-core, you're probably good to go. If not, make sure to import the core properties in theme.less:

@import '~@sb1/ffe-core/less/theme';

Development

To start a local development server, run the following from the designsystem root folder:

npm install
npm run build
npm start

A local instance of component-overview with live reloading will run at http://localhost:1234/.

Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
13.1.088latest

Version History

VersionDownloads (Last 7 Days)Published
13.1.088
13.0.158
13.0.140
13.0.130
13.0.120
13.0.110
13.0.100
13.0.90
13.0.80
13.0.70
13.0.60
13.0.50
13.0.40
13.0.30
13.0.20
13.0.10
13.0.00
12.0.590
12.0.580
12.0.570
12.0.560
12.0.550
12.0.540
12.0.530
12.0.520
12.0.510
12.0.500
12.0.490
12.0.480
12.0.470
12.0.460
12.0.450
12.0.440
12.0.430
12.0.420
12.0.410
12.0.4032
12.0.390
12.0.380
12.0.370
12.0.360
12.0.350
12.0.340
12.0.330
12.0.320
12.0.310
12.0.300
12.0.290
12.0.280
12.0.270
12.0.260
12.0.250
12.0.230
12.0.220
12.0.210
12.0.200
12.0.190
12.0.180
12.0.170
12.0.160
12.0.150
12.0.140
12.0.130
12.0.120
12.0.110
12.0.100
12.0.90
12.0.80
12.0.70
12.0.60
12.0.50
12.0.40
12.0.30
12.0.21
12.0.10
12.0.00
11.1.10
11.1.00
11.0.91
11.0.80
11.0.70
11.0.60
11.0.50
11.0.40
11.0.30
11.0.20
11.0.10
11.0.00
10.1.20
10.1.10
10.1.00
10.0.480
10.0.470
10.0.460
10.0.450
10.0.440
10.0.430
10.0.420
10.0.410
10.0.400
10.0.390
10.0.380
10.0.370
10.0.361
10.0.350
10.0.340
10.0.330
10.0.320
10.0.310
10.0.300
10.0.290
10.0.280
10.0.270
10.0.260
10.0.250
10.0.240
10.0.230
10.0.220
10.0.210
10.0.200
10.0.190
10.0.180
10.0.170
10.0.160
10.0.150
10.0.140
10.0.130
10.0.120
10.0.110
10.0.100
10.0.90
10.0.80
10.0.70
10.0.60
10.0.50
10.0.40
10.0.30
10.0.20
10.0.10
10.0.00
9.0.00
8.0.110
8.0.100
8.0.90
8.0.80
8.0.70
8.0.60
8.0.50
8.0.40
8.0.30
8.0.20
8.0.10
8.0.00
7.0.20
7.0.10
7.0.00
6.0.170
6.0.160
6.0.150
6.0.140
6.0.130
6.0.120
6.0.110
6.0.100
6.0.90
6.0.80
6.0.70
6.0.60
6.0.50
6.0.40
6.0.30
6.0.20
6.0.10
6.0.00
5.2.00
5.1.50
5.1.40
5.1.30
5.1.20
5.1.10
5.1.00
5.0.540
5.0.530
5.0.520
5.0.510
5.0.500
5.0.490
5.0.481
5.0.470
5.0.460
5.0.450
5.0.440
5.0.430
5.0.420
5.0.410
5.0.400
5.0.390
5.0.380
5.0.370
5.0.360
5.0.350
5.0.340
5.0.330
5.0.320
5.0.310
5.0.300
5.0.290
5.0.280
5.0.270
5.0.260
5.0.250
5.0.240
5.0.230
5.0.220
5.0.210
5.0.200
5.0.190
5.0.180
5.0.170
5.0.160
5.0.150
5.0.140
5.0.130
5.0.120
5.0.110
5.0.100
5.0.90
5.0.80
5.0.70
5.0.60
5.0.50
5.0.40
5.0.30
5.0.20
5.0.10
5.0.00

Package Sidebar

Install

npm i @sb1/ffe-datepicker

Weekly Downloads

129

Version

13.1.0

License

MIT

Unpacked Size

25.9 kB

Total Files

8

Last publish

Collaborators

  • antidecaf
  • sb1-designsystem
  • kwltrs
  • erlingk